Skip to content

Commit

Permalink
Update Travis and Laravel Events (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
sixlive committed May 9, 2019
1 parent f44b5e2 commit 18da06b
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 24 deletions.
76 changes: 65 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" : {
Expand Down
8 changes: 4 additions & 4 deletions src/Migrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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));
});
}

Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

abstract class TestCase extends Orchestra
{
public function setUp()
public function setUp() : void
{
parent::setUp();
$this->setupConfig($this->app);
Expand Down

0 comments on commit 18da06b

Please sign in to comment.