Skip to content

Commit 70fac8b

Browse files
committed
Upgrade test tooling to support newer Symfony components
1 parent 0644e83 commit 70fac8b

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
"laravel/framework": "^5.4 || ^6.0 || ^7.0",
2626
"laravel/horizon": "^1.0 || ^2.0 || ^3.0 || ^4.0",
2727
"laravel/lumen-framework": "^5.4 || ^6.0 || ^7.0",
28-
"mockery/mockery": "0.9.*",
29-
"phpunit/phpunit": "^4.8"
28+
"mockery/mockery": "^1.3",
29+
"phpunit/phpunit": "^5.0"
3030
},
3131
"autoload": {
3232
"psr-4": {

tests/Support/ArtisanProcess.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,17 @@ public function __construct(array $connectionConfig, $command)
3232
var_export($connectionConfig, true)
3333
));
3434

35-
parent::__construct(
36-
(new PhpExecutableFinder())->find() . ' artisan ' . $command,
37-
ApplicationFactory::APP_PATH
38-
);
35+
$command = [ (new PhpExecutableFinder())->find(), 'artisan', $command ];
36+
$laravelVersion = ApplicationFactory::getApplicationVersion();
37+
38+
// Symfony removed support for string commands in newer versions. When
39+
// running Laravel >= 7, pass the command as an array. Otherwise, send
40+
// it as a string:
41+
//
42+
if (version_compare($laravelVersion, '7.0', 'lt')) {
43+
$command = implode(' ', $command);
44+
}
45+
46+
parent::__construct($command, ApplicationFactory::APP_PATH);
3947
}
4048
}

0 commit comments

Comments
 (0)