Skip to content

Commit

Permalink
Upgrade test tooling to support newer Symfony components
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrossignol committed Mar 19, 2020
1 parent 0644e83 commit 70fac8b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"laravel/framework": "^5.4 || ^6.0 || ^7.0",
"laravel/horizon": "^1.0 || ^2.0 || ^3.0 || ^4.0",
"laravel/lumen-framework": "^5.4 || ^6.0 || ^7.0",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "^4.8"
"mockery/mockery": "^1.3",
"phpunit/phpunit": "^5.0"
},
"autoload": {
"psr-4": {
Expand Down
16 changes: 12 additions & 4 deletions tests/Support/ArtisanProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,17 @@ public function __construct(array $connectionConfig, $command)
var_export($connectionConfig, true)
));

parent::__construct(
(new PhpExecutableFinder())->find() . ' artisan ' . $command,
ApplicationFactory::APP_PATH
);
$command = [ (new PhpExecutableFinder())->find(), 'artisan', $command ];
$laravelVersion = ApplicationFactory::getApplicationVersion();

// Symfony removed support for string commands in newer versions. When
// running Laravel >= 7, pass the command as an array. Otherwise, send
// it as a string:
//
if (version_compare($laravelVersion, '7.0', 'lt')) {
$command = implode(' ', $command);
}

parent::__construct($command, ApplicationFactory::APP_PATH);
}
}

0 comments on commit 70fac8b

Please sign in to comment.