Skip to content

Commit 9904ae7

Browse files
Merge pull request #61 from pamil/update-constraints
Update Travis matrix build & bump up Composer dependencies
2 parents cf5f61b + c8e5665 commit 9904ae7

File tree

4 files changed

+24
-54
lines changed

4 files changed

+24
-54
lines changed

.travis.yml

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,20 @@ matrix:
1515
include:
1616
- php: 5.3
1717
env: deps="low"
18-
- php: 5.6
19-
env: SYMFONY_DI_VERSION=2.3.* PHPUNIT_VERSION=~3.7
20-
- php: 5.6
21-
env: SYMFONY_DI_VERSION=2.0.* SYMFONY_YAML_VERSION=2.7.* PHPUNIT_VERSION=~4.0
22-
- php: 5.6
23-
env: SYMFONY_DI_VERSION=2.1.* SYMFONY_YAML_VERSION=2.7.* PHPUNIT_VERSION=~4.0
24-
- php: 5.6
25-
env: SYMFONY_DI_VERSION=2.2.* SYMFONY_YAML_VERSION=2.7.* PHPUNIT_VERSION=~4.0
26-
- php: 5.6
27-
env: SYMFONY_DI_VERSION=2.3.* PHPUNIT_VERSION=~4.0
28-
- php: 5.6
29-
env: SYMFONY_DI_VERSION=2.4.* PHPUNIT_VERSION=~4.0
30-
- php: 5.6
31-
env: SYMFONY_DI_VERSION=2.6.* PHPUNIT_VERSION=~4.0
32-
- php: 5.6
33-
env: SYMFONY_DI_VERSION=2.7.* PHPUNIT_VERSION=~4.0
34-
- php: 5.6
35-
env: SYMFONY_DI_VERSION=2.8.* PHPUNIT_VERSION=~4.0
36-
- php: 5.6
37-
env: SYMFONY_DI_VERSION=3.0.* PHPUNIT_VERSION=~4.0
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.*
3826
allow_failures:
3927
- php: hhvm
4028

4129
before_script:
4230
- if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then phpenv config-rm xdebug.ini; fi
4331
- if [ "$SYMFONY_DI_VERSION" != "" ]; then composer require --no-update "symfony/dependency-injection:${SYMFONY_DI_VERSION}"; fi
44-
- if [ "$SYMFONY_YAML_VERSION" != "" ]; then composer require --no-update "symfony/yaml:${SYMFONY_YAML_VERSION}"; fi
4532
- if [ "$PHPUNIT_VERSION" != "" ]; then composer require --no-update "phpunit/phpunit:${PHPUNIT_VERSION}"; fi
4633
- if [ "$deps" = "low" ]; then composer update --prefer-lowest; fi
4734
- if [ "$deps" = "" ]; then composer install; fi

Tests/PhpUnit/AbstractExtensionTestCaseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public function if_definition_does_not_have_argument_it_fails()
153153
{
154154
$this->load();
155155

156-
$this->setExpectedException('\PHPUnit_Framework_ExpectationFailedException', 10);
156+
$this->setExpectedException('\PHPUnit_Framework_ExpectationFailedException', '10');
157157

158158
$this->assertContainerBuilderHasServiceDefinitionWithArgument('manual_service_id', 10, 'any value');
159159
}

Tests/PhpUnit/ContainerHasParameterConstraintTest.php

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,17 @@ public function containerBuilderProvider()
2929

3030
$parameterName = 'parameter_name';
3131
$parameterValue = 'some value';
32-
$containerWithParameter = $this->createMockContainerWithParameters(
33-
array(
34-
$parameterName => $parameterValue
35-
)
36-
);
37-
3832
$wrongParameterValue = 'some other value';
3933

4034
return array(
4135
// the container does not have the parameter
4236
array($emptyContainer, $parameterName, $parameterValue, true, false),
4337
// the container has the parameter but the values don't match
44-
array($containerWithParameter, $parameterName, $wrongParameterValue, true, false),
38+
array($this->createMockContainerWithParameters(array($parameterName => $parameterValue)), $parameterName, $wrongParameterValue, true, false),
4539
// the container has the parameter and the value matches
46-
array($containerWithParameter, $parameterName, $parameterValue, true, true),
40+
array($this->createMockContainerWithParameters(array($parameterName => $parameterValue)), $parameterName, $parameterValue, true, true),
4741
// the container has the parameter and the value is optional
48-
array($containerWithParameter, $parameterName, null, false, true),
42+
array($this->createMockContainerWithParameters(array($parameterName => $parameterValue)), $parameterName, null, false, true),
4943
);
5044
}
5145

@@ -56,24 +50,16 @@ private function createMockContainerWithParameters(array $parameters)
5650
$container
5751
->expects($this->any())
5852
->method('hasParameter')
59-
->will(
60-
$this->returnCallback(
61-
function ($parameterName) use ($parameters) {
62-
return array_key_exists($parameterName, $parameters);
63-
}
64-
)
65-
);
53+
->willReturnCallback(function ($parameterName) use ($parameters) {
54+
return array_key_exists($parameterName, $parameters);
55+
});
6656

6757
$container
6858
->expects($this->any())
6959
->method('getParameter')
70-
->will(
71-
$this->returnCallback(
72-
function ($parameterName) use ($parameters) {
73-
return $parameters[$parameterName];
74-
}
75-
)
76-
);
60+
->willReturnCallback(function ($parameterName) use ($parameters) {
61+
return $parameters[$parameterName];
62+
});
7763

7864
return $container;
7965
}

composer.json

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,13 @@
1313
}
1414
],
1515
"require": {
16-
"matthiasnoback/symfony-config-test": "0.*|~1.0",
17-
"symfony/dependency-injection": "^2.0.5|~3.0",
18-
"symfony/config": "^2.0.5|~3.0",
19-
"sebastian/exporter": "~1"
16+
"matthiasnoback/symfony-config-test": "^1.0|^2.0",
17+
"phpunit/phpunit": "^4.0|^5.0",
18+
"symfony/dependency-injection": "^2.3|^3.0",
19+
"symfony/config": "^2.3|^3.0",
20+
"symfony/yaml": "^2.7|^3.0",
21+
"sebastian/exporter": "^1.0"
2022
},
21-
"require-dev": {
22-
"phpunit/phpunit": "~3.0|~4.0"
23-
},
24-
"minimum-stability": "dev",
25-
"prefer-stable": true,
2623
"autoload": {
2724
"psr-4" : { "Matthias\\SymfonyDependencyInjectionTest\\" : "" }
2825
}

0 commit comments

Comments
 (0)