From 18da06b91833baed22a96d8f821dd5df72dc28ef Mon Sep 17 00:00:00 2001 From: TJ Miller Date: Thu, 9 May 2019 15:03:45 -0400 Subject: [PATCH] Update Travis and Laravel Events (#59) --- .travis.yml | 76 +++++++++++++++++++++++++++++++++++++++------- composer.json | 16 +++++----- src/Migrator.php | 8 ++--- tests/TestCase.php | 2 +- 4 files changed, 78 insertions(+), 24 deletions(-) diff --git a/.travis.yml b/.travis.yml index 50c4a96..db54a4a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,20 +1,74 @@ -language: php - -php: - - 7.0 - - 7.1 - - 7.2 - - 7.3 - -sudo: false - cache: directories: - $HOME/.composer/cache +language: php + +env: + global: + - COVERAGE=0 + +matrix: + include: + - php: 7.1 + env: LARAVEL='5.5.*' TESTBENCH='3.5.*' COMPOSER_FLAGS='--prefer-lowest' + - php: 7.1 + env: LARAVEL='5.5.*' TESTBENCH='3.5.*' COMPOSER_FLAGS='--prefer-stable' + - php: 7.1 + env: LARAVEL='5.6.*' TESTBENCH='3.6.*' COMPOSER_FLAGS='--prefer-lowest' + - php: 7.1 + env: LARAVEL='5.6.*' TESTBENCH='3.6.*' COMPOSER_FLAGS='--prefer-stable' + - php: 7.1 + env: LARAVEL='5.7.*' TESTBENCH='3.7.*' COMPOSER_FLAGS='--prefer-lowest' + - php: 7.1 + env: LARAVEL='5.7.*' TESTBENCH='3.7.*' COMPOSER_FLAGS='--prefer-stable' + - php: 7.1 + env: LARAVEL='5.8.*' TESTBENCH='3.8.*' COMPOSER_FLAGS='--prefer-lowest' + - php: 7.1 + env: LARAVEL='5.8.*' TESTBENCH='3.8.*' COMPOSER_FLAGS='--prefer-stable' + - php: 7.2 + env: LARAVEL='5.5.*' TESTBENCH='3.5.*' COMPOSER_FLAGS='--prefer-lowest' + - php: 7.2 + env: LARAVEL='5.5.*' TESTBENCH='3.5.*' COMPOSER_FLAGS='--prefer-stable' + - php: 7.2 + env: LARAVEL='5.6.*' TESTBENCH='3.6.*' COMPOSER_FLAGS='--prefer-lowest' + - php: 7.2 + env: LARAVEL='5.6.*' TESTBENCH='3.6.*' COMPOSER_FLAGS='--prefer-stable' + - php: 7.2 + env: LARAVEL='5.7.*' TESTBENCH='3.7.*' COMPOSER_FLAGS='--prefer-lowest' + - php: 7.2 + env: LARAVEL='5.7.*' TESTBENCH='3.7.*' COMPOSER_FLAGS='--prefer-stable' + - php: 7.2 + env: LARAVEL='5.8.*' TESTBENCH='3.8.*' COMPOSER_FLAGS='--prefer-lowest' + - php: 7.2 + env: LARAVEL='5.8.*' TESTBENCH='3.8.*' COMPOSER_FLAGS='--prefer-stable' + - php: 7.3 + env: LARAVEL='5.5.*' TESTBENCH='3.5.*' COMPOSER_FLAGS='--prefer-lowest' + - php: 7.3 + env: LARAVEL='5.5.*' TESTBENCH='3.5.*' COMPOSER_FLAGS='--prefer-stable' + - php: 7.3 + env: LARAVEL='5.6.*' TESTBENCH='3.6.*' COMPOSER_FLAGS='--prefer-lowest' + - php: 7.3 + env: LARAVEL='5.6.*' TESTBENCH='3.6.*' COMPOSER_FLAGS='--prefer-stable' + - php: 7.3 + env: LARAVEL='5.7.*' TESTBENCH='3.7.*' COMPOSER_FLAGS='--prefer-lowest' + - php: 7.3 + env: LARAVEL='5.7.*' TESTBENCH='3.7.*' COMPOSER_FLAGS='--prefer-stable' + - php: 7.3 + env: LARAVEL='5.8.*' TESTBENCH='3.8.*' COMPOSER_FLAGS='--prefer-lowest' + - php: 7.3 + env: LARAVEL='5.8.*' TESTBENCH='3.8.*' COMPOSER_FLAGS='--prefer-stable' + fast_finish: true + before_script: + - composer config discard-changes true + +before_install: - travis_retry composer self-update - - travis_retry composer update --no-interaction --prefer-dist + - travis_retry composer require "laravel/framework:${LARAVEL}" "orchestra/testbench:${TESTBENCH}" --no-interaction --no-update + +install: + - travis_retry composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction --no-suggest script: - vendor/bin/phpunit diff --git a/composer.json b/composer.json index 4e33a67..6c96597 100755 --- a/composer.json +++ b/composer.json @@ -19,17 +19,17 @@ } ], "require" : { - "php" : "^7.0", - "illuminate/config" : "^5.4", - "illuminate/contracts" : "^5.4", - "illuminate/events" : "^5.4", - "illuminate/http" : "^5.4", - "illuminate/support" : "^5.4" + "php" : "^7.1", + "illuminate/config" : "^5.5", + "illuminate/contracts" : "^5.5", + "illuminate/events" : "^5.5", + "illuminate/http" : "^5.5", + "illuminate/support" : "^5.5" }, "require-dev" : { - "phpunit/phpunit" : "^6.0", + "phpunit/phpunit" : "^6.0|^7.0", "orchestra/testbench" : "~3.5", - "mockery/mockery": "^0.9.5" + "mockery/mockery": "^1.0" }, "autoload" : { "psr-4" : { diff --git a/src/Migrator.php b/src/Migrator.php index 9f63368..859b267 100644 --- a/src/Migrator.php +++ b/src/Migrator.php @@ -118,11 +118,11 @@ public function processRequestMigrations() : Request $class = new $migration(); $originalRequest = $this->request; - Event::fire(new RequestIsMigrating($class, $originalRequest)); + Event::dispatch(new RequestIsMigrating($class, $originalRequest)); $this->request = $class->migrateRequest($originalRequest); - Event::fire(new RequestHasMigrated($class, $originalRequest, $this->request)); + Event::dispatch(new RequestHasMigrated($class, $originalRequest, $this->request)); }); return $this->request; @@ -147,11 +147,11 @@ public function processResponseMigrations(Response $response) $class = new $migration(); $originalResponse = $this->response; - Event::fire(new ResponseIsMigrating($class, $originalResponse)); + Event::dispatch(new ResponseIsMigrating($class, $originalResponse)); $this->response = $class->migrateResponse($originalResponse); - Event::fire(new ResponseHasMigrated($class, $originalResponse, $this->response)); + Event::dispatch(new ResponseHasMigrated($class, $originalResponse, $this->response)); }); } diff --git a/tests/TestCase.php b/tests/TestCase.php index a2a20b8..e5bbb76 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -16,7 +16,7 @@ abstract class TestCase extends Orchestra { - public function setUp() + public function setUp() : void { parent::setUp(); $this->setupConfig($this->app);