Skip to content

Commit 7c63eae

Browse files
Merge branch '3.4'
* 3.4: [Bridge\PhpUnit] Fix infinite loop when running isolated method remove unused fixtures file parse references on merge keys with objects
2 parents 3c05652 + 92f621f commit 7c63eae

File tree

4 files changed

+38
-65
lines changed

4 files changed

+38
-65
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 & 65 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
@@ -315,6 +315,11 @@ private function doParse(string $value, int $flags)
315315
$value = $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(), $flags);
316316
if ('<<' === $key) {
317317
$this->refs[$refMatches['ref']] = $value;
318+
319+
if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && $value instanceof \stdClass) {
320+
$value = (array) $value;
321+
}
322+
318323
$data += $value;
319324
} elseif ($allowOverwrite || !isset($data[$key])) {
320325
// 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
@@ -1860,6 +1860,34 @@ public function testParseReferencesOnMergeKeys()
18601860

18611861
$this->assertSame($expected, $this->parser->parse($yaml));
18621862
}
1863+
1864+
public function testParseReferencesOnMergeKeysWithMappingsParsedAsObjects()
1865+
{
1866+
$yaml = <<<YAML
1867+
mergekeyrefdef:
1868+
a: foo
1869+
<<: &quux
1870+
b: bar
1871+
c: baz
1872+
mergekeyderef:
1873+
d: quux
1874+
<<: *quux
1875+
YAML;
1876+
$expected = (object) array(
1877+
'mergekeyrefdef' => (object) array(
1878+
'a' => 'foo',
1879+
'b' => 'bar',
1880+
'c' => 'baz',
1881+
),
1882+
'mergekeyderef' => (object) array(
1883+
'd' => 'quux',
1884+
'b' => 'bar',
1885+
'c' => 'baz',
1886+
),
1887+
);
1888+
1889+
$this->assertEquals($expected, $this->parser->parse($yaml, Yaml::PARSE_OBJECT_FOR_MAP));
1890+
}
18631891
}
18641892

18651893
class B

0 commit comments

Comments
 (0)