Skip to content

Commit

Permalink
[Form] [FrameworkBundle] catch deprecation errors in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
colinfrei committed Dec 14, 2012
1 parent c21b12e commit ebcb432
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
Expand Up @@ -68,6 +68,8 @@ protected function getExtensions()
protected function tearDown()
{
$this->engine = null;

parent::tearDown();
}

protected function renderEnctype(FormView $view)
Expand Down
Expand Up @@ -69,6 +69,8 @@ protected function getExtensions()
protected function tearDown()
{
$this->engine = null;

parent::tearDown();
}

protected function renderEnctype(FormView $view)
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/Form/Tests/AbstractLayoutTest.php
Expand Up @@ -45,6 +45,8 @@ protected function tearDown()
{
$this->csrfProvider = null;
$this->factory = null;

parent::tearDown();
}

protected function assertXpathNodeValue(\DomElement $element, $expression, $nodeValue)
Expand Down
Expand Up @@ -33,14 +33,6 @@ protected function setUp()

$this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
$this->builder = new FormBuilder(null, null, $this->dispatcher, $this->factory);

set_error_handler(array('Symfony\Component\Form\Tests\DeprecationErrorHandler', 'handle'));

}

protected function tearDown()
{
restore_error_handler();
}

public static function assertDateTimeEquals(\DateTime $expected, \DateTime $actual)
Expand Down
7 changes: 7 additions & 0 deletions src/Symfony/Component/Form/Tests/FormIntegrationTestCase.php
Expand Up @@ -32,6 +32,13 @@ protected function setUp()
$this->factory = Forms::createFormFactoryBuilder()
->addExtensions($this->getExtensions())
->getFormFactory();

set_error_handler(array('Symfony\Component\Form\Tests\DeprecationErrorHandler', 'handle'));
}

protected function tearDown()
{
restore_error_handler();
}

protected function getExtensions()
Expand Down

0 comments on commit ebcb432

Please sign in to comment.