-
git clone https://github.com/scil/LaravelFly.git <fly_dev_dir>
-
add following to the composer.json of a project with Laravel
"repositories": [
{
"type": "path",
"url": "<fly_dev_dir>"
}
]
cd <fly_dev_dir> && composer install --prefer-source
.
If the project is in a VirtualBox shared dir, it may failed to symlinking to <fly_dev_dir>, the solution is https://www.virtualbox.org/ticket/10085#comment:32
--prefer-source
to load laravel/framework/tests ( How to download excluded paths via composer? )
- set this env var in <fly_dev_dir>/phpunit.xml.dist
<env name="LARAVEL_PROJECT_ROOT" value=""/>
- see comments in tests/BaseTestCase.php
- overwrite artisan command 'config.cache' which could load laravelfly.php in config dir. code: LaravelFly\Providers\ConfigCacheCommand
Update laravel-fly-files for updated minor version of Laravel
( If env is ready-made, go to step 3 and 4.)
e.g. updating_dir Laravel 5.7.28
- create a new project
mkdir updating_dir
cd updating_dir
vi composer.json
edit 'updating_dir/composer.json'
"require": {
...
"laravel/framework": "5.7.*",
"scil/laravel-fly": "dev-master"
},
"autoload-dev": {
"psr-4": {
...
"LaravelFly\\Tests\\": "vendor/scil/laravel-fly/tests/"
}
},
"repositories": [
{
"type": "path",
"url": "vendor/scil/laravel-fly-files-local"
}
]
then
composer install
cp -R vendor/scil/laravel-fly-files vendor/scil/laravel-fly-files-local
- edit
vendor/scil/laravel-fly-files-local/composer.json
"laravel/framework": "5.7.28"
- edit
vendor/scil/laravel-fly/phpunit.xml.dist
<env name="LARAVEL_VERSION_PROJECT_ROOT" value="./../../../../updating_dir"/>
- update then run test at laravel project root
composer update
phpunit=vendor/bin/phpunit
xml=vendor/scil/laravel-fly/phpunit.xml.dist
$phpunit --stop-on-failure -c $xml --testsuit only_fly