-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'fix_controller_resolver_injection' of git://github.com/…
…podhy/Symplify into podhy-fix_controller_resolver_injection
- Loading branch information
Showing
2 changed files
with
40 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
tests/DependencyInjection/Compiler/DecorateControllerResolverPassTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace Symplify\ControllerAutowire\tests\DependencyInjection\Compiler; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symplify\ControllerAutowire\DependencyInjection\Compiler\DecorateControllerResolverPass; | ||
use Symplify\ControllerAutowire\DependencyInjection\ControllerClassMap; | ||
|
||
class DecorateControllerResolverPassTest extends TestCase | ||
{ | ||
/** | ||
* @var ControllerClassMap | ||
*/ | ||
private $controllerClassMap; | ||
|
||
protected function setUp() | ||
{ | ||
$this->controllerClassMap = new ControllerClassMap(); | ||
} | ||
|
||
public function testInjectionOfOldDecoratedService() | ||
{ | ||
$containerBuilder = new ContainerBuilder(); | ||
|
||
$resolver = new DecorateControllerResolverPass($this->controllerClassMap); | ||
$resolver->process($containerBuilder); | ||
|
||
$definition = $containerBuilder->getDefinition('symplify.controller_resolver'); | ||
$this->assertSame('symplify.controller_resolver.inner', (string) $definition->getArgument(0)); | ||
} | ||
} |