Skip to content

Commit 92f621f

Browse files
Merge branch '3.3' into 3.4
* 3.3: [Bridge\PhpUnit] Fix infinite loop when running isolated method remove unused fixtures file parse references on merge keys with objects
2 parents 61cda3e + 4ed67a6 commit 92f621f

File tree

4 files changed

+38
-62
lines changed

4 files changed

+38
-62
lines changed

src/Symfony/Bridge/PhpUnit/bin/simple-phpunit

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
8181
8282
define('PHPUNIT_COMPOSER_INSTALL', __DIR__.'/vendor/autoload.php');
8383
require PHPUNIT_COMPOSER_INSTALL;
84+
if (class_exists('PHPUnit_Util_Blacklist')) {
85+
PHPUnit_Util_Blacklist::$blacklistedClassNames['\PHPUnit\Framework\TestCase'] = 3;
86+
} else {
87+
PHPUnit\Util\Blacklist::$blacklistedClassNames['\PHPUnit\Framework\TestCase'] = 3;
88+
}
8489
Symfony\Bridge\PhpUnit\TextUI\Command::main();
8590

8691
EOPHP

src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services31.php

Lines changed: 0 additions & 62 deletions
This file was deleted.

src/Symfony/Component/Yaml/Parser.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,11 @@ private function doParse($value, $flags)
367367
$value = $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(), $flags);
368368
if ('<<' === $key) {
369369
$this->refs[$refMatches['ref']] = $value;
370+
371+
if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && $value instanceof \stdClass) {
372+
$value = (array) $value;
373+
}
374+
370375
$data += $value;
371376
} elseif ($allowOverwrite || !isset($data[$key])) {
372377
// Spec: Keys MUST be unique; first one wins.

src/Symfony/Component/Yaml/Tests/ParserTest.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2018,6 +2018,34 @@ public function testParseReferencesOnMergeKeys()
20182018

20192019
$this->assertSame($expected, $this->parser->parse($yaml));
20202020
}
2021+
2022+
public function testParseReferencesOnMergeKeysWithMappingsParsedAsObjects()
2023+
{
2024+
$yaml = <<<YAML
2025+
mergekeyrefdef:
2026+
a: foo
2027+
<<: &quux
2028+
b: bar
2029+
c: baz
2030+
mergekeyderef:
2031+
d: quux
2032+
<<: *quux
2033+
YAML;
2034+
$expected = (object) array(
2035+
'mergekeyrefdef' => (object) array(
2036+
'a' => 'foo',
2037+
'b' => 'bar',
2038+
'c' => 'baz',
2039+
),
2040+
'mergekeyderef' => (object) array(
2041+
'd' => 'quux',
2042+
'b' => 'bar',
2043+
'c' => 'baz',
2044+
),
2045+
);
2046+
2047+
$this->assertEquals($expected, $this->parser->parse($yaml, Yaml::PARSE_OBJECT_FOR_MAP));
2048+
}
20212049
}
20222050

20232051
class B

0 commit comments

Comments
 (0)