From 1ed2ddff9cb823096b353fc25ca5f628726a683c Mon Sep 17 00:00:00 2001 From: Dmitrii Derepko Date: Sat, 14 Oct 2023 10:12:08 +0300 Subject: [PATCH] Enhance command test --- tests/Support/Application/config/.merge-plan.php | 2 ++ tests/Support/Application/config/param1.php | 13 +++++++++++++ tests/Unit/Command/DebugContainerCommandTest.php | 7 ++++++- 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 tests/Support/Application/config/param1.php diff --git a/tests/Support/Application/config/.merge-plan.php b/tests/Support/Application/config/.merge-plan.php index 957a4471c..f60be9931 100644 --- a/tests/Support/Application/config/.merge-plan.php +++ b/tests/Support/Application/config/.merge-plan.php @@ -4,6 +4,8 @@ return [ '/'=>[ + 'params' => [ + ] ], ]; diff --git a/tests/Support/Application/config/param1.php b/tests/Support/Application/config/param1.php new file mode 100644 index 000000000..c1afe1996 --- /dev/null +++ b/tests/Support/Application/config/param1.php @@ -0,0 +1,13 @@ +[ + 'params' => [ + 'yiitest/yii-debug' => [ + 'param1.php' + ] + ] + ], +]; diff --git a/tests/Unit/Command/DebugContainerCommandTest.php b/tests/Unit/Command/DebugContainerCommandTest.php index dc039de5d..699bd8fe2 100644 --- a/tests/Unit/Command/DebugContainerCommandTest.php +++ b/tests/Unit/Command/DebugContainerCommandTest.php @@ -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