File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -14,19 +14,19 @@ trait DriverSkipTrait {
14
14
* @param string $message
15
15
* @return void
16
16
*/
17
- protected function skipIfNotDriver ($ type , $ message ) {
17
+ protected function skipIfNotDriver (string $ type , string $ message = '' ) {
18
18
$ config = ConnectionManager::getConfig ('test ' );
19
- $ this ->skipIf (strpos ($ config ['driver ' ], $ type ) === false );
19
+ $ this ->skipIf (strpos ($ config ['driver ' ], $ type ) === false , $ message );
20
20
}
21
21
22
22
/**
23
23
* @param string $type
24
24
* @param string $message
25
25
* @return void
26
26
*/
27
- protected function skipIfDriver ($ type , $ message ) {
27
+ protected function skipIfDriver (string $ type , string $ message = '' ) {
28
28
$ config = ConnectionManager::getConfig ('test ' );
29
- $ this ->skipIf (strpos ($ config ['driver ' ], $ type ) !== false );
29
+ $ this ->skipIf (strpos ($ config ['driver ' ], $ type ) !== false , $ message );
30
30
}
31
31
32
32
}
Original file line number Diff line number Diff line change 4
4
5
5
use Cake \Console \TestSuite \ConsoleIntegrationTestTrait ;
6
6
use Cake \TestSuite \TestCase ;
7
+ use Setup \TestSuite \DriverSkipTrait ;
7
8
8
9
/**
9
10
* UserUpdate command test
10
11
*/
11
12
class DbInitCommandTest extends TestCase {
12
13
13
14
use ConsoleIntegrationTestTrait;
15
+ use DriverSkipTrait;
14
16
15
17
/**
16
18
* @return void
@@ -23,6 +25,8 @@ public function setUp(): void {
23
25
* @return void
24
26
*/
25
27
public function testInit () {
28
+ $ this ->skipIfNotDriver ('Sqlite ' );
29
+
26
30
$ this ->exec ('db init ' );
27
31
28
32
$ this ->assertErrorContains ('Using in-memory database, skipping ' );
You can’t perform that action at this time.
0 commit comments