mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
Allow sf2.3, fix scope issue
This commit is contained in:
parent
867f82d97d
commit
255d42830d
@ -180,7 +180,7 @@ class ApiDocExtractor
|
||||
$method = $matches[2];
|
||||
if ($this->container->has($controller)) {
|
||||
$this->container->enterScope('request');
|
||||
$this->container->set('request', new Request());
|
||||
$this->container->set('request', new Request(), 'request');
|
||||
$class = get_class($this->container->get($controller));
|
||||
$this->container->leaveScope('request');
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ namespace Nelmio\ApiDocBundle\Tests;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase as BaseWebTestCase;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
use Symfony\Component\HttpKernel\Kernel;
|
||||
use Symfony\Component\DependencyInjection\Scope;
|
||||
|
||||
abstract class WebTestCase extends BaseWebTestCase
|
||||
{
|
||||
@ -43,7 +44,14 @@ abstract class WebTestCase extends BaseWebTestCase
|
||||
}
|
||||
static::$kernel->boot();
|
||||
|
||||
return static::$kernel->getContainer();
|
||||
$container = static::$kernel->getContainer();
|
||||
|
||||
// add request scope if not created (for forward compat with sf2.3)
|
||||
if (!$container->hasScope('request')) {
|
||||
$container->addScope(new Scope('request'));
|
||||
}
|
||||
|
||||
return $container;
|
||||
}
|
||||
|
||||
protected static function getKernelClass()
|
||||
|
@ -15,7 +15,7 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"symfony/framework-bundle": "~2.1,<2.3-dev",
|
||||
"symfony/framework-bundle": "~2.1",
|
||||
"symfony/twig-bundle": "~2.1",
|
||||
"symfony/form": "~2.1",
|
||||
"dflydev/markdown": "1.0.*"
|
||||
@ -28,9 +28,9 @@
|
||||
"symfony/browser-kit": "~2.1",
|
||||
"symfony/validator": "~2.1",
|
||||
"symfony/yaml": "~2.1",
|
||||
"friendsofsymfony/rest-bundle": "dev-master",
|
||||
"friendsofsymfony/rest-bundle": "0.12.*@dev",
|
||||
"jms/serializer-bundle": ">=0.11",
|
||||
"sensio/framework-extra-bundle": "dev-master"
|
||||
"sensio/framework-extra-bundle": "~2.1"
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"autoload": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user