Skip to content

Commit

Permalink
Merge 2065381 into 9a5023c
Browse files Browse the repository at this point in the history
  • Loading branch information
antalaron committed Dec 25, 2019
2 parents 9a5023c + 2065381 commit 0211294
Show file tree
Hide file tree
Showing 14 changed files with 47 additions and 40 deletions.
28 changes: 10 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
12 changes: 7 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Empty file removed tests/Tests/.gitkeep
Empty file.
3 changes: 2 additions & 1 deletion tests/Tests/Controller/ImageControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
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;

/**
* ImageControllerTest.
*
* @author Antal Áron <antalaron@antalaron.hu>
*/
class ImageControllerTest extends \PHPUnit_Framework_TestCase
class ImageControllerTest extends TestCase
{
use ExceptionWrapperTestCaseTrait;

Expand Down
3 changes: 2 additions & 1 deletion tests/Tests/DependencyInjection/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@

use IngaLabs\Bundle\ImageBundle\DependencyInjection\Configuration;
use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait;
use PHPUnit\Framework\TestCase;

/**
* ConfigurationTest.
*
* @author Antal Áron <antalaron@antalaron.hu>
*/
class ConfigurationTest extends \PHPUnit_Framework_TestCase
class ConfigurationTest extends TestCase
{
use ConfigurationTestCaseTrait;

Expand Down
3 changes: 2 additions & 1 deletion tests/Tests/Helper/GifImageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
namespace IngaLabs\Bundle\ImageBundle\Tests\Helper;

use IngaLabs\Bundle\ImageBundle\Helper\GifImage;
use PHPUnit\Framework\TestCase;

/**
* GifImageTest.
*
* @author Antal Áron <antalaron@antalaron.hu>
*/
class GifImageTest extends \PHPUnit_Framework_TestCase
class GifImageTest extends TestCase
{
/**
* @var GifImage
Expand Down
3 changes: 2 additions & 1 deletion tests/Tests/ImageManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -34,7 +35,7 @@
*
* @author Antal Áron <antalaron@antalaron.hu>
*/
class ImageManagerTest extends \PHPUnit_Framework_TestCase
class ImageManagerTest extends TestCase
{
use ExceptionWrapperTestCaseTrait;

Expand Down
3 changes: 2 additions & 1 deletion tests/Tests/IngaLabsImageBundleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
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;

/**
* IngaLabsImageBundleTest.
*
* @author Antal Áron <antalaron@antalaron.hu>
*/
class IngaLabsImageBundleTest extends \PHPUnit_Framework_TestCase
class IngaLabsImageBundleTest extends TestCase
{
public function testConfigCompilerPass()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Tests/Model/AspectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/Tests/Model/ImageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/Tests/Model/SizeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/Tests/Repository/ImageRepositoryTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@

use Doctrine\Common\Persistence\ObjectRepository;
use IngaLabs\Bundle\ImageBundle\Repository\ImageRepositoryTrait;
use PHPUnit\Framework\TestCase;

/**
* ImageRepositoryTraitTest.
*
* @author Antal Áron <antalaron@antalaron.hu>
*/
class ImageRepositoryTraitTest extends \PHPUnit_Framework_TestCase
class ImageRepositoryTraitTest extends TestCase
{
public function testFindOneByHashCallsTheAbstractMethod()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Tests/Routing/Loader/ImageLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <antalaron@antalaron.hu>
*/
class ImageLoaderTest extends \PHPUnit_Framework_TestCase
class ImageLoaderTest extends TestCase
{
use ExceptionWrapperTestCaseTrait;

Expand Down
17 changes: 10 additions & 7 deletions tests/Tests/Twig/ImageExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <antalaron@antalaron.hu>
*/
class ImageExtensionTest extends \PHPUnit_Framework_TestCase
class ImageExtensionTest extends TestCase
{
public function testImage()
{
Expand All @@ -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]));
Expand All @@ -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]));
Expand All @@ -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]));
Expand Down

0 comments on commit 0211294

Please sign in to comment.