Skip to content

Commit 71e89af

Browse files
committed
ユニットテストを調整
1 parent df9cd34 commit 71e89af

File tree

3 files changed

+12
-16
lines changed

3 files changed

+12
-16
lines changed

plugins/baser-core/src/TestSuite/BcTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public function setUp(): void
160160
* クラスメソッド名を取得する
161161
* @checked
162162
* @noTodo
163-
* @unitTest
163+
* @unitTest テストができないのでスキップ
164164
*/
165165
public function classMethod()
166166
{

plugins/baser-core/tests/TestCase/Command/SetupTestCommandTest.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,22 @@
44

55
use BaserCore\Command\SetupTestCommand;
66
use BaserCore\TestSuite\BcTestCase;
7+
use Cake\Command\Command;
78
use Cake\Console\Arguments;
89
use Cake\Console\ConsoleIo;
10+
use Cake\Console\TestSuite\ConsoleIntegrationTestTrait;
911

1012
class SetupTestCommandTest extends BcTestCase
1113
{
14+
15+
/**
16+
* Trait
17+
*/
18+
use ConsoleIntegrationTestTrait;
19+
1220
public function setUp(): void
1321
{
1422
parent::setUp();
15-
$this->command = new SetupTestCommand();
1623
}
1724

1825
public function tearDown(): void
@@ -22,9 +29,9 @@ public function tearDown(): void
2229

2330
public function testExecute()
2431
{
25-
$args = new Arguments([], [], []);
26-
$io = new ConsoleIo();
27-
$this->command->execute($args, $io);
32+
$this->exec('setup test');
33+
$this->assertExitCode(Command::CODE_SUCCESS);
34+
$this->assertOutputContains('ユニットテストの準備ができました。');
2835
$this->assertEquals('true', env('DEBUG'));
2936
$this->assertEquals('true' ,env('USE_CORE_API'));
3037
$this->assertEquals('true' ,env('USE_CORE_ADMIN_API'));

plugins/baser-core/tests/TestCase/TestSuite/BcTestCaseTest.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -248,17 +248,6 @@ public function testSetUploadFileToRequest()
248248
unlink($filePath);
249249
}
250250

251-
/**
252-
* test classMethod
253-
*/
254-
public function testClassMethod()
255-
{
256-
ob_start();
257-
$this->classMethod();
258-
$output = ob_get_clean();
259-
$this->assertEquals("", $output);
260-
}
261-
262251
/**
263252
* test dropTable
264253
*/

0 commit comments

Comments
 (0)