mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-03-10 09:36:10 +03:00
Do not require sf2.2
This commit is contained in:
parent
f162311a16
commit
b3d917c9f4
@ -20,7 +20,7 @@ class ApiDocExtractorTest extends WebTestCase
|
||||
{
|
||||
$container = $this->getContainer();
|
||||
$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();
|
||||
restore_error_handler();
|
||||
|
||||
|
@ -20,7 +20,7 @@ class MarkdownFormatterTest extends WebTestCase
|
||||
$container = $this->getContainer();
|
||||
|
||||
$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();
|
||||
restore_error_handler();
|
||||
$result = $container->get('nelmio_api_doc.formatter.markdown_formatter')->format($data);
|
||||
|
@ -20,7 +20,7 @@ class SimpleFormatterTest extends WebTestCase
|
||||
$container = $this->getContainer();
|
||||
|
||||
$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();
|
||||
restore_error_handler();
|
||||
$result = $container->get('nelmio_api_doc.formatter.simple_formatter')->format($data);
|
||||
|
@ -27,6 +27,15 @@ abstract class WebTestCase extends BaseWebTestCase
|
||||
$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())
|
||||
{
|
||||
if (!static::$kernel) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user