Skip to content

Commit 3c4c734

Browse files
ElectricMaxxxNyholm
authored andcommitted
allow symfony 4.0 for dependencies (#86)
* allow symfony 4.0 for dependencies fix composer.json Allow to use Symfony 4 Also dropped unmaintained version <2.7 from supported Adjust .travis.yml file to match Symfony dependency changes back to v1.x fix test style fixes fix dependency injection versioning in travis.yml remove test as it isn't used try with beta revert stupid version change increase travis php version vor 4.0 add prefere-stable * use the other travis version * allow config-test version * redo change
1 parent 95c3b8f commit 3c4c734

File tree

4 files changed

+56
-56
lines changed

4 files changed

+56
-56
lines changed

.travis.yml

Lines changed: 49 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,55 @@
1+
language: php
12
sudo: false
3+
cache:
4+
directories:
5+
- $HOME/.composer/cache/files
6+
- $HOME/symfony-bridge/.phpunit
7+
env:
8+
global:
9+
- PHPUNIT_FLAGS="-v"
10+
- SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit"
11+
matrix:
12+
fast_finish: true
13+
include:
14+
# Minimum supported Symfony version with the latest PHP version
15+
- php: 7.1
16+
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest"
217

3-
language: php
18+
# Test the latest stable release
19+
- php: 7.0
20+
- php: 7.1
21+
- php: 7.2
22+
env: COVERAGE=true PHPUNIT_FLAGS="-v --coverage-text"
423

5-
php:
6-
- 5.3
7-
- 5.4
8-
- 5.5
9-
- 5.6
10-
- 7.0
11-
- hhvm
24+
# Force some major versions of Symfony
25+
- php: 7.2
26+
env: DEPENDENCIES="dunglas/symfony-lock:^2"
27+
- php: 7.2
28+
env: DEPENDENCIES="dunglas/symfony-lock:^3"
29+
- php: 7.2
30+
env: DEPENDENCIES="dunglas/symfony-lock:^4" STABILITY="beta"
1231

13-
matrix:
14-
fast_finish: true
15-
include:
16-
- php: 5.3
17-
env: deps="low"
18-
- php: 7.0
19-
env: SYMFONY_DI_VERSION=2.3.*
20-
- php: 7.0
21-
env: SYMFONY_DI_VERSION=2.7.*
22-
- php: 7.0
23-
env: SYMFONY_DI_VERSION=2.8.*
24-
- php: 7.0
25-
env: SYMFONY_DI_VERSION=3.0.*
26-
allow_failures:
27-
- php: hhvm
28-
29-
before_script:
30-
- if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then phpenv config-rm xdebug.ini; fi
31-
- if [ "$SYMFONY_DI_VERSION" != "" ]; then composer require --no-update "symfony/dependency-injection:${SYMFONY_DI_VERSION}"; fi
32-
- if [ "$PHPUNIT_VERSION" != "" ]; then composer require --no-update "phpunit/phpunit:${PHPUNIT_VERSION}"; fi
33-
- if [ "$deps" = "low" ]; then composer update --prefer-lowest; fi
34-
- if [ "$deps" = "" ]; then composer install; fi
35-
36-
script: vendor/bin/phpunit
32+
# Latest commit to master
33+
- php: 7.2
34+
env: STABILITY="dev"
3735

38-
notifications:
39-
36+
allow_failures:
37+
# Dev-master is allowed to fail.
38+
- env: STABILITY="dev"
4039

41-
cache:
42-
directories:
43-
- $COMPOSER_CACHE_DIR
40+
before_install:
41+
- if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi
42+
- if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi;
43+
- if ! [ -z "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi;
44+
45+
install:
46+
# To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355
47+
- if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi
48+
- composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction
49+
50+
script:
51+
- composer validate --strict --no-check-lock
52+
- ./vendor/bin/phpunit $PHPUNIT_FLAGS
53+
54+
notifications:
55+

PhpUnit/ContainerBuilderHasAliasConstraint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ private function evaluateServiceId(ContainerBuilder $containerBuilder, $returnRe
7979
*/
8080
$actualServiceId = (string) $alias;
8181

82-
$constraint = new \PHPUnit_Framework_Constraint_IsEqual(strtolower($this->expectedServiceId));
82+
$constraint = new \PHPUnit_Framework_Constraint_IsEqual($this->expectedServiceId);
8383
if (!$constraint->evaluate($actualServiceId, '', true)) {
8484
if ($returnResult) {
8585
return false;

Tests/PhpUnit/ContainerBuilderHasAliasConstraintTest.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,4 @@ public function it_expects_a_string_for_service_id()
7373
$this->setExpectedException('\InvalidArgumentException', 'string');
7474
new ContainerBuilderHasAliasConstraint('alias_id', new \stdClass());
7575
}
76-
77-
/**
78-
* @test
79-
*/
80-
public function it_lower_cases_aliased_service_ids()
81-
{
82-
$containerBuilder = new ContainerBuilder();
83-
$containerBuilder->setAlias('foo', 'fooBar');
84-
$constraint = new ContainerBuilderHasAliasConstraint('foo', 'fooBar');
85-
86-
$this->assertTrue($constraint->evaluate($containerBuilder, null, true));
87-
}
8876
}

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
}
1414
],
1515
"require": {
16-
"matthiasnoback/symfony-config-test": "^1.0|^2.0",
17-
"symfony/dependency-injection": "^2.3|^3.0",
18-
"symfony/config": "^2.3|^3.0",
19-
"symfony/yaml": "^2.7|^3.0",
20-
"sebastian/exporter": "^1.0|^2.0"
16+
"matthiasnoback/symfony-config-test": "^1.0 || ^2.0",
17+
"symfony/dependency-injection": "^2.7 || ^3.3 || ^4.0",
18+
"symfony/config": "^2.7 || ^3.3 || ^4.0",
19+
"symfony/yaml": "^2.7 || ^3.3 || ^4.0",
20+
"sebastian/exporter": "^1.0 || ^2.0"
2121
},
2222
"require-dev": {
23-
"phpunit/phpunit": "^4.0|^5.0"
23+
"phpunit/phpunit": "^4.0 || ^5.0"
2424
},
2525
"autoload": {
2626
"psr-4" : { "Matthias\\SymfonyDependencyInjectionTest\\" : "" }

0 commit comments

Comments
 (0)