Skip to content

Commit 16c639c

Browse files
minor #33000 Fix deprecations on 4.3 (jderusse)
This PR was merged into the 4.3 branch. Discussion ---------- Fix deprecations on 4.3 | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #32844 | License | MIT | Doc PR | NA Fix deprecations in branch 4.3 note: remaining deprecation `assertStringContainsString` will be fixed in #32977 * [ ] fix tests in branch 3.4 in #32981 Commits ------- 8fd16a6bee Fix deprecation on 4.3
2 parents ad8f730 + 485e35b commit 16c639c

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

Tests/Definition/Builder/NodeDefinitionTest.php

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,25 @@
1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
1616
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
17-
use Symfony\Component\Config\Definition\Builder\ScalarNodeDefinition;
1817

1918
class NodeDefinitionTest extends TestCase
2019
{
21-
public function testDefaultPathSeparatorIsDot()
22-
{
23-
$node = $this->getMockForAbstractClass(NodeDefinition::class, ['foo']);
24-
25-
$this->assertAttributeSame('.', 'pathSeparator', $node);
26-
}
27-
2820
public function testSetPathSeparatorChangesChildren()
2921
{
30-
$node = new ArrayNodeDefinition('foo');
31-
$scalar = new ScalarNodeDefinition('bar');
32-
$node->append($scalar);
33-
34-
$node->setPathSeparator('/');
35-
36-
$this->assertAttributeSame('/', 'pathSeparator', $node);
37-
$this->assertAttributeSame('/', 'pathSeparator', $scalar);
22+
$parentNode = new ArrayNodeDefinition('name');
23+
$childNode = $this->createMock(NodeDefinition::class);
24+
25+
$childNode
26+
->expects($this->once())
27+
->method('setPathSeparator')
28+
->with('/');
29+
$childNode
30+
->expects($this->once())
31+
->method('setParent')
32+
->with($parentNode)
33+
->willReturn($childNode);
34+
$parentNode->append($childNode);
35+
36+
$parentNode->setPathSeparator('/');
3837
}
3938
}

0 commit comments

Comments
 (0)