Skip to content

Commit

Permalink
Merge pull request #33 from intraordinaire/feature/laravel-5.8
Browse files Browse the repository at this point in the history
⬆️ Upgrading to Laravel 5.8
  • Loading branch information
mfrancois authored Jul 10, 2019
2 parents badfdab + 326fed8 commit dd97a59
Show file tree
Hide file tree
Showing 14 changed files with 47 additions and 37 deletions.
14 changes: 3 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
language: php

php:
- 7.1
- 7.1.3
- 7.2
env:
global:
- setup=basic

matrix:
include:
- php: 7.1
env: setup=lowest
- php: 7.1
env: setup=stable
fast_finish: true

sudo: false

services:
Expand All @@ -25,8 +22,6 @@ before_install:

install:
- if [[ $setup = 'basic' ]]; then travis_retry composer install --no-interaction --prefer-dist --no-suggest; fi
- if [[ $setup = 'stable' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable --no-suggest; fi
- if [[ $setup = 'lowest' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-lowest --prefer-stable --no-suggest; fi

script:
- >
Expand All @@ -36,9 +31,6 @@ script:
vendor/phpunit/phpunit/phpunit --configuration phpunit.xml --coverage-clover=coverage.clover
fi
matrix:
fast_finish: true

after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --access-token="9857f9bb4b1c260b94eb773a541d6e42e05db0db45d5a25757590276d5e50445" --format=php-clover coverage.clover
Expand Down
20 changes: 10 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@

"require": {
"php": ">=7.1.3",
"illuminate/support": "5.7.*",
"illuminate/database": "5.7.*",
"illuminate/translation": "5.7.*",
"distilleries/datatable-builder": "2.13.*",
"distilleries/form-builder": "2.12.*",
"distilleries/permission-util": "1.9.*",
"distilleries/security": "1.0.*",
"illuminate/support": "5.8.*",
"illuminate/database": "5.8.*",
"illuminate/translation": "5.8.*",
"distilleries/datatable-builder": "2.14.*",
"distilleries/form-builder": "2.13.*",
"distilleries/permission-util": "1.10.*",
"distilleries/security": "1.1.*",
"forxer/Gravatar": "~1.2",
"maatwebsite/excel": "3.1.*"
},
"require-dev": {
"orchestra/database": "3.7.*",
"orchestra/testbench": "3.7.*",
"orchestra/testbench-browser-kit": "3.7.*",
"orchestra/database": "3.8.*",
"orchestra/testbench": "3.8.*",
"orchestra/testbench-browser-kit": "3.8.*",
"phpunit/phpunit": "~7.0",
"mockery/mockery": "~1.0",
"fzaninotto/faker": "~1.4"
Expand Down
6 changes: 5 additions & 1 deletion src/Distilleries/Expendable/Contracts/EventContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@

interface EventContract {

public function fire($params = array());
/**
* @param array $params
* @return mixed
*/
public function dispatch($params = array());
}
20 changes: 16 additions & 4 deletions src/Distilleries/Expendable/Events/EventDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,33 @@ class EventDispatcher implements EventContract {
// ------------------------------------------------------------------------------------------------


public function __construct($eventName, $params = array(), $auto_fire = true)
public function __construct($eventName, $params = array(), $auto_dispatch = true)
{
$this->event_name = $eventName;
$this->params = $params;

if ($auto_fire === true)
if ($auto_dispatch === true)
{
$this->fire($this->params);
$this->dispatch($this->params);
}
}

// ------------------------------------------------------------------------------------------------

/**
* @inheritDoc
*/
public function dispatch($params = array())
{
Event::dispatch($this->event_name, array($params));
}

/**
* @param array $params
* @deprecated Use dispatch instead
*/
public function fire($params = array())
{
Event::fire($this->event_name, array($params));
$this->dispatch($params);
}
}
6 changes: 4 additions & 2 deletions tests/Exceptions/HandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public function testExceptionAdmin()
$response = $this->call('GET', '/test');
$this->assertEquals(404,$response->getStatusCode());
$this->assertNotContains('page-404',$response->getContent());
$this->assertContains('Sorry, the page you are looking for could not be found.',$response->getContent());
$this->assertContains('404',$response->getContent());
$this->assertContains('Not Found',$response->getContent());
}


Expand Down Expand Up @@ -114,7 +115,8 @@ public function testExceptionNoCatche()
$response = $this->call('GET', '/test');
$this->assertEquals(404,$response->getStatusCode());
$this->assertNotContains('page-404',$response->getContent());
$this->assertContains('Sorry, the page you are looking for could not be found.',$response->getContent());
$this->assertContains('404',$response->getContent());
$this->assertContains('Not Found',$response->getContent());
}


Expand Down
2 changes: 1 addition & 1 deletion tests/ExpendableTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected function resolveApplication()
}


public function setUp()
public function setUp(): void
{
parent::setUp();
$this->app['Illuminate\Contracts\Console\Kernel']->call('vendor:publish', ['--all' => true]);
Expand Down
2 changes: 1 addition & 1 deletion tests/Http/Controllers/Backend/ComponentControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class ComponentControllerTest extends ExpendableTestCase {

protected $controller = 'Backend\ComponentController';

public function setUp()
public function setUp(): void
{
parent::setUp();

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

class LanguageControllerTest extends ExpendableTestCase {

public function setUp()
public function setUp(): void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/Http/Controllers/Backend/LoginControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class LoginControllerTest extends ExpendableTestCase
{

public function setUp()
public function setUp(): void
{
parent::setUp();

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

class OrderedControllerTest extends ExpendableTestCase
{
public function setUp()
public function setUp(): void
{
parent::setUp();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class PermissionControllerTest extends ExpendableTestCase {

protected $controller = 'Backend\PermissionController';

public function setUp()
public function setUp(): void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/Http/Controllers/Backend/RoleControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class RoleControllerTest extends ExpendableTestCase {

protected $controller = 'Backend\RoleController';

public function setUp()
public function setUp(): void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/Http/Controllers/Backend/ServiceControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class ServiceControllerTest extends ExpendableTestCase {

protected $controller = 'Backend\ServiceController';

public function setUp()
public function setUp(): void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/Http/Controllers/Backend/UserControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class UserControllerTest extends ExpendableTestCase {

protected $controller = 'Backend\UserController';

public function setUp()
public function setUp(): void
{
parent::setUp();

Expand Down

0 comments on commit dd97a59

Please sign in to comment.