Skip to content

Commit db85cdc

Browse files
authored
Merge pull request #80 from marcelthole/bump-yaml-version
Bump yaml version
2 parents 9796b0e + 9338741 commit db85cdc

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ matrix:
44
include:
55
# linux tests
66
- php: '7.1'
7-
env: YAML=^3.0
7+
env: YAML=^3.4
88
- php: '7.1'
99
env: YAML=~4.3.0
1010
- php: '7.2'
11-
env: YAML=^3.0
11+
env: YAML=^3.4
1212
- php: '7.2'
1313
env: YAML=~4.3.0
1414
- php: '7.3'
15-
env: YAML=^3.0
15+
env: YAML=^3.4
1616
- php: '7.3'
1717
env: YAML=~4.3.0
1818
- php: '7.3'
1919
env: YAML=^5.0
2020
- php: '7.4'
21-
env: YAML=^3.0
21+
env: YAML=^3.4
2222
- php: '7.4'
2323
env: YAML=~4.3.0
2424
- php: '7.4'

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"require": {
2121
"php": ">=7.1.0",
2222
"ext-json": "*",
23-
"symfony/yaml": "^3.0 | ^4.0 | ^5.0",
23+
"symfony/yaml": "^3.4 | ^4.0 | ^5.0",
2424
"justinrainbow/json-schema": "^5.0"
2525
},
2626
"require-dev": {

tests/ReaderTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,12 @@ public function testSymfonyYamlBugHunt()
9696
{
9797
// skip test on symfony/yaml 5.0 due to bug https://github.com/symfony/symfony/issues/34805
9898
$installed = json_decode(file_get_contents(__DIR__ . '/../vendor/composer/installed.json'), true);
99+
// Check for composer 2.0 structure
100+
if (array_key_exists('packages', $installed)) {
101+
$installed = $installed['packages'];
102+
}
99103
foreach($installed as $pkg) {
100-
if ($pkg['name'] === 'symfony/yaml' && strncmp($pkg['version_normalized'], '5.0', 3) === 0) {
104+
if ($pkg['name'] === 'symfony/yaml' && version_compare($pkg['version'], 'v4.4', '>=')) {
101105
$this->markTestSkipped(
102106
'This test is incompatible with symfony/yaml 4.4 and 5.0, see symfony bug https://github.com/symfony/symfony/issues/34805'
103107
);

tests/spec/OpenApiTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,12 @@ public function testSpecs($openApiFile)
186186
// skip test on symfony/yaml 5.0 due to bug https://github.com/symfony/symfony/issues/34805
187187
if ($openApiFile === 'oai/openapi-specification/examples/v3.0/uspto.yaml') {
188188
$installed = json_decode(file_get_contents(__DIR__ . '/../../vendor/composer/installed.json'), true);
189+
// Check for composer 2.0 structure
190+
if (array_key_exists('packages', $installed)) {
191+
$installed = $installed['packages'];
192+
}
189193
foreach ($installed as $pkg) {
190-
if ($pkg['name'] === 'symfony/yaml' && strncmp($pkg['version_normalized'], '5.0', 3) === 0) {
194+
if ($pkg['name'] === 'symfony/yaml' && version_compare($pkg['version'], 'v4.4', '>=')) {
191195
$this->markTestSkipped(
192196
'This test is incompatible with symfony/yaml 4.4 and 5.0, see symfony bug https://github.com/symfony/symfony/issues/34805'
193197
);

0 commit comments

Comments
 (0)