Skip to content

Commit

Permalink
Merge pull request #3961 from thangnnmd/unitTest_SetupTestCommand_exe…
Browse files Browse the repository at this point in the history
…cute

SetupTestCommand::execute
  • Loading branch information
HungDV2022 authored Nov 7, 2024
2 parents 52a3a03 + 7ee9e3c commit 0c7e0c1
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions plugins/baser-core/src/Command/SetupTestCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class SetupTestCommand extends Command
* @return int|void|null
* @checked
* @noTodo
* @unitTest
*/
public function execute(Arguments $args, ConsoleIo $io)
{
Expand Down
32 changes: 32 additions & 0 deletions plugins/baser-core/tests/TestCase/Command/SetupTestCommandTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace BaserCore\Test\TestCase\Command;

use BaserCore\Command\SetupTestCommand;
use BaserCore\TestSuite\BcTestCase;
use Cake\Console\Arguments;
use Cake\Console\ConsoleIo;

class SetupTestCommandTest extends BcTestCase
{
public function setUp(): void
{
parent::setUp();
$this->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'));
}
}

0 comments on commit 0c7e0c1

Please sign in to comment.