Skip to content

Commit 485e35b

Browse files
committed
Fix deprecation on 4.3
1 parent 32fa79a commit 485e35b

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)