diff --git a/.travis.yml b/.travis.yml index 5d3a82c..24d3263 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,14 +2,6 @@ language: php sudo: false -php: - - 7.1 - - 7.0 - - 5.6 - - 5.5 - - 5.4 - - hhvm - notifications: email: deploy@peter-gribanov.ru @@ -20,41 +12,51 @@ branches: matrix: fast_finish: true include: - - php: 5.4 - env: COVERAGE=1 - - php: 5.4 - env: SYMFONY_VERSION=2.7.* - - php: 5.4 + - php: 7.3 + - php: 7.2 + - php: 7.1 + - php: 7.0 + - php: 5.6 + - php: 5.5 + dist: trusty + - php: 5.5 + dist: trusty env: SYMFONY_VERSION=2.8.* - php: 5.5 - env: SYMFONY_VERSION=3.0.* - - php: 5.4 + dist: trusty + env: SYMFONY_VERSION=3.4.* + - php: 7.1 + env: SYMFONY_VERSION=4.2.* PHPUNIT_VERSION=5.7.* + - php: 7.1 + env: SYMFONY_VERSION=4.3.* PHPUNIT_VERSION=5.7.* + - php: 5.5 + dist: trusty env: DOCTRINE_VERSION=2.4.* - - php: 5.4 + - php: 5.5 + dist: trusty env: DOCTRINE_VERSION=2.5.* - - php: 5.4 + - php: 7.1 + dist: trusty + env: DOCTRINE_VERSION=2.6.* + - php: 5.5 + dist: trusty env: TWIG_VERSION=1.* - php: 7.0 env: TWIG_VERSION=2.* - allow_failures: - - php: hhvm before_install: - - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ] && [ "$COVERAGE" != "1" ]; then phpenv config-rm xdebug.ini; fi; - - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then echo "memory_limit=2G" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi; - if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi; - - composer self-update before_script: - if [ "$SYMFONY_VERSION" != "" ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --dev --no-update; fi; - if [ "$DOCTRINE_VERSION" != "" ]; then composer require "doctrine/orm:${DOCTRINE_VERSION}" --dev --no-update; fi; - if [ "$TWIG_VERSION" != "" ]; then composer require "twig/twig:${TWIG_VERSION}" --dev --no-update; fi; - - composer install --prefer-dist --no-interaction --no-scripts --no-progress + - if [ "$PHPUNIT_VERSION" != "" ]; then composer require "phpunit/phpunit:${PHPUNIT_VERSION}" --dev --no-update; fi; + - COMPOSER_MEMORY_LIMIT=-1 composer install --prefer-dist --no-interaction --no-scripts --no-progress script: - - if [ "$COVERAGE" != "1" ]; then vendor/bin/phpunit; fi; - - if [ "$COVERAGE" == "1" ]; then vendor/bin/phpunit --coverage-clover build/coverage-clover.xml; fi; + - vendor/bin/phpunit --coverage-clover build/coverage-clover.xml after_script: - - if [ "$COVERAGE" == "1" ]; then vendor/bin/ocular code-coverage:upload --format=php-clover build/coverage-clover.xml; fi; - - if [ "$COVERAGE" == "1" ]; then vendor/bin/coveralls -v -c .coveralls.yml; fi; + - vendor/bin/ocular code-coverage:upload --format=php-clover build/coverage-clover.xml + - vendor/bin/coveralls -v -c .coveralls.yml diff --git a/composer.json b/composer.json index 6dc138b..fc5f239 100644 --- a/composer.json +++ b/composer.json @@ -19,9 +19,9 @@ "php": ">=5.4.0" }, "require-dev": { - "symfony/framework-bundle": "~2.3|~3.0", - "symfony/expression-language": "~2.3|~3.0", - "doctrine/orm": "~2.4|~2.5", + "symfony/framework-bundle": "~2.3|~3.0|~4.0", + "symfony/expression-language": "~2.3|~3.0|~4.0", + "doctrine/orm": "~2.4|~2.5|~2.6", "twig/twig": "^1.12|^2.0", "phpunit/phpunit": "~4.8", "scrutinizer/ocular": "~1.3", diff --git a/tests/DependencyInjection/GpsLabPaginationExtensionTest.php b/tests/DependencyInjection/GpsLabPaginationExtensionTest.php index 7fc7605..ecc80f9 100644 --- a/tests/DependencyInjection/GpsLabPaginationExtensionTest.php +++ b/tests/DependencyInjection/GpsLabPaginationExtensionTest.php @@ -15,33 +15,31 @@ class GpsLabPaginationExtensionTest extends TestCase { + /** + * @var GpsLabPaginationExtension + */ + private $extension; + + protected function setUp() + { + $this->extension = new GpsLabPaginationExtension(); + } + public function testLoad() { - /* @var $container \PHPUnit_Framework_MockObject_MockObject|ContainerBuilder */ - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder'); - $container - ->expects($this->at(0)) - ->method('setParameter') - ->with('pagination.max_navigate', 5) - ; - $container - ->expects($this->at(1)) - ->method('setParameter') - ->with('pagination.parameter_name', 'page') - ; - $container - ->expects($this->at(2)) - ->method('setParameter') - ->with('pagination.template', 'GpsLabPaginationBundle::pagination.html.twig') - ; + $container = new ContainerBuilder(); + $this->extension->load([], $container); - $extension = new GpsLabPaginationExtension(); - $extension->load([], $container); + $this->assertEquals(5, $container->getParameter('pagination.max_navigate')); + $this->assertEquals('page', $container->getParameter('pagination.parameter_name')); + $this->assertEquals( + 'GpsLabPaginationBundle::pagination.html.twig', + $container->getParameter('pagination.template') + ); } public function testGetAlias() { - $extension = new GpsLabPaginationExtension(); - $this->assertEquals('gpslab_pagination', $extension->getAlias()); + $this->assertEquals('gpslab_pagination', $this->extension->getAlias()); } }