Merge branch '3.4' into 4.0
* 3.4: [Form] fix truncating form views in data collector [TwigBridge][Form] fix tests by moving AbstractBootstrap* cases to the bridge
This commit is contained in:
commit
9d4abf842f
@ -9,7 +9,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Form\Tests;
|
||||
namespace Symfony\Bridge\Twig\Tests\Extension;
|
||||
|
||||
abstract class AbstractBootstrap3HorizontalLayoutTest extends AbstractBootstrap3LayoutTest
|
||||
{
|
@ -9,9 +9,10 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Form\Tests;
|
||||
namespace Symfony\Bridge\Twig\Tests\Extension;
|
||||
|
||||
use Symfony\Component\Form\FormError;
|
||||
use Symfony\Component\Form\Tests\AbstractLayoutTest;
|
||||
|
||||
abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
|
||||
{
|
@ -9,7 +9,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Form\Tests;
|
||||
namespace Symfony\Bridge\Twig\Tests\Extension;
|
||||
|
||||
use Symfony\Component\Form\FormError;
|
||||
|
@ -9,7 +9,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Form\Tests;
|
||||
namespace Symfony\Bridge\Twig\Tests\Extension;
|
||||
|
||||
use Symfony\Component\Form\Extension\Core\Type\ButtonType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
@ -18,7 +18,6 @@ use Symfony\Bridge\Twig\Tests\Extension\Fixtures\StubTranslator;
|
||||
use Symfony\Bridge\Twig\Tests\Extension\Fixtures\StubFilesystemLoader;
|
||||
use Symfony\Component\Form\FormRenderer;
|
||||
use Symfony\Component\Form\FormView;
|
||||
use Symfony\Component\Form\Tests\AbstractBootstrap3HorizontalLayoutTest;
|
||||
use Twig\Environment;
|
||||
|
||||
class FormExtensionBootstrap3HorizontalLayoutTest extends AbstractBootstrap3HorizontalLayoutTest
|
||||
|
@ -18,7 +18,6 @@ use Symfony\Bridge\Twig\Tests\Extension\Fixtures\StubTranslator;
|
||||
use Symfony\Bridge\Twig\Tests\Extension\Fixtures\StubFilesystemLoader;
|
||||
use Symfony\Component\Form\FormRenderer;
|
||||
use Symfony\Component\Form\FormView;
|
||||
use Symfony\Component\Form\Tests\AbstractBootstrap3LayoutTest;
|
||||
use Twig\Environment;
|
||||
|
||||
class FormExtensionBootstrap3LayoutTest extends AbstractBootstrap3LayoutTest
|
||||
|
@ -18,7 +18,6 @@ use Symfony\Bridge\Twig\Tests\Extension\Fixtures\StubTranslator;
|
||||
use Symfony\Bridge\Twig\Tests\Extension\Fixtures\StubFilesystemLoader;
|
||||
use Symfony\Component\Form\FormRenderer;
|
||||
use Symfony\Component\Form\FormView;
|
||||
use Symfony\Component\Form\Tests\AbstractBootstrap4HorizontalLayoutTest;
|
||||
use Twig\Environment;
|
||||
|
||||
/**
|
||||
|
@ -18,7 +18,6 @@ use Symfony\Bridge\Twig\Tests\Extension\Fixtures\StubTranslator;
|
||||
use Symfony\Bridge\Twig\Tests\Extension\Fixtures\StubFilesystemLoader;
|
||||
use Symfony\Component\Form\FormRenderer;
|
||||
use Symfony\Component\Form\FormView;
|
||||
use Symfony\Component\Form\Tests\AbstractBootstrap4LayoutTest;
|
||||
use Twig\Environment;
|
||||
|
||||
/**
|
||||
|
@ -19,6 +19,7 @@ use Symfony\Component\HttpKernel\DataCollector\DataCollector;
|
||||
use Symfony\Component\Validator\ConstraintViolationInterface;
|
||||
use Symfony\Component\VarDumper\Caster\Caster;
|
||||
use Symfony\Component\VarDumper\Caster\ClassStub;
|
||||
use Symfony\Component\VarDumper\Caster\StubCaster;
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
@ -261,6 +262,7 @@ class FormDataCollector extends DataCollector implements FormDataCollectorInterf
|
||||
Caster::PREFIX_VIRTUAL.'type_class' => new ClassStub(get_class($f->getConfig()->getType()->getInnerType())),
|
||||
);
|
||||
},
|
||||
FormView::class => array(StubCaster::class, 'cutInternals'),
|
||||
ConstraintViolationInterface::class => function (ConstraintViolationInterface $v, array $a) {
|
||||
return array(
|
||||
Caster::PREFIX_VIRTUAL.'root' => $v->getRoot(),
|
||||
|
@ -14,7 +14,6 @@ namespace Symfony\Component\Form\Extension\DataCollector;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\Form\FormView;
|
||||
use Symfony\Component\Validator\ConstraintViolationInterface;
|
||||
use Symfony\Component\VarDumper\Caster\CutStub;
|
||||
|
||||
/**
|
||||
* Default implementation of {@link FormDataExtractorInterface}.
|
||||
@ -145,10 +144,6 @@ class FormDataExtractor implements FormDataExtractorInterface
|
||||
);
|
||||
|
||||
foreach ($view->vars as $varName => $value) {
|
||||
// Removing redundant variable from view variables
|
||||
if ('form' === $varName) {
|
||||
$value = new CutStub($value);
|
||||
}
|
||||
$data['view_vars'][$varName] = $value;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user