From c714a0bf48a3af6e1d526f25bc85472e3698c386 Mon Sep 17 00:00:00 2001 From: Sanasol Date: Tue, 26 Mar 2019 15:11:09 +0300 Subject: [PATCH] Added support for laravel 5.8 --- .travis.yml | 15 +++++++++++---- composer.json | 6 +++--- readme.md | 1 + tests/ImageProxyTestCase.php | 34 +++++++++++++++++----------------- tests/ImageServeTestCase.php | 4 ++-- tests/ImageTestCase.php | 12 ++++++------ 6 files changed, 40 insertions(+), 32 deletions(-) diff --git a/.travis.yml b/.travis.yml index a2aab85..a74666a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,8 @@ env: - ILLUMINATE_VERSION=5.4.* PHPUNIT_VERSION=~5.7 - ILLUMINATE_VERSION=5.5.* PHPUNIT_VERSION=~6.0 - ILLUMINATE_VERSION=5.6.* PHPUNIT_VERSION=~7.0 - - ILLUMINATE_VERSION=5.7.* PHPUNIT_VERSION=~7.0 COVERAGE=true + - ILLUMINATE_VERSION=5.7.* PHPUNIT_VERSION=~7.0 + - ILLUMINATE_VERSION=5.8.* PHPUNIT_VERSION=~7.0 COVERAGE=true matrix: # For each PHP version we exclude the coverage env, except for PHP 7.1 @@ -34,19 +35,25 @@ matrix: - php: 5.5 env: ILLUMINATE_VERSION=5.6.* PHPUNIT_VERSION=~7.0 - php: 5.5 - env: ILLUMINATE_VERSION=5.7.* PHPUNIT_VERSION=~7.0 COVERAGE=true + env: ILLUMINATE_VERSION=5.7.* PHPUNIT_VERSION=~7.0 + - php: 5.5 + env: ILLUMINATE_VERSION=5.8.* PHPUNIT_VERSION=~7.0 COVERAGE=true # Don't test Laravel 5.5 and up on PHP 5.6 - php: 5.6 env: ILLUMINATE_VERSION=5.5.* PHPUNIT_VERSION=~6.0 - php: 5.6 env: ILLUMINATE_VERSION=5.6.* PHPUNIT_VERSION=~7.0 - php: 5.6 - env: ILLUMINATE_VERSION=5.7.* PHPUNIT_VERSION=~7.0 COVERAGE=true + env: ILLUMINATE_VERSION=5.7.* PHPUNIT_VERSION=~7.0 + - php: 5.6 + env: ILLUMINATE_VERSION=5.8.* PHPUNIT_VERSION=~7.0 COVERAGE=true # Test Laravel 5.5 and down on PHP 7.0 - php: 7.0 env: ILLUMINATE_VERSION=5.6.* PHPUNIT_VERSION=~7.0 - php: 7.0 - env: ILLUMINATE_VERSION=5.7.* PHPUNIT_VERSION=~7.0 COVERAGE=true + env: ILLUMINATE_VERSION=5.7.* PHPUNIT_VERSION=~7.0 + - php: 7.0 + env: ILLUMINATE_VERSION=5.8.* PHPUNIT_VERSION=~7.0 COVERAGE=true # Test only Laravel 5.4 and up on PHP 7.1 - php: 7.1 env: ILLUMINATE_VERSION=5.1.* PHPUNIT_VERSION=~4.0 diff --git a/composer.json b/composer.json index 5ca1a91..06aace2 100644 --- a/composer.json +++ b/composer.json @@ -18,14 +18,14 @@ } ], "require": { - "php": ">=5.5.9", - "illuminate/support": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*", + "php": "^7.1.3", + "illuminate/support": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*", "guzzlehttp/guzzle": "5.3|~6.0", "imagine/imagine": "0.6.*" }, "require-dev": { "fzaninotto/faker": "~1.4", - "orchestra/testbench": "3.1.*|3.2.*|3.3.*|3.4.*|3.5.*|3.6.*|3.7.*", + "orchestra/testbench": "3.1.*|3.2.*|3.3.*|3.4.*|3.5.*|3.6.*|3.7.*|3.8.*", "mockery/mockery": "0.9.*|1.0.*", "phpunit/phpunit": "~4.0|~4.1|~5.4|~5.7|~6.0|~7.0", "php-coveralls/php-coveralls": "^2.1" diff --git a/readme.md b/readme.md index 97798cd..ef6086d 100644 --- a/readme.md +++ b/readme.md @@ -71,6 +71,7 @@ This package also provides some common filters ready to use ([more on this](http 5.0.x | 0.2.x 5.1.x | 0.3.x 5.2.x | 0.3.x + 5.8.x | 0.4.x ## Installation diff --git a/tests/ImageProxyTestCase.php b/tests/ImageProxyTestCase.php index 72ab52a..d567321 100644 --- a/tests/ImageProxyTestCase.php +++ b/tests/ImageProxyTestCase.php @@ -11,22 +11,22 @@ class ImageProxyTestCase extends TestCase protected $imageSize; protected $imageSmallSize; - public function setUp() + public function setUp(): void { parent::setUp(); - + $this->image = $this->app['image']; $this->imageSize = getimagesize(public_path().$this->imagePath); $this->imageSmallSize = getimagesize(public_path().$this->imageSmallPath); } - public function tearDown() + public function tearDown(): void { $customPath = $this->app['path.public'].'/custom'; $this->app['config']->set('image.write_path', $customPath); - + $this->image->deleteManipulated($this->imagePath); - + parent::tearDown(); } @@ -37,13 +37,13 @@ public function testProxy() ]); $response = $this->call('GET', $url); $this->assertTrue($response->isOk()); - + $image = imagecreatefromstring($response->getContent()); $this->assertTrue($image !== false); - + $this->assertEquals(imagesx($image), 300); $this->assertEquals(imagesy($image), 300); - + imagedestroy($image); } @@ -52,22 +52,22 @@ public function testProxyURL() $this->app['config']->set('image.host', '/proxy/http://placehold.it/'); $this->app['config']->set('image.proxy_filesystem', null); $this->app['config']->set('image.proxy_route_pattern', '^(.*)$'); - + $url = $this->image->url('/640x480.png', 300, 300, [ 'crop' => true ]); $response = $this->call('GET', $url); $this->assertTrue($response->isOk()); - + $image = imagecreatefromstring($response->getContent()); $this->assertTrue($image !== false); - + $this->assertEquals(imagesx($image), 300); $this->assertEquals(imagesy($image), 300); - + imagedestroy($image); } - + /** * Define environment setup. * @@ -77,22 +77,22 @@ public function testProxyURL() protected function getEnvironmentSetUp($app) { $app->instance('path.public', __DIR__.'/fixture'); - + $app['config']->set('image.host', '/proxy'); $app['config']->set('image.serve', false); $app['config']->set('image.proxy', true); $app['config']->set('image.proxy_route', '/proxy/{image_proxy_pattern}'); $app['config']->set('image.proxy_filesystem', 'image_testbench'); $app['config']->set('image.proxy_cache_filesystem', null); - + $app['config']->set('filesystems.default', 'image_testbench'); $app['config']->set('filesystems.cloud', 'image_testbench'); - + $app['config']->set('filesystems.disks.image_testbench', [ 'driver' => 'local', 'root' => __DIR__.'/fixture' ]); - + $app['config']->set('filesystems.disks.image_testbench_cache', [ 'driver' => 'local', 'root' => __DIR__.'/fixture/cache' diff --git a/tests/ImageServeTestCase.php b/tests/ImageServeTestCase.php index 0077f73..388c4f0 100644 --- a/tests/ImageServeTestCase.php +++ b/tests/ImageServeTestCase.php @@ -11,7 +11,7 @@ class ImageServeTestCase extends TestCase protected $imageSize; protected $imageSmallSize; - public function setUp() + public function setUp(): void { parent::setUp(); @@ -20,7 +20,7 @@ public function setUp() $this->imageSmallSize = getimagesize(public_path().$this->imageSmallPath); } - public function tearDown() + public function tearDown(): void { $customPath = $this->app['path.public'].'/custom'; $this->app['config']->set('image.write_path', $customPath); diff --git a/tests/ImageTestCase.php b/tests/ImageTestCase.php index 79bf414..0cc72cd 100644 --- a/tests/ImageTestCase.php +++ b/tests/ImageTestCase.php @@ -11,22 +11,22 @@ class ImageTestCase extends TestCase protected $imageSize; protected $imageSmallSize; - public function setUp() + public function setUp(): void { parent::setUp(); - + $this->image = $this->app['image']; $this->imageSize = getimagesize(public_path().$this->imagePath); $this->imageSmallSize = getimagesize(public_path().$this->imageSmallPath); } - public function tearDown() + public function tearDown(): void { $customPath = $this->app['path.public'].'/custom'; $this->app['config']->set('image.write_path', $customPath); - + $this->image->deleteManipulated($this->imagePath); - + parent::tearDown(); } @@ -78,7 +78,7 @@ public function testURLisValid() } } - + /** * Define environment setup. *