JsonDescriptor - encode container params only once
This commit is contained in:
parent
7f62133939
commit
dd9d076a0b
@ -157,7 +157,7 @@ class JsonDescriptor extends Descriptor
|
||||
{
|
||||
$key = isset($options['parameter']) ? $options['parameter'] : '';
|
||||
|
||||
$this->writeData(array($key => $this->formatParameter($parameter)), $options);
|
||||
$this->writeData(array($key => $parameter), $options);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -113,6 +113,7 @@ abstract class AbstractDescriptorTest extends \PHPUnit_Framework_TestCase
|
||||
$data = $this->getDescriptionTestData(ObjectsProvider::getContainerParameter());
|
||||
|
||||
$data[0][] = array('parameter' => 'database_name');
|
||||
$data[1][] = array('parameter' => 'twig.form.resources');
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
@ -72,9 +72,16 @@ class ObjectsProvider
|
||||
{
|
||||
$builder = new ContainerBuilder();
|
||||
$builder->setParameter('database_name', 'symfony');
|
||||
$builder->setParameter('twig.form.resources', array(
|
||||
'bootstrap_3_horizontal_layout.html.twig',
|
||||
'bootstrap_3_layout.html.twig',
|
||||
'form_div_layout.html.twig',
|
||||
'form_table_layout.html.twig',
|
||||
));
|
||||
|
||||
return array(
|
||||
'parameter' => $builder,
|
||||
'array_parameter' => $builder,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"twig.form.resources": ["bootstrap_3_horizontal_layout.html.twig", "bootstrap_3_layout.html.twig", "form_div_layout.html.twig", "form_table_layout.html.twig"]
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
twig.form.resources
|
||||
===================
|
||||
|
||||
["bootstrap_3_horizontal_layout.html.twig","bootstrap_3_layo...
|
@ -0,0 +1 @@
|
||||
["bootstrap_3_horizontal_layout.html.twig","bootstrap_3_layo...
|
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<parameter key="twig.form.resources">["bootstrap_3_horizontal_layout.html.twig","bootstrap_3_layo...</parameter>
|
Reference in New Issue
Block a user