From 27e47a33dc54363347684fb21f72998292f3672a Mon Sep 17 00:00:00 2001 From: Rafael da Cruz Nascimento Date: Wed, 15 May 2019 11:35:45 -0300 Subject: [PATCH 1/2] Update constraints --- composer.json | 12 ++++++------ tests/TestCase.php | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 1a78c3b..ee56375 100644 --- a/composer.json +++ b/composer.json @@ -12,14 +12,14 @@ } ], "require": { - "php": "^7.0", - "laravelcollective/html": "~5.5", - "illuminate/support": "~5.5" + "php": "^7.0 || ^7.1", + "laravelcollective/html": "~5.5 || ~5.6 || ~5.7 || ~5.8", + "illuminate/support": "~5.5 || ~5.6 || ~5.7 || ~5.8" }, "require-dev": { - "mockery/mockery": "^0.9.5", - "orchestra/testbench": "~3.0", - "phpunit/phpunit": "~6.0" + "mockery/mockery": "~1.0", + "orchestra/testbench": "~3.5 || ~3.6 || ~3.7 || ~3.8", + "phpunit/phpunit": "~6.0 || ~7.0 || ~7.5" }, "autoload": { "psr-4": { diff --git a/tests/TestCase.php b/tests/TestCase.php index 8a4185f..74c1252 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -5,13 +5,13 @@ class TestCase extends \Orchestra\Testbench\TestCase { - public function tearDown() + public function tearDown() : void { parent::tearDown(); m::close(); } - public function setUp() + public function setUp() : void { parent::setUp(); From 499eb26c67f699557b24d4ab78540d7729b4236c Mon Sep 17 00:00:00 2001 From: Rafael da Cruz Nascimento Date: Wed, 15 May 2019 13:26:55 -0300 Subject: [PATCH 2/2] Update 'fire' to 'dispatch' --- src/Stylist/Console/PublishAssetsCommand.php | 3 ++- tests/Console/PublishAssetsCommandTest.php | 10 ++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Stylist/Console/PublishAssetsCommand.php b/src/Stylist/Console/PublishAssetsCommand.php index 4d1f80a..6ffb8ea 100644 --- a/src/Stylist/Console/PublishAssetsCommand.php +++ b/src/Stylist/Console/PublishAssetsCommand.php @@ -41,7 +41,7 @@ public function handle() */ protected function setupThemes() { - $this->laravel['events']->fire('stylist.publishing'); + $this->laravel['events']->dispatch('stylist.publishing'); $themes = Stylist::themes(); @@ -49,6 +49,7 @@ protected function setupThemes() $path = $theme->getPath(); if ($this->laravel['files']->exists($path.'assets/')) { + $this->laravel['stylist']->registerPath($path); } } diff --git a/tests/Console/PublishAssetsCommandTest.php b/tests/Console/PublishAssetsCommandTest.php index 4c3031a..c934d68 100644 --- a/tests/Console/PublishAssetsCommandTest.php +++ b/tests/Console/PublishAssetsCommandTest.php @@ -13,15 +13,13 @@ public function testAssetPublishing() $artisan = $this->app->make('Illuminate\Contracts\Console\Kernel'); - File::shouldReceive('exists')->andReturn(true)->times(12); - File::shouldReceive('get')->times(9); - File::shouldReceive('copyDirectory')->times(4); - // Action $artisan->call('stylist:publish'); // Assert -// $this->assertTrue($this->app['files']->exists(public_path('themes/child-theme'))); -// $this->assertFalse($this->app['files']->exists(public_path('themes/parent-theme'))); + $this->assertTrue($this->app['files']->isDirectory(public_path('themes/child-theme'))); + $this->assertTrue($this->app['files']->isDirectory(public_path('themes/overloader'))); + $this->assertTrue($this->app['files']->isDirectory(public_path('themes/parent-theme'))); + } }