File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed
DependencyInjection/Compiler
Tests/DependencyInjection/Compiler Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,10 @@ class ProviderPass implements CompilerPassInterface
2727 */
2828 public function process (ContainerBuilder $ container )
2929 {
30+ if (!$ container ->hasDefinition ('florianv_swap.swap ' )) {
31+ return ;
32+ }
33+
3034 $ definition = $ container ->getDefinition ('florianv_swap.swap ' );
3135
3236 foreach ($ container ->findTaggedServiceIds ('florianv_swap.provider ' ) as $ id => $ attributes ) {
Original file line number Diff line number Diff line change @@ -21,6 +21,13 @@ public function testProvidersAreAdded()
2121 $ swapDefinition = $ this ->getMock ('Symfony\Component\DependencyInjection\Definition ' );
2222 $ containerBuilder = $ this ->getMock ('Symfony\Component\DependencyInjection\ContainerBuilder ' );
2323
24+ $ containerBuilder
25+ ->expects ($ this ->once ())
26+ ->method ('hasDefinition ' )
27+ ->with ('florianv_swap.swap ' )
28+ ->will ($ this ->returnValue (true ))
29+ ;
30+
2431 $ containerBuilder
2532 ->expects ($ this ->once ())
2633 ->method ('getDefinition ' )
Original file line number Diff line number Diff line change 1616 "symfony/framework-bundle" : " ~2.2" ,
1717 "florianv/swap" : " ~1.0"
1818 },
19+ "require-dev" : {
20+ "symfony/expression-language" : " ~2.4"
21+ },
1922 "autoload" : {
2023 "psr-0" : {
2124 "Florianv\\ SwapBundle" : " "
You can’t perform that action at this time.
0 commit comments