[3.0] [Twig Bridge] Fixed Tests
This commit is contained in:
parent
649061bd46
commit
2221a150fe
@ -106,17 +106,10 @@ class FormExtensionDivLayoutTest extends AbstractDivLayoutTest
|
||||
|
||||
public function isSelectedChoiceProvider()
|
||||
{
|
||||
// The commented cases should not be necessary anymore, because the
|
||||
// choice lists should assure that both values passed here are always
|
||||
// strings
|
||||
return array(
|
||||
// array(true, 0, 0),
|
||||
array(true, '0', '0'),
|
||||
array(true, '1', '1'),
|
||||
// array(true, false, 0),
|
||||
// array(true, true, 1),
|
||||
array(true, '', ''),
|
||||
// array(true, null, ''),
|
||||
array(true, '1.23', '1.23'),
|
||||
array(true, 'foo', 'foo'),
|
||||
array(true, 'foo10', 'foo10'),
|
||||
@ -144,7 +137,7 @@ class FormExtensionDivLayoutTest extends AbstractDivLayoutTest
|
||||
|
||||
protected function renderEnctype(FormView $view)
|
||||
{
|
||||
return (string) $this->extension->renderer->searchAndRenderBlock($view, 'enctype');
|
||||
// Kept empty for 2.7 compatibility
|
||||
}
|
||||
|
||||
protected function renderLabel(FormView $view, $label = null, array $vars = array())
|
||||
@ -204,4 +197,14 @@ class FormExtensionDivLayoutTest extends AbstractDivLayoutTest
|
||||
array(array('parent_label.html.twig'), array('child_label.html.twig')),
|
||||
);
|
||||
}
|
||||
|
||||
public function testEnctype()
|
||||
{
|
||||
$this->markTestSkipped('This test is skipped to keep 2.7 compatibility.');
|
||||
}
|
||||
|
||||
public function testNoEnctype()
|
||||
{
|
||||
$this->markTestSkipped('This test is skipped to keep 2.7 compatibility.');
|
||||
}
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ class FormExtensionTableLayoutTest extends AbstractTableLayoutTest
|
||||
|
||||
protected function renderEnctype(FormView $view)
|
||||
{
|
||||
return (string) $this->extension->renderer->searchAndRenderBlock($view, 'enctype');
|
||||
// Kept empty for 2.7 compatibility
|
||||
}
|
||||
|
||||
protected function renderLabel(FormView $view, $label = null, array $vars = array())
|
||||
@ -112,4 +112,14 @@ class FormExtensionTableLayoutTest extends AbstractTableLayoutTest
|
||||
{
|
||||
$this->extension->renderer->setTheme($view, $themes);
|
||||
}
|
||||
|
||||
public function testEnctype()
|
||||
{
|
||||
$this->markTestSkipped('This test is skipped to keep 2.7 compatibility.');
|
||||
}
|
||||
|
||||
public function testNoEnctype()
|
||||
{
|
||||
$this->markTestSkipped('This test is skipped to keep 2.7 compatibility.');
|
||||
}
|
||||
}
|
||||
|
@ -120,27 +120,6 @@ class FormHelper extends Helper
|
||||
return $this->renderer->renderBlock($view, 'form_end', $variables);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the HTML enctype in the form tag, if necessary.
|
||||
*
|
||||
* Example usage templates:
|
||||
*
|
||||
* <form action="..." method="post" <?php echo $view['form']->enctype($form) ?>>
|
||||
*
|
||||
* @param FormView $view The view for which to render the encoding type
|
||||
*
|
||||
* @return string The HTML markup
|
||||
*
|
||||
* @deprecated Deprecated since version 2.3, to be removed in 3.0. Use
|
||||
* {@link start} instead.
|
||||
*/
|
||||
public function enctype(FormView $view)
|
||||
{
|
||||
trigger_error('The form helper $view[\'form\']->enctype() is deprecated since version 2.3 and will be removed in 3.0. Use $view[\'form\']->start() instead.', E_USER_DEPRECATED);
|
||||
|
||||
return $this->renderer->searchAndRenderBlock($view, 'enctype');
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the HTML for a given view.
|
||||
*
|
||||
|
@ -57,16 +57,16 @@ class FormHelperDivLayoutTest extends AbstractDivLayoutTest
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
protected function renderEnctype(FormView $view)
|
||||
{
|
||||
// Kept empty for 2.7 compatibility
|
||||
}
|
||||
|
||||
protected function renderForm(FormView $view, array $vars = array())
|
||||
{
|
||||
return (string) $this->engine->get('form')->form($view, $vars);
|
||||
}
|
||||
|
||||
protected function renderEnctype(FormView $view)
|
||||
{
|
||||
return (string) $this->engine->get('form')->enctype($view);
|
||||
}
|
||||
|
||||
protected function renderLabel(FormView $view, $label = null, array $vars = array())
|
||||
{
|
||||
return (string) $this->engine->get('form')->label($view, $label, $vars);
|
||||
@ -120,4 +120,14 @@ class FormHelperDivLayoutTest extends AbstractDivLayoutTest
|
||||
array(array('TestBundle:Parent'), array('TestBundle:Child')),
|
||||
);
|
||||
}
|
||||
|
||||
public function testEnctype()
|
||||
{
|
||||
$this->markTestSkipped('This test is skipped to keep 2.7 compatibility.');
|
||||
}
|
||||
|
||||
public function testNoEnctype()
|
||||
{
|
||||
$this->markTestSkipped('This test is skipped to keep 2.7 compatibility.');
|
||||
}
|
||||
}
|
||||
|
@ -58,16 +58,16 @@ class FormHelperTableLayoutTest extends AbstractTableLayoutTest
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
protected function renderEnctype(FormView $view)
|
||||
{
|
||||
// Kept empty for 2.7 compatibility
|
||||
}
|
||||
|
||||
protected function renderForm(FormView $view, array $vars = array())
|
||||
{
|
||||
return (string) $this->engine->get('form')->form($view, $vars);
|
||||
}
|
||||
|
||||
protected function renderEnctype(FormView $view)
|
||||
{
|
||||
return (string) $this->engine->get('form')->enctype($view);
|
||||
}
|
||||
|
||||
protected function renderLabel(FormView $view, $label = null, array $vars = array())
|
||||
{
|
||||
return (string) $this->engine->get('form')->label($view, $label, $vars);
|
||||
@ -107,4 +107,14 @@ class FormHelperTableLayoutTest extends AbstractTableLayoutTest
|
||||
{
|
||||
$this->engine->get('form')->setTheme($view, $themes);
|
||||
}
|
||||
|
||||
public function testEnctype()
|
||||
{
|
||||
$this->markTestSkipped('This test is skipped to keep 2.7 compatibility.');
|
||||
}
|
||||
|
||||
public function testNoEnctype()
|
||||
{
|
||||
$this->markTestSkipped('This test is skipped to keep 2.7 compatibility.');
|
||||
}
|
||||
}
|
||||
|
@ -101,8 +101,6 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
|
||||
|
||||
abstract protected function renderForm(FormView $view, array $vars = array());
|
||||
|
||||
abstract protected function renderEnctype(FormView $view);
|
||||
|
||||
abstract protected function renderLabel(FormView $view, $label = null, array $vars = array());
|
||||
|
||||
abstract protected function renderErrors(FormView $view);
|
||||
@ -119,24 +117,6 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
|
||||
|
||||
abstract protected function setTheme(FormView $view, array $themes);
|
||||
|
||||
public function testEnctype()
|
||||
{
|
||||
$form = $this->factory->createNamedBuilder('name', 'form')
|
||||
->add('file', 'file')
|
||||
->getForm();
|
||||
|
||||
$this->assertEquals('enctype="multipart/form-data"', $this->renderEnctype($form->createView()));
|
||||
}
|
||||
|
||||
public function testNoEnctype()
|
||||
{
|
||||
$form = $this->factory->createNamedBuilder('name', 'form')
|
||||
->add('text', 'text')
|
||||
->getForm();
|
||||
|
||||
$this->assertEquals('', $this->renderEnctype($form->createView()));
|
||||
}
|
||||
|
||||
public function testLabel()
|
||||
{
|
||||
$form = $this->factory->createNamed('name', 'text');
|
||||
|
Reference in New Issue
Block a user