Skip to content

Commit c1c1267

Browse files
authored
Test with Symfony 4 (#87)
* Test with Symfony 4 * Removed simple phpunit * Removed test that is not longer relevant in later versions of symfony * Added RC flag * Update CHANGELOG.md
1 parent dadd683 commit c1c1267

File tree

4 files changed

+52
-41
lines changed

4 files changed

+52
-41
lines changed

.travis.yml

Lines changed: 45 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,55 @@
1-
sudo: false
2-
31
language: php
4-
5-
matrix:
6-
fast_finish: true
7-
include:
8-
- php: 7.0
9-
env: SYMFONY_DI_VERSION=2.3.*
10-
- php: 7.0
11-
env: SYMFONY_DI_VERSION=2.7.*
12-
- php: 7.0
13-
env: SYMFONY_DI_VERSION=2.8.*
14-
- php: 7.0
15-
env: SYMFONY_DI_VERSION=3.2.*
16-
2+
sudo: false
173
cache:
18-
directories:
19-
- ~/.composer/cache/files
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"
17+
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"
23+
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"
31+
32+
# Latest commit to master
33+
- php: 7.2
34+
env: STABILITY="dev"
35+
36+
allow_failures:
37+
# Dev-master is allowed to fail.
38+
- env: STABILITY="dev"
2039

2140
before_install:
22-
- phpenv config-rm xdebug.ini || true
23-
- composer self-update
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;
2444

2545
install:
26-
- if [ ! -z ${SYMFONY_DI_VERSION+x} ]; then composer require --no-update "symfony/dependency-injection:${SYMFONY_DI_VERSION}"; fi
27-
- composer install --prefer-dist
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
2849

29-
script: vendor/bin/phpunit
50+
script:
51+
- composer validate --strict --no-check-lock
52+
- ./vendor/bin/phpunit $PHPUNIT_FLAGS
3053

3154
notifications:
3255
33-
34-
cache:
35-
directories:
36-
- $COMPOSER_CACHE_DIR

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## v2.2.0
4+
5+
- Support for Symfony 4
6+
37
## v2.1.0
48

59
- Added support for validating invocation index order of method call (see #69).

Tests/PhpUnit/ContainerBuilderHasAliasConstraintTest.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,4 @@ public function it_expects_a_string_for_service_id()
7878

7979
new ContainerBuilderHasAliasConstraint('alias_id', new \stdClass());
8080
}
81-
82-
/**
83-
* @test
84-
*/
85-
public function it_lower_cases_aliased_service_ids()
86-
{
87-
$containerBuilder = new ContainerBuilder();
88-
$containerBuilder->setAlias('foo', 'fooBar');
89-
$constraint = new ContainerBuilderHasAliasConstraint('foo', 'fooBar');
90-
91-
$this->assertTrue($constraint->evaluate($containerBuilder, null, true));
92-
}
9381
}

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
"require": {
1616
"php": "^7.0",
1717
"matthiasnoback/symfony-config-test": "^3.0",
18-
"symfony/dependency-injection": "^2.3|^3.0",
19-
"symfony/config": "^2.3|^3.0",
20-
"symfony/yaml": "^2.7|^3.0"
18+
"symfony/dependency-injection": "^2.7 || ^3.3 || ^4.0",
19+
"symfony/config": "^2.7 || ^3.3 || ^4.0",
20+
"symfony/yaml": "^2.7 || ^3.3 || ^4.0"
2121
},
2222
"require-dev": {
2323
"phpunit/phpunit": "^6.0"

0 commit comments

Comments
 (0)