Skip to content

Commit

Permalink
Merge pull request #23 from JanMikes/fix-ignored-slimConfiguration
Browse files Browse the repository at this point in the history
Fix ignored slimConfiguration setting
  • Loading branch information
Petr Hejna authored Dec 7, 2018
2 parents 554551f + 42d459b commit 62bbb25
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/SlimApplicationFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function __construct(array $configuration, Container $container)

public function create(): SlimApp
{
$app = new SlimApp($this->configuration);
$app = new SlimApp($this->configuration['slimConfiguration']);

$configuration = $this->getConfiguration($this->configuration['apiDefinitionKey']);

Expand Down
8 changes: 8 additions & 0 deletions tests/SlimApplicationFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
final class SlimApplicationFactoryTest extends TestCase
{

public function testShouldPassSettingsToSlimContainer(): void
{
$app = $this->createSlimApp();
$settings = $app->getContainer()->get('settings');

$this->assertSame('Dummy', $settings['myCustomOption']);
}

public function testShouldAllowEmptyErrorHandlers(): void
{
$this->createSlimApp(__DIR__ . '/configNoHandlers.neon');
Expand Down
1 change: 1 addition & 0 deletions tests/config.neon
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@ slimApi:
slimConfiguration:
settings:
removeDefaultHandlers: true
myCustomOption: 'Dummy'

apiDefinitionKey: "api"

0 comments on commit 62bbb25

Please sign in to comment.