Skip to content

Commit

Permalink
Merge pull request #13 from xificurk/extension-fix
Browse files Browse the repository at this point in the history
SkautisExtension: opraveno expandovani parametru konfigurace
  • Loading branch information
xificurk committed Jul 1, 2015
2 parents 79647fc + 799f429 commit 88c324d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/SkautisExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SkautisExtension extends Nette\DI\CompilerExtension
public $defaults = array(
'applicationId' => NULL,
'testMode' => FALSE,
'profiler' => '%debugMode%',
'profiler' => NULL,
'cache' => TRUE,
'compression' => TRUE,
);
Expand All @@ -29,6 +29,7 @@ public function loadConfiguration()
{
$container = $this->getContainerBuilder();
$config = $this->validateConfig($this->defaults);
$config['profiler'] = isset($config['profiler']) ? $config['profiler'] : !empty($container->parameters['debugMode']);

$container->addDefinition($this->prefix('config'))
->setClass('Skautis\Config', array($config['applicationId'], $config['testMode'], $config['cache'], $config['compression']));
Expand Down
File renamed without changes.
16 changes: 16 additions & 0 deletions tests/SkautisNette/SkautisExtension.production.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

use Tester\Assert;


require __DIR__ . '/../bootstrap.php';


$configurator = new Nette\Configurator;
$configurator->setTempDirectory(TEMP_DIR);
$configurator->setDebugMode(FALSE);
$configurator->addConfig(__DIR__ . '/files/config.neon');
$container = $configurator->createContainer();

Assert::type('Skautis\Skautis', $container->getService('skautis.skautis'));
Assert::false($container->hasService('skautis.panel'));
1 change: 0 additions & 1 deletion tests/SkautisNette/files/config.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ extensions:

skautis:
applicationId: test
profiler: true

0 comments on commit 88c324d

Please sign in to comment.