Skip to content

Commit

Permalink
Enhance command test
Browse files Browse the repository at this point in the history
  • Loading branch information
xepozz committed Oct 14, 2023
1 parent a6f920e commit 1ed2ddf
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tests/Support/Application/config/.merge-plan.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

return [
'/'=>[
'params' => [

]
],
];
13 changes: 13 additions & 0 deletions tests/Support/Application/config/param1.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

declare(strict_types=1);

return [
'/'=>[
'params' => [
'yiitest/yii-debug' => [
'param1.php'
]
]
],
];
7 changes: 6 additions & 1 deletion tests/Unit/Command/DebugContainerCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,16 @@ public function testCommand()
$storage->expects($this->never())->method('clear');
$debugger = new Debugger($idGenerator, $storage, []);

$command = new DebugContainerCommand($container, $debugger);
$config = $container->get(ConfigInterface::class);
// trigger config build
$config->get('params');

$command = new DebugContainerCommand($container, $debugger);
$commandTester = new CommandTester($command);

$commandTester->execute([]);

$this->assertEquals(0, $commandTester->getStatusCode());
}

private function createContainer(): ContainerInterface
Expand Down

0 comments on commit 1ed2ddf

Please sign in to comment.