Skip to content

Commit c166de4

Browse files
committed
Replace _out->messages() assertions with assertOutputContains in test cases
1 parent 0bb1266 commit c166de4

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

tests/TestCase/Command/ExportCommandTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
namespace DatabaseBackup\Test\TestCase\Command;
1717

1818
use Cake\Console\TestSuite\ConsoleIntegrationTestTrait;
19+
use Cake\Console\TestSuite\StubConsoleOutput;
1920
use Cake\Core\Configure;
2021
use DatabaseBackup\Command\ExportCommand;
2122
use DatabaseBackup\TestSuite\TestCase;
@@ -29,8 +30,6 @@
2930

3031
/**
3132
* ExportCommandTest.
32-
*
33-
* @property \Cake\Console\TestSuite\StubConsoleOutput $_out
3433
*/
3534
#[CoversClass(ExportCommand::class)]
3635
class ExportCommandTest extends TestCase
@@ -72,7 +71,7 @@ public function testBuildOptionParser(): void
7271
--verbose, -v Enable verbose output.
7372
7473
txt;
75-
$this->assertSame($expected, $this->_out->messages()[0]);
74+
$this->assertOutputContains($expected);
7675
}
7776

7877
#[Test]

tests/TestCase/Command/ImportCommandTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929

3030
/**
3131
* ImportCommandTest.
32-
*
33-
* @property \Cake\Console\TestSuite\StubConsoleOutput $_out
3432
*/
3533
#[CoversClass(ImportCommand::class)]
3634
class ImportCommandTest extends TestCase
@@ -72,7 +70,7 @@ public function testBuildOptionParser(): void
7270
(default target directory).
7371
7472
txt;
75-
$this->assertSame($expected, $this->_out->messages()[0]);
73+
$this->assertOutputContains($expected);
7674
}
7775

7876
#[Test]

0 commit comments

Comments
 (0)