Skip to content

Commit b7e9fb6

Browse files
committed
[SecurityBundle] Add AutowiringTypesTest
1 parent 2c84f77 commit b7e9fb6

File tree

5 files changed

+3
-38
lines changed

5 files changed

+3
-38
lines changed

Tests/Functional/AutowiringTypesTest.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
use Doctrine\Common\Annotations\AnnotationReader;
1515
use Doctrine\Common\Annotations\CachedReader;
1616
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
17-
use Symfony\Component\Security\Core\Authorization\AccessDecisionManager;
18-
use Symfony\Component\Security\Core\Authorization\TraceableAccessDecisionManager;
1917
use Symfony\Component\Templating\EngineInterface as ComponentEngineInterface;
2018
use Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher;
2119
use Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher;
@@ -66,21 +64,6 @@ public function testEventDispatcherAutowiring()
6664
$this->assertInstanceOf(TraceableEventDispatcher::class, $autowiredServices->getDispatcher(), 'The debug.event_dispatcher service should be injected if the debug is enabled');
6765
}
6866

69-
public function testAccessDecisionManagerAutowiring()
70-
{
71-
static::bootKernel(array('debug' => false));
72-
$container = static::$kernel->getContainer();
73-
74-
$autowiredServices = $container->get('test.autowiring_types.autowired_services');
75-
$this->assertInstanceOf(AccessDecisionManager::class, $autowiredServices->getAccessDecisionManager(), 'The security.access.decision_manager service should be injected in debug mode');
76-
77-
static::bootKernel(array('debug' => true));
78-
$container = static::$kernel->getContainer();
79-
80-
$autowiredServices = $container->get('test.autowiring_types.autowired_services');
81-
$this->assertInstanceOf(TraceableAccessDecisionManager::class, $autowiredServices->getAccessDecisionManager(), 'The debug.security.access.decision_manager service should be injected in non-debug mode');
82-
}
83-
8467
public function testCacheAutowiring()
8568
{
8669
static::bootKernel();

Tests/Functional/Bundle/TestBundle/AutowiringTypes/AutowiredServices.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Doctrine\Common\Annotations\Reader;
1515
use Psr\Cache\CacheItemPoolInterface;
1616
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface as FrameworkBundleEngineInterface;
17-
use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
1817
use Symfony\Component\Templating\EngineInterface;
1918
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
2019

@@ -24,16 +23,14 @@ class AutowiredServices
2423
private $frameworkBundleEngine;
2524
private $engine;
2625
private $dispatcher;
27-
private $accessDecisionManager;
2826
private $cachePool;
2927

30-
public function __construct(Reader $annotationReader = null, FrameworkBundleEngineInterface $frameworkBundleEngine, EngineInterface $engine, EventDispatcherInterface $dispatcher, AccessDecisionManagerInterface $accessDecisionManager, CacheItemPoolInterface $cachePool)
28+
public function __construct(Reader $annotationReader = null, FrameworkBundleEngineInterface $frameworkBundleEngine, EngineInterface $engine, EventDispatcherInterface $dispatcher, CacheItemPoolInterface $cachePool)
3129
{
3230
$this->annotationReader = $annotationReader;
3331
$this->frameworkBundleEngine = $frameworkBundleEngine;
3432
$this->engine = $engine;
3533
$this->dispatcher = $dispatcher;
36-
$this->accessDecisionManager = $accessDecisionManager;
3734
$this->cachePool = $cachePool;
3835
}
3936

@@ -57,11 +54,6 @@ public function getDispatcher()
5754
return $this->dispatcher;
5855
}
5956

60-
public function getAccessDecisionManager()
61-
{
62-
return $this->accessDecisionManager;
63-
}
64-
6557
public function getCachePool()
6658
{
6759
return $this->cachePool;

Tests/Functional/app/AutowiringTypes/bundles.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111

1212
use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle;
1313
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
14-
use Symfony\Bundle\SecurityBundle\SecurityBundle;
1514

1615
return array(
1716
new FrameworkBundle(),
18-
new SecurityBundle(),
1917
new TestBundle(),
2018
);

Tests/Functional/app/AutowiringTypes/config.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,3 @@ services:
88
framework:
99
templating:
1010
engines: ['php']
11-
security:
12-
providers:
13-
dummy:
14-
memory: ~
15-
firewalls:
16-
dummy:
17-
security: false

composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"symfony/css-selector": "~2.8|~3.0",
4141
"symfony/dom-crawler": "~2.8|~3.0",
4242
"symfony/polyfill-intl-icu": "~1.0",
43-
"symfony/security": "~3.3",
43+
"symfony/security": "~2.8|~3.0",
4444
"symfony/form": "~2.8.16|~3.1.9|^3.2.2",
4545
"symfony/expression-language": "~2.8|~3.0",
4646
"symfony/process": "~2.8|~3.0",
@@ -55,8 +55,7 @@
5555
"doctrine/annotations": "~1.0",
5656
"phpdocumentor/reflection-docblock": "^3.0",
5757
"twig/twig": "~1.26|~2.0",
58-
"sensio/framework-extra-bundle": "^3.0.2",
59-
"symfony/security-bundle": "~3.3"
58+
"sensio/framework-extra-bundle": "^3.0.2"
6059
},
6160
"conflict": {
6261
"phpdocumentor/reflection-docblock": "<3.0",

0 commit comments

Comments
 (0)