Merge branch '2.8' into 3.1

* 2.8:
  add dependency on Twig
  [Config] Do not skip YamlReferenceDumperTest entirely
  [Config] Fix YamlReferenceDumper extra space
This commit is contained in:
Fabien Potencier 2016-12-09 08:41:06 +01:00
commit 9369b4df83
5 changed files with 8 additions and 8 deletions

View File

@ -19,7 +19,8 @@
"php": ">=5.5.9",
"symfony/http-kernel": "~3.1",
"symfony/routing": "~2.8|~3.0",
"symfony/twig-bridge": "~2.8|~3.0"
"symfony/twig-bridge": "~2.8|~3.0",
"twig/twig": "~1.28|~2.0"
},
"require-dev": {
"symfony/config": "~2.8|~3.0",

View File

@ -125,7 +125,7 @@ class YamlReferenceDumper
$default = (string) $default != '' ? ' '.$default : '';
$comments = count($comments) ? '# '.implode(', ', $comments) : '';
$text = rtrim(sprintf('%-20s %s %s', $node->getName().':', $default, $comments), ' ');
$text = rtrim(sprintf('%-21s%s %s', $node->getName().':', $default, $comments), ' ');
if ($info = $node->getInfo()) {
$this->writeLine('');

View File

@ -49,6 +49,7 @@ class XmlReferenceDumperTest extends \PHPUnit_Framework_TestCase
scalar-array-empty=""
scalar-array-defaults="elem1,elem2"
scalar-required=""
node-with-a-looong-name=""
enum-with-default="this"
enum=""
>

View File

@ -22,8 +22,8 @@ class YamlReferenceDumperTest extends \PHPUnit_Framework_TestCase
$dumper = new YamlReferenceDumper();
$this->assertContains($this->getConfigurationAsString(), $dumper->dump($configuration));
$this->markTestIncomplete('The Yaml Dumper currently does not support prototyped arrays');
$this->assertEquals($this->getConfigurationAsString(), $dumper->dump($configuration));
}
private function getConfigurationAsString()
@ -32,7 +32,7 @@ class YamlReferenceDumperTest extends \PHPUnit_Framework_TestCase
acme_root:
boolean: true
scalar_empty: ~
scalar_null: ~
scalar_null: null
scalar_true: true
scalar_false: false
scalar_default: default
@ -43,6 +43,7 @@ acme_root:
- elem1
- elem2
scalar_required: ~ # Required
node_with_a_looong_name: ~
enum_with_default: this # One of "this"; "that"
enum: ~ # One of "this"; "that"
@ -59,10 +60,6 @@ acme_root:
# Prototype: Parameter name
name: ~
connections:
# Prototype
- { user: ~, pass: ~ }
EOL;
}
}

View File

@ -34,6 +34,7 @@ class ExampleConfiguration implements ConfigurationInterface
->scalarNode('scalar_array_empty')->defaultValue(array())->end()
->scalarNode('scalar_array_defaults')->defaultValue(array('elem1', 'elem2'))->end()
->scalarNode('scalar_required')->isRequired()->end()
->scalarNode('node_with_a_looong_name')->end()
->enumNode('enum_with_default')->values(array('this', 'that'))->defaultValue('this')->end()
->enumNode('enum')->values(array('this', 'that'))->end()
->arrayNode('array')