NodeDefinitionTest.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Config\Tests\Definition\Builder;
  11. use PHPUnit\Framework\TestCase;
  12. use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
  13. use Symfony\Component\Config\Definition\Builder\NodeDefinition;
  14. use Symfony\Component\Config\Definition\Builder\ScalarNodeDefinition;
  15. class NodeDefinitionTest extends TestCase
  16. {
  17. public function testDefaultPathSeparatorIsDot()
  18. {
  19. $node = $this->getMockForAbstractClass(NodeDefinition::class, ['foo']);
  20. $this->assertAttributeSame('.', 'pathSeparator', $node);
  21. }
  22. public function testSetPathSeparatorChangesChildren()
  23. {
  24. $node = new ArrayNodeDefinition('foo');
  25. $scalar = new ScalarNodeDefinition('bar');
  26. $node->append($scalar);
  27. $node->setPathSeparator('/');
  28. $this->assertAttributeSame('/', 'pathSeparator', $node);
  29. $this->assertAttributeSame('/', 'pathSeparator', $scalar);
  30. }
  31. }