diff --git a/.travis.yml b/.travis.yml index 677e4b5..2f54e92 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,41 +5,33 @@ sudo: false dist: trusty php: - - 5.5 - - 7.0 - 7.1 - 7.2 + - 7.3 + - 7.4 - nightly env: - - SYMFONY_VERSION="2.7.*" - - SYMFONY_VERSION="2.8.*" - - SYMFONY_VERSION="3.4.*" - - SYMFONY_VERSION="4.0.*" + - SYMFONY_VERSION="4.4.*" + - SYMFONY_VERSION="5.0.*" matrix: fast_finish: true exclude: - - php: 5.5 - env: SYMFONY_VERSION="4.0.*" - - php: 5.5 - env: SYMFONY_VERSION="dev-master" - - php: 7.0 - env: SYMFONY_VERSION="4.0.*" - - php: 7.0 - env: SYMFONY_VERSION="dev-master" + - php: 7.1 + env: SYMFONY_VERSION="5.0.*" allow_failures: - php: nightly before_script: - composer require symfony/symfony:${SYMFONY_VERSION} --prefer-dist --no-interaction --no-progress - mkdir -p build/logs - - if [ "${TRAVIS_PHP_VERSION}" == '7.1' ] && [ "${SYMFONY_VERSION}" == '3.4.*' ]; then composer require doctrine/orm doctrine/doctrine-bundle doctrine/mongodb-odm-bundle alcaeus/mongo-php-adapter --ignore-platform-reqs --no-interaction --no-progress; fi; + - if [ "${TRAVIS_PHP_VERSION}" == '7.1' ] && [ "${SYMFONY_VERSION}" == '4.4.*' ]; then composer require doctrine/orm doctrine/doctrine-bundle doctrine/mongodb-odm-bundle alcaeus/mongo-php-adapter --ignore-platform-reqs --no-interaction --no-progress; fi; script: - - if [ "${TRAVIS_PHP_VERSION}" != '7.1' ] || [ "${SYMFONY_VERSION}" != '3.4.*' ]; then vendor/bin/phpunit -v; fi; - - if [ "${TRAVIS_PHP_VERSION}" == '7.1' ] && [ "${SYMFONY_VERSION}" == '3.4.*' ]; then vendor/bin/phpunit -v --coverage-clover build/logs/clover.xml; fi; - - if [ "${TRAVIS_PHP_VERSION}" == '7.1' ] && [ "${SYMFONY_VERSION}" == '3.4.*' ]; then travis_retry wget -q https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar && travis_retry php coveralls.phar -v; fi; + - if [ "${TRAVIS_PHP_VERSION}" != '7.1' ] || [ "${SYMFONY_VERSION}" != '4.4.*' ]; then vendor/bin/phpunit -v; fi; + - if [ "${TRAVIS_PHP_VERSION}" == '7.1' ] && [ "${SYMFONY_VERSION}" == '4.4.*' ]; then vendor/bin/phpunit -v --coverage-clover build/logs/clover.xml; fi; + - if [ "${TRAVIS_PHP_VERSION}" == '7.1' ] && [ "${SYMFONY_VERSION}" == '4.4.*' ]; then travis_retry wget -q https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar && travis_retry php coveralls.phar -v; fi; notifications: email: diff --git a/composer.json b/composer.json index 9a825a3..361abce 100644 --- a/composer.json +++ b/composer.json @@ -18,16 +18,18 @@ } ], "require": { - "php": ">=5.5.9", - "symfony/symfony": "~2.7|~3.0|~4.0", + "php": ">=7.1.3", + "ext-gd": "*", + "ext-exif": "*", + "symfony/symfony": "4.4.*|5.0.*", "intervention/image": "^2.3", - "twig/twig": "^1.28|^2.0", + "twig/twig": "^2.0", "sybio/gif-frame-extractor": "^1.0", "sybio/gif-creator": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^4.0|^5.0", - "matthiasnoback/symfony-dependency-injection-test": "^1.0" + "phpunit/phpunit": "^7.0", + "matthiasnoback/symfony-dependency-injection-test": "^3.0|^4.0" }, "autoload": { "psr-4": { diff --git a/tests/Tests/.gitkeep b/tests/Tests/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/tests/Tests/Controller/ImageControllerTest.php b/tests/Tests/Controller/ImageControllerTest.php index 32d8a84..af3b109 100644 --- a/tests/Tests/Controller/ImageControllerTest.php +++ b/tests/Tests/Controller/ImageControllerTest.php @@ -15,6 +15,7 @@ use IngaLabs\Bundle\ImageBundle\ImageManager; use IngaLabs\Bundle\ImageBundle\Model\Image; use IngaLabs\Bundle\ImageBundle\Tests\ExceptionWrapperTestCaseTrait; +use PHPUnit\Framework\TestCase; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** @@ -22,7 +23,7 @@ * * @author Antal Áron */ -class ImageControllerTest extends \PHPUnit_Framework_TestCase +class ImageControllerTest extends TestCase { use ExceptionWrapperTestCaseTrait; diff --git a/tests/Tests/DependencyInjection/ConfigurationTest.php b/tests/Tests/DependencyInjection/ConfigurationTest.php index 91ecf75..3111c4c 100644 --- a/tests/Tests/DependencyInjection/ConfigurationTest.php +++ b/tests/Tests/DependencyInjection/ConfigurationTest.php @@ -11,13 +11,14 @@ use IngaLabs\Bundle\ImageBundle\DependencyInjection\Configuration; use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait; +use PHPUnit\Framework\TestCase; /** * ConfigurationTest. * * @author Antal Áron */ -class ConfigurationTest extends \PHPUnit_Framework_TestCase +class ConfigurationTest extends TestCase { use ConfigurationTestCaseTrait; diff --git a/tests/Tests/Helper/GifImageTest.php b/tests/Tests/Helper/GifImageTest.php index 0181cb9..d304a77 100644 --- a/tests/Tests/Helper/GifImageTest.php +++ b/tests/Tests/Helper/GifImageTest.php @@ -10,13 +10,14 @@ namespace IngaLabs\Bundle\ImageBundle\Tests\Helper; use IngaLabs\Bundle\ImageBundle\Helper\GifImage; +use PHPUnit\Framework\TestCase; /** * GifImageTest. * * @author Antal Áron */ -class GifImageTest extends \PHPUnit_Framework_TestCase +class GifImageTest extends TestCase { /** * @var GifImage diff --git a/tests/Tests/ImageManagerTest.php b/tests/Tests/ImageManagerTest.php index f7839e6..93aec58 100644 --- a/tests/Tests/ImageManagerTest.php +++ b/tests/Tests/ImageManagerTest.php @@ -23,6 +23,7 @@ use IngaLabs\Bundle\ImageBundle\Repository\SizeRepositoryInterface; use Intervention\Image\Image as InventionImage; use Intervention\Image\ImageManager as InventionManager; +use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\BinaryFileResponse; use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException; use Symfony\Component\HttpFoundation\File\File; @@ -34,7 +35,7 @@ * * @author Antal Áron */ -class ImageManagerTest extends \PHPUnit_Framework_TestCase +class ImageManagerTest extends TestCase { use ExceptionWrapperTestCaseTrait; diff --git a/tests/Tests/IngaLabsImageBundleTest.php b/tests/Tests/IngaLabsImageBundleTest.php index 830eec5..2828edd 100644 --- a/tests/Tests/IngaLabsImageBundleTest.php +++ b/tests/Tests/IngaLabsImageBundleTest.php @@ -15,6 +15,7 @@ use IngaLabs\Bundle\ImageBundle\DependencyInjection\Compiler\ConfigPass; use IngaLabs\Bundle\ImageBundle\DependencyInjection\IngaLabsImageExtension; use IngaLabs\Bundle\ImageBundle\IngaLabsImageBundle; +use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\ContainerBuilder; /** @@ -22,7 +23,7 @@ * * @author Antal Áron */ -class IngaLabsImageBundleTest extends \PHPUnit_Framework_TestCase +class IngaLabsImageBundleTest extends TestCase { public function testConfigCompilerPass() { diff --git a/tests/Tests/Model/AspectTest.php b/tests/Tests/Model/AspectTest.php index 4bd1499..3b847e8 100644 --- a/tests/Tests/Model/AspectTest.php +++ b/tests/Tests/Model/AspectTest.php @@ -10,8 +10,9 @@ namespace IngaLabs\Bundle\ImageBundle\Tests\Model; use IngaLabs\Bundle\ImageBundle\Model\Aspect; +use PHPUnit\Framework\TestCase; -class AspectTest extends \PHPUnit_Framework_TestCase +class AspectTest extends TestCase { /** * @var Aspect diff --git a/tests/Tests/Model/ImageTest.php b/tests/Tests/Model/ImageTest.php index 6f9295a..004bcaf 100644 --- a/tests/Tests/Model/ImageTest.php +++ b/tests/Tests/Model/ImageTest.php @@ -10,8 +10,9 @@ namespace IngaLabs\Bundle\ImageBundle\Tests\Model; use IngaLabs\Bundle\ImageBundle\Model\Image; +use PHPUnit\Framework\TestCase; -class ImageTest extends \PHPUnit_Framework_TestCase +class ImageTest extends TestCase { /** * @var Image diff --git a/tests/Tests/Model/SizeTest.php b/tests/Tests/Model/SizeTest.php index fd99669..dfc735c 100644 --- a/tests/Tests/Model/SizeTest.php +++ b/tests/Tests/Model/SizeTest.php @@ -10,8 +10,9 @@ namespace IngaLabs\Bundle\ImageBundle\Tests\Model; use IngaLabs\Bundle\ImageBundle\Model\Size; +use PHPUnit\Framework\TestCase; -class SizeTest extends \PHPUnit_Framework_TestCase +class SizeTest extends TestCase { /** * @var Size diff --git a/tests/Tests/Repository/ImageRepositoryTraitTest.php b/tests/Tests/Repository/ImageRepositoryTraitTest.php index c41b311..611c3e4 100644 --- a/tests/Tests/Repository/ImageRepositoryTraitTest.php +++ b/tests/Tests/Repository/ImageRepositoryTraitTest.php @@ -11,13 +11,14 @@ use Doctrine\Common\Persistence\ObjectRepository; use IngaLabs\Bundle\ImageBundle\Repository\ImageRepositoryTrait; +use PHPUnit\Framework\TestCase; /** * ImageRepositoryTraitTest. * * @author Antal Áron */ -class ImageRepositoryTraitTest extends \PHPUnit_Framework_TestCase +class ImageRepositoryTraitTest extends TestCase { public function testFindOneByHashCallsTheAbstractMethod() { diff --git a/tests/Tests/Routing/Loader/ImageLoaderTest.php b/tests/Tests/Routing/Loader/ImageLoaderTest.php index 3fcdaf7..f8b28ab 100644 --- a/tests/Tests/Routing/Loader/ImageLoaderTest.php +++ b/tests/Tests/Routing/Loader/ImageLoaderTest.php @@ -12,13 +12,14 @@ use IngaLabs\Bundle\ImageBundle\Exception\LoaderException; use IngaLabs\Bundle\ImageBundle\Routing\Loader\ImageLoader; use IngaLabs\Bundle\ImageBundle\Tests\ExceptionWrapperTestCaseTrait; +use PHPUnit\Framework\TestCase; /** * ImageLoaderTest. * * @author Antal Áron */ -class ImageLoaderTest extends \PHPUnit_Framework_TestCase +class ImageLoaderTest extends TestCase { use ExceptionWrapperTestCaseTrait; diff --git a/tests/Tests/Twig/ImageExtensionTest.php b/tests/Tests/Twig/ImageExtensionTest.php index 397cfd1..81092b4 100644 --- a/tests/Tests/Twig/ImageExtensionTest.php +++ b/tests/Tests/Twig/ImageExtensionTest.php @@ -13,13 +13,16 @@ use IngaLabs\Bundle\ImageBundle\ImageManager; use IngaLabs\Bundle\ImageBundle\Model\Image; use IngaLabs\Bundle\ImageBundle\Twig\ImageExtension; +use PHPUnit\Framework\TestCase; +use Twig\Environment; +use Twig\Loader\ArrayLoader; /** * ImageExtensionTest. * * @author Antal Áron */ -class ImageExtensionTest extends \PHPUnit_Framework_TestCase +class ImageExtensionTest extends TestCase { public function testImage() { @@ -31,10 +34,10 @@ public function testImage() $managerRegistry = $this->getManagerRegistryMock(); $imageManager = new ImageManager($managerRegistry, ['prefix' => '/images']); - $loader = new \Twig_Loader_Array([ + $loader = new ArrayLoader([ 'index.html' => '{{ image(image) }}', ]); - $twig = new \Twig_Environment($loader, ['debug' => false, 'cache' => false, 'autoescape' => 'html', 'optimizations' => 0]); + $twig = new Environment($loader, ['debug' => false, 'cache' => false, 'autoescape' => 'html', 'optimizations' => 0]); $twig->addExtension(new ImageExtension($imageManager)); $this->assertSame('/images/01/01234567/01234567890123456789012345678901_or_or.jpg', $twig->render('index.html', ['image' => $image])); @@ -51,10 +54,10 @@ public function testImageFull() $managerRegistry = $this->getManagerRegistryMock(); $imageManager = new ImageManager($managerRegistry, ['prefix' => '/images']); - $loader = new \Twig_Loader_Array([ + $loader = new ArrayLoader([ 'index.html' => '{{ image(image, {\'size\': \'sm\', \'aspect\': \'1x1\', \'show_last_modified\': true}) }}', ]); - $twig = new \Twig_Environment($loader, ['debug' => false, 'cache' => false, 'autoescape' => 'html', 'optimizations' => 0]); + $twig = new Environment($loader, ['debug' => false, 'cache' => false, 'autoescape' => 'html', 'optimizations' => 0]); $twig->addExtension(new ImageExtension($imageManager)); $this->assertSame('/images/01/01234567/01234567890123456789012345678901_sm_1x1.jpg?timestamp=522538840', $twig->render('index.html', ['image' => $image])); @@ -67,10 +70,10 @@ public function testImageNull() $managerRegistry = $this->getManagerRegistryMock(); $imageManager = new ImageManager($managerRegistry, ['prefix' => '/images']); - $loader = new \Twig_Loader_Array([ + $loader = new ArrayLoader([ 'index.html' => '{{ image(image) }}', ]); - $twig = new \Twig_Environment($loader, ['debug' => false, 'cache' => false, 'autoescape' => 'html', 'optimizations' => 0]); + $twig = new Environment($loader, ['debug' => false, 'cache' => false, 'autoescape' => 'html', 'optimizations' => 0]); $twig->addExtension(new ImageExtension($imageManager)); $this->assertSame('', $twig->render('index.html', ['image' => $image]));