-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3970 from thangnnmd/unitTest_SetupInstallCommand_…
…execute SetupInstallCommand::execute
- Loading branch information
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
plugins/baser-core/tests/TestCase/Command/SetupInstallCommandTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
namespace BaserCore\Test\TestCase\Command; | ||
|
||
use BaserCore\TestSuite\BcTestCase; | ||
use Cake\Command\Command; | ||
use Cake\Console\TestSuite\ConsoleIntegrationTestTrait; | ||
|
||
class SetupInstallCommandTest extends BcTestCase | ||
{ | ||
/** | ||
* Trait | ||
*/ | ||
use ConsoleIntegrationTestTrait; | ||
|
||
/** | ||
* setUp | ||
* | ||
* @return void | ||
*/ | ||
public function setUp(): void | ||
{ | ||
parent::setUp(); | ||
} | ||
|
||
/** | ||
* tearDown | ||
* | ||
* @return void | ||
*/ | ||
public function tearDown(): void | ||
{ | ||
parent::tearDown(); | ||
} | ||
|
||
/** | ||
* test execute | ||
*/ | ||
public function testExecute() | ||
{ | ||
//backup file | ||
copy(ROOT . DS . 'config' . DS . 'install.php', ROOT . DS . 'config' . DS . 'install.php.bak'); | ||
//test | ||
$this->exec('setup install'); | ||
$this->assertExitCode(Command::CODE_SUCCESS); | ||
$this->assertOutputContains('インストールの準備ができました。'); | ||
|
||
//backup | ||
rename(ROOT . DS . 'config' . DS . 'install.php.bak', ROOT . DS . 'config' . DS . 'install.php'); | ||
} | ||
} |