Do not require sf2.2

This commit is contained in:
Jordi Boggiano 2013-02-15 13:33:05 +01:00
parent f162311a16
commit b3d917c9f4
4 changed files with 12 additions and 3 deletions

View File

@ -20,7 +20,7 @@ class ApiDocExtractorTest extends WebTestCase
{ {
$container = $this->getContainer(); $container = $this->getContainer();
$extractor = $container->get('nelmio_api_doc.extractor.api_doc_extractor'); $extractor = $container->get('nelmio_api_doc.extractor.api_doc_extractor');
set_error_handler(array('Symfony\Component\Form\Test\DeprecationErrorHandler', 'handle')); set_error_handler(array($this, 'handleDeprecation'));
$data = $extractor->all(); $data = $extractor->all();
restore_error_handler(); restore_error_handler();

View File

@ -20,7 +20,7 @@ class MarkdownFormatterTest extends WebTestCase
$container = $this->getContainer(); $container = $this->getContainer();
$extractor = $container->get('nelmio_api_doc.extractor.api_doc_extractor'); $extractor = $container->get('nelmio_api_doc.extractor.api_doc_extractor');
set_error_handler(array('Symfony\Component\Form\Test\DeprecationErrorHandler', 'handle')); set_error_handler(array($this, 'handleDeprecation'));
$data = $extractor->all(); $data = $extractor->all();
restore_error_handler(); restore_error_handler();
$result = $container->get('nelmio_api_doc.formatter.markdown_formatter')->format($data); $result = $container->get('nelmio_api_doc.formatter.markdown_formatter')->format($data);

View File

@ -20,7 +20,7 @@ class SimpleFormatterTest extends WebTestCase
$container = $this->getContainer(); $container = $this->getContainer();
$extractor = $container->get('nelmio_api_doc.extractor.api_doc_extractor'); $extractor = $container->get('nelmio_api_doc.extractor.api_doc_extractor');
set_error_handler(array('Symfony\Component\Form\Test\DeprecationErrorHandler', 'handle')); set_error_handler(array($this, 'handleDeprecation'));
$data = $extractor->all(); $data = $extractor->all();
restore_error_handler(); restore_error_handler();
$result = $container->get('nelmio_api_doc.formatter.simple_formatter')->format($data); $result = $container->get('nelmio_api_doc.formatter.simple_formatter')->format($data);

View File

@ -27,6 +27,15 @@ abstract class WebTestCase extends BaseWebTestCase
$fs->remove($dir); $fs->remove($dir);
} }
public static function handleDeprecation($errorNumber, $message, $file, $line, $context)
{
if ($errorNumber & E_USER_DEPRECATED) {
return true;
}
return \PHPUnit_Util_ErrorHandler::handleError($errorNumber, $message, $file, $line);
}
protected function getContainer(array $options = array()) protected function getContainer(array $options = array())
{ {
if (!static::$kernel) { if (!static::$kernel) {