merged branch stof/form_cleanup (PR #3931)
Commits -------538819a
[Form] Fixed the tests9e956a8
[Form] Cleaned the FormValidatorInterface deprecation Discussion ---------- [Form] Cleaned the FormValidatorInterface deprecation This fixes my feedback on #3797 [![Build Status](https://secure.travis-ci.org/stof/symfony.png?branch=form_cleanup)](http://travis-ci.org/stof/symfony)
This commit is contained in:
commit
d9fa1b94ae
@ -77,7 +77,7 @@ class Form implements \IteratorAggregate, FormInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The mapper for mapping data to children and back
|
* The mapper for mapping data to children and back
|
||||||
* @var DataMapper\DataMapperInterface
|
* @var DataMapperInterface
|
||||||
*/
|
*/
|
||||||
private $dataMapper;
|
private $dataMapper;
|
||||||
|
|
||||||
@ -801,18 +801,6 @@ class Form implements \IteratorAggregate, FormInterface
|
|||||||
return $this->clientTransformers;
|
return $this->clientTransformers;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the Validators
|
|
||||||
*
|
|
||||||
* @return array An array of FormValidatorInterface
|
|
||||||
*
|
|
||||||
* @deprecated Deprecated since version 2.1, to be removed in 2.3.
|
|
||||||
*/
|
|
||||||
public function getValidators()
|
|
||||||
{
|
|
||||||
return $this->validators;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns all children in this group.
|
* Returns all children in this group.
|
||||||
*
|
*
|
||||||
|
@ -32,7 +32,7 @@ class DelegatingValidationListenerTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
private $delegate;
|
private $delegate;
|
||||||
|
|
||||||
private $validator;
|
private $listener;
|
||||||
|
|
||||||
private $message;
|
private $message;
|
||||||
|
|
||||||
@ -40,6 +40,10 @@ class DelegatingValidationListenerTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
protected function setUp()
|
protected function setUp()
|
||||||
{
|
{
|
||||||
|
if (!class_exists('Symfony\Component\EventDispatcher\Event')) {
|
||||||
|
$this->markTestSkipped('The "EventDispatcher" component is not available');
|
||||||
|
}
|
||||||
|
|
||||||
$this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
|
$this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
|
||||||
$this->factory = $this->getMock('Symfony\Component\Form\FormFactoryInterface');
|
$this->factory = $this->getMock('Symfony\Component\Form\FormFactoryInterface');
|
||||||
$this->delegate = $this->getMock('Symfony\Component\Validator\ValidatorInterface');
|
$this->delegate = $this->getMock('Symfony\Component\Validator\ValidatorInterface');
|
||||||
|
@ -1294,16 +1294,6 @@ class FormTest extends \PHPUnit_Framework_TestCase
|
|||||||
->getForm();
|
->getForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetValidatorsReturnsValidators()
|
|
||||||
{
|
|
||||||
$validator = $this->getFormValidator();
|
|
||||||
$form = $this->getBuilder()
|
|
||||||
->addValidator($validator)
|
|
||||||
->getForm();
|
|
||||||
|
|
||||||
$this->assertEquals(array($validator), $form->getValidators());
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getBuilder($name = 'name', EventDispatcherInterface $dispatcher = null)
|
protected function getBuilder($name = 'name', EventDispatcherInterface $dispatcher = null)
|
||||||
{
|
{
|
||||||
return new FormBuilder($name, $this->factory, $dispatcher ?: $this->dispatcher);
|
return new FormBuilder($name, $this->factory, $dispatcher ?: $this->dispatcher);
|
||||||
|
Reference in New Issue
Block a user