From 19a90068053e3606d1b42cc9a6acb109f3aa6b9e Mon Sep 17 00:00:00 2001 From: thangnn Date: Wed, 30 Oct 2024 13:38:16 +0700 Subject: [PATCH] Add unitTest_SetupTestCommand_execute --- .../src/Command/SetupTestCommand.php | 1 + .../TestCase/Command/SetupTestCommandTest.php | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 plugins/baser-core/tests/TestCase/Command/SetupTestCommandTest.php diff --git a/plugins/baser-core/src/Command/SetupTestCommand.php b/plugins/baser-core/src/Command/SetupTestCommand.php index a08822660e..4efa255db0 100644 --- a/plugins/baser-core/src/Command/SetupTestCommand.php +++ b/plugins/baser-core/src/Command/SetupTestCommand.php @@ -39,6 +39,7 @@ class SetupTestCommand extends Command * @return int|void|null * @checked * @noTodo + * @unitTest */ public function execute(Arguments $args, ConsoleIo $io) { diff --git a/plugins/baser-core/tests/TestCase/Command/SetupTestCommandTest.php b/plugins/baser-core/tests/TestCase/Command/SetupTestCommandTest.php new file mode 100644 index 0000000000..04d3f25028 --- /dev/null +++ b/plugins/baser-core/tests/TestCase/Command/SetupTestCommandTest.php @@ -0,0 +1,32 @@ +command = new SetupTestCommand(); + } + + public function tearDown(): void + { + parent::tearDown(); + } + + public function testExecute() + { + $args = new Arguments([], [], []); + $io = new ConsoleIo(); + $this->command->execute($args, $io); + $this->assertEquals('true', env('DEBUG')); + $this->assertEquals('true' ,env('USE_CORE_API')); + $this->assertEquals('true' ,env('USE_CORE_ADMIN_API')); + } +}