From 7f98b78945876d841c740becdaa9d4655ec55c63 Mon Sep 17 00:00:00 2001 From: thangnn Date: Fri, 1 Nov 2024 15:29:20 +0700 Subject: [PATCH] Add unitTest_UpdateCommand_execute --- plugins/baser-core/src/Command/UpdateCommand.php | 1 + .../baser-core/tests/TestCase/Command/UpdateCommandTest.php | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/baser-core/src/Command/UpdateCommand.php b/plugins/baser-core/src/Command/UpdateCommand.php index bca60e0d70..de2e127d64 100644 --- a/plugins/baser-core/src/Command/UpdateCommand.php +++ b/plugins/baser-core/src/Command/UpdateCommand.php @@ -58,6 +58,7 @@ protected function buildOptionParser(\Cake\Console\ConsoleOptionParser $parser): * @return int|void|null * @checked * @noTodo + * @unitTest */ public function execute(Arguments $args, ConsoleIo $io) { diff --git a/plugins/baser-core/tests/TestCase/Command/UpdateCommandTest.php b/plugins/baser-core/tests/TestCase/Command/UpdateCommandTest.php index bba221be98..da318b6776 100644 --- a/plugins/baser-core/tests/TestCase/Command/UpdateCommandTest.php +++ b/plugins/baser-core/tests/TestCase/Command/UpdateCommandTest.php @@ -4,6 +4,7 @@ use BaserCore\Command\UpdateCommand; use BaserCore\TestSuite\BcTestCase; +use Cake\Command\Command; use Cake\Console\ConsoleOptionParser; use Cake\Console\TestSuite\ConsoleIntegrationTestTrait; @@ -55,6 +56,8 @@ public function testBuildOptionParser() */ public function testExecute() { - $this->markTestIncomplete('このテストは、まだ実装されていません。'); + $this->exec('update'); + $this->assertExitCode(Command::CODE_SUCCESS); + $this->assertOutputContains('Migration と アップデーターによるアップデートが完了しました。'); } }