-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Test on symfony 4 * sort packages * Fixed tests * Removed debug code * Adding doctrine annotations and force new versions of PHPUnut * typo * Better deps * Bugfix * serializer-bundle does not exists =) * cs * Better specify versions * Test fix on sf2.7 * minor * cs
- Loading branch information
Showing
6 changed files
with
132 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,75 @@ | ||
language: php | ||
|
||
sudo: false | ||
dist: trusty | ||
|
||
php: | ||
- 7.1 | ||
- 7.0 | ||
- 5.6 | ||
- hhvm | ||
cache: | ||
directories: | ||
- $HOME/.composer/cache/files | ||
- $HOME/symfony-bridge/.phpunit | ||
|
||
env: | ||
global: | ||
- COMPOSER_COMMAND="composer install --prefer-dist" | ||
- TEST_COMMAND="php vendor/bin/phpunit" | ||
- COVERAGE=false | ||
matrix: | ||
- SYMFONY_VERSION=2.7.* | ||
- SYMFONY_VERSION=2.8.* | ||
- SYMFONY_VERSION=3.1.* | ||
- SYMFONY_VERSION=3.2.* | ||
global: | ||
- TEST_COMMAND="composer test" | ||
- SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit" | ||
- SYMFONY_DEPRECATIONS_HELPER="weak" | ||
|
||
branches: | ||
except: | ||
- /^analysis-.*$/ | ||
- /^patch-.*$/ | ||
except: | ||
- /^analysis-.*$/ | ||
|
||
matrix: | ||
fast_finish: true | ||
include: | ||
- php: 5.6 | ||
env: COMPOSER_COMMAND="composer update --prefer-lowest --prefer-stable" COVERAGE=true TEST_COMMAND="php -dzend_extension=xdebug.so vendor/bin/phpunit --coverage-clover=coverage.xml" SYMFONY_VERSION=2.7.* | ||
fast_finish: true | ||
include: | ||
# Minimum supported Symfony version and latest PHP version | ||
- php: 7.2 | ||
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak" | ||
- php: 5.6 | ||
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak" | ||
|
||
cache: | ||
directories: | ||
- $HOME/.composer/cache | ||
# Test the latest stable release | ||
- php: 5.6 | ||
- php: 7.0 | ||
- php: 7.1 | ||
- php: 7.2 | ||
env: COVERAGE=true TEST_COMMAND="composer test-ci" | ||
|
||
# Test LTS versions | ||
- php: 7.2 | ||
env: DEPENDENCIES="dunglas/symfony-lock:^2 symfony/property-access:^2.8" | ||
- php: 7.2 | ||
env: DEPENDENCIES="dunglas/symfony-lock:^3" | ||
- php: 7.2 | ||
env: DEPENDENCIES="dunglas/symfony-lock:^4" | ||
|
||
# Latest commit to master | ||
- php: 7.2 | ||
env: STABILITY="dev" | ||
|
||
allow_failures: | ||
# dev stability is allowed to fail. | ||
- env: STABILITY="dev" | ||
|
||
before_install: | ||
- if [[ $TRAVIS_PHP_VERSION != 'hhvm' ]]; then phpenv config-rm xdebug.ini; fi; | ||
- pip install --user codecov | ||
- composer require symfony/symfony:${SYMFONY_VERSION} --no-update | ||
- if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi | ||
- if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi; | ||
- if ! [ -v "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi; | ||
- pip install --user codecov | ||
|
||
install: | ||
- travis_retry ${COMPOSER_COMMAND} --no-interaction | ||
# To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355 | ||
- if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi | ||
- composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction | ||
- vendor/bin/simple-phpunit install | ||
|
||
script: | ||
- $TEST_COMMAND | ||
- composer validate --strict --no-check-lock | ||
- $TEST_COMMAND | ||
|
||
after_success: | ||
- if [[ "$COVERAGE" = true ]]; then codecov; fi | ||
- if [[ $COVERAGE = true ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi | ||
- if [[ $COVERAGE = true ]]; then php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml; fi | ||
- if [[ "$COVERAGE" = true ]]; then codecov; fi | ||
|
||
after_script: | ||
- wget http://tnyholm.se/reporter.phar | ||
- php reporter.phar build:upload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
use Cache\CacheBundle\Routing\CachingRouter; | ||
use Cache\SessionHandler\Psr6SessionHandler; | ||
use Nyholm\BundleTest\BaseBundleTestCase; | ||
use Symfony\Component\HttpKernel\Kernel; | ||
|
||
/** | ||
* @author Tobias Nyholm <[email protected]> | ||
|
@@ -33,6 +34,10 @@ protected function setUp() | |
parent::setUp(); | ||
$kernel = $this->createKernel(); | ||
$kernel->addConfigFile(__DIR__.'/config.yml'); | ||
|
||
if (Kernel::MAJOR_VERSION < 4) { | ||
$kernel->addConfigFile(__DIR__.'/sf2_and_3.yml'); | ||
} | ||
} | ||
|
||
public function testInitBundle() | ||
|
@@ -41,10 +46,13 @@ public function testInitBundle() | |
$container = $this->getContainer(); | ||
|
||
$this->assertTrue($container->hasParameter('cache.provider_service_ids')); | ||
$this->assertInstanceOf(DoctrineCacheBridge::class, $container->get('cache.service.annotation')); | ||
$this->assertInstanceOf(DoctrineCacheBridge::class, $container->get('cache.service.serializer')); | ||
$this->assertInstanceOf(SymfonyValidatorBridge::class, $container->get('cache.service.validation')); | ||
$this->assertInstanceOf(Psr6SessionHandler::class, $container->get('cache.service.session')); | ||
$this->assertInstanceOf(CachingRouter::class, $container->get('cache.service.router')); | ||
|
||
if (Kernel::MAJOR_VERSION < 4) { | ||
$this->assertInstanceOf(DoctrineCacheBridge::class, $container->get('cache.service.annotation')); | ||
$this->assertInstanceOf(DoctrineCacheBridge::class, $container->get('cache.service.serializer')); | ||
$this->assertInstanceOf(SymfonyValidatorBridge::class, $container->get('cache.service.validation')); | ||
$this->assertInstanceOf(Psr6SessionHandler::class, $container->get('cache.service.session')); | ||
$this->assertInstanceOf(CachingRouter::class, $container->get('cache.service.router')); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of php-cache\cache-bundle package. | ||
* | ||
* (c) 2015 Aaron Scherer <[email protected]>, Tobias Nyholm <[email protected]> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
namespace Cache\CacheBundle\Tests\Functional; | ||
|
||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; | ||
|
||
class DummyNormalizer implements NormalizerInterface | ||
{ | ||
public function normalize($object, $format = null, array $context = []) | ||
{ | ||
return []; | ||
} | ||
|
||
public function supportsNormalization($data, $format = null) | ||
{ | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
framework: | ||
annotations: | ||
cache: 'cache.service.annotation' | ||
serializer: | ||
cache: 'cache.service.serializer' | ||
validation: | ||
cache: 'cache.service.validation' |