File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler
Component/DependencyInjection Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 12
12
namespace Symfony \Bundle \FrameworkBundle \Tests \DependencyInjection \Compiler ;
13
13
14
14
use Symfony \Bundle \FrameworkBundle \DependencyInjection \Compiler \UnusedTagsPass ;
15
+ use Symfony \Component \DependencyInjection \ContainerBuilder ;
16
+ use Symfony \Component \DependencyInjection \Definition ;
15
17
16
18
class UnusedTagsPassTest extends \PHPUnit_Framework_TestCase
17
19
{
@@ -49,4 +51,15 @@ public function testProcess()
49
51
50
52
$ pass ->process ($ container );
51
53
}
54
+
55
+ public function testEmptyTagNameIsIgnored ()
56
+ {
57
+ $ pass = new UnusedTagsPass ();
58
+ $ container = new ContainerBuilder ();
59
+
60
+ $ definition = $ container ->register ('foo ' );
61
+ $ definition ->addTag ('' , array ('bar ' => 'baz ' ));
62
+
63
+ $ pass ->process ($ container );
64
+ }
52
65
}
Original file line number Diff line number Diff line change @@ -1040,7 +1040,7 @@ public function findTags()
1040
1040
*/
1041
1041
public function findUnusedTags ()
1042
1042
{
1043
- return array_values (array_diff ($ this ->findTags (), $ this ->usedTags ));
1043
+ return array_filter ( array_values (array_diff ($ this ->findTags (), $ this ->usedTags ) ));
1044
1044
}
1045
1045
1046
1046
public function addExpressionLanguageProvider (ExpressionFunctionProviderInterface $ provider )
You can’t perform that action at this time.
0 commit comments