YamlReferenceDumperTest.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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\Dumper;
  11. use PHPUnit\Framework\TestCase;
  12. use Symfony\Component\Config\Definition\Dumper\YamlReferenceDumper;
  13. use Symfony\Component\Config\Tests\Fixtures\Configuration\ExampleConfiguration;
  14. class YamlReferenceDumperTest extends TestCase
  15. {
  16. public function testDumper()
  17. {
  18. $configuration = new ExampleConfiguration();
  19. $dumper = new YamlReferenceDumper();
  20. $this->assertContains($this->getConfigurationAsString(), $dumper->dump($configuration));
  21. $this->markTestIncomplete('The Yaml Dumper currently does not support prototyped arrays');
  22. }
  23. private function getConfigurationAsString()
  24. {
  25. return <<<'EOL'
  26. acme_root:
  27. boolean: true
  28. scalar_empty: ~
  29. scalar_null: null
  30. scalar_true: true
  31. scalar_false: false
  32. scalar_default: default
  33. scalar_array_empty: []
  34. scalar_array_defaults:
  35. # Defaults:
  36. - elem1
  37. - elem2
  38. scalar_required: ~ # Required
  39. node_with_a_looong_name: ~
  40. enum_with_default: this # One of "this"; "that"
  41. enum: ~ # One of "this"; "that"
  42. # some info
  43. array:
  44. child1: ~
  45. child2: ~
  46. # this is a long
  47. # multi-line info text
  48. # which should be indented
  49. child3: ~ # Example: example setting
  50. parameters:
  51. # Prototype: Parameter name
  52. name: ~
  53. EOL;
  54. }
  55. }