Skip to content

Latest commit

 

History

History
94 lines (71 loc) · 2.18 KB

dev.md

File metadata and controls

94 lines (71 loc) · 2.18 KB

Dev starter

  1. git clone https://github.com/scil/LaravelFly.git <fly_dev_dir>

  2. add following to the composer.json of a project with Laravel

  "repositories": [
    {
      "type": "path",
      "url": "<fly_dev_dir>"
    }
  ]
  1. 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? )

test with phpunit

  1. set this env var in <fly_dev_dir>/phpunit.xml.dist
        <env name="LARAVEL_PROJECT_ROOT" value=""/>
  1. see comments in tests/BaseTestCase.php

Bridge between Laravel and LaravelFly

  • 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

  1. 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
  1. edit vendor/scil/laravel-fly-files-local/composer.json
    "laravel/framework": "5.7.28"
  1. edit vendor/scil/laravel-fly/phpunit.xml.dist
        <env name="LARAVEL_VERSION_PROJECT_ROOT" value="./../../../../updating_dir"/>
  1. 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