Skip to content

Commit

Permalink
Merge pull request #2 from peter-gribanov/build
Browse files Browse the repository at this point in the history
Correct build project in Travic CI
  • Loading branch information
peter-gribanov committed Aug 14, 2019
2 parents c12e523 + 918576e commit b07ee42
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 51 deletions.
56 changes: 29 additions & 27 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
40 changes: 19 additions & 21 deletions tests/DependencyInjection/GpsLabPaginationExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}

0 comments on commit b07ee42

Please sign in to comment.