我想建立一个测试方案,在这里我可以分离PHPUnit和Laravel Dusk的测试版本。原因是,我希望为每个测试方法运行不同的.env
和phpunit.xml
文件。
我已经阅读了有关工作和矩阵的Travis文档,但找不到适合我的方法。
我的.travis.yml
文件:
sudo: true
dist: trusty
language: php
php:
- 7.3
addons:
chrome: stable
apt:
sources:
- mysql-5.7-trusty
packages:
- mysql-server
- mysql-client
services:
- mysql
install:
- composer self-update
- travis_retry composer install --no-interaction --prefer-dist --no-suggest
before_script:
- rm composer.lock
- echo -e "[server]\nmax_allowed_packet=64M" | sudo tee -a /etc/mysql/conf.d/drupal.cnf
- sudo service mysql restart
- mysql -e 'CREATE DATABASE testing;'
- mysql -e 'CREATE DATABASE business_external;'
- mysql business_external < /home/travis/build/StanBarrows/business/database/data/business_external
- google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
- cp .env.travis .env
- cp phpunit.travis.xml phpunit.xml
- php artisan key:generate
- php artisan storage:link
- php artisan serve &
script:
- vendor/bin/phpunit
- php artisan dusk
notifications:
email: false