File tree 6 files changed +29
-23
lines changed
Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler 6 files changed +29
-23
lines changed Original file line number Diff line number Diff line change 15
15
use Symfony \Component \Console \Command \Command ;
16
16
use Symfony \Component \DependencyInjection \ContainerBuilder ;
17
17
use Symfony \Component \DependencyInjection \Definition ;
18
+ use Symfony \Component \HttpKernel \Bundle \Bundle ;
18
19
19
20
class AddConsoleCommandPassTest extends \PHPUnit_Framework_TestCase
20
21
{
@@ -87,8 +88,32 @@ public function testProcessThrowAnExceptionIfTheServiceIsNotASubclassOfCommand()
87
88
88
89
$ container ->compile ();
89
90
}
91
+
92
+ public function testHttpKernelRegisterCommandsIngoreCommandAsAService ()
93
+ {
94
+ $ container = new ContainerBuilder ();
95
+ $ container ->addCompilerPass (new AddConsoleCommandPass ());
96
+ $ definition = new Definition ('Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler\MyCommand ' );
97
+ $ definition ->addTag ('console.command ' );
98
+ $ container ->setDefinition ('my-command ' , $ definition );
99
+ $ container ->compile ();
100
+
101
+ $ application = $ this ->getMock ('Symfony\Component\Console\Application ' );
102
+ // Never called, because it's the
103
+ // Symfony\Bundle\FrameworkBundle\Console\Application that register
104
+ // commands as a service
105
+ $ application ->expects ($ this ->never ())->method ('add ' );
106
+
107
+ $ bundle = new ExtensionPresentBundle ();
108
+ $ bundle ->setContainer ($ container );
109
+ $ bundle ->registerCommands ($ application );
110
+ }
90
111
}
91
112
92
113
class MyCommand extends Command
93
114
{
94
115
}
116
+
117
+ class ExtensionPresentBundle extends Bundle
118
+ {
119
+ }
Original file line number Diff line number Diff line change 23
23
"symfony/property-access" : " ~2.3"
24
24
},
25
25
"require-dev" : {
26
- "symfony/validator" : " ~2.4" ,
26
+ "symfony/validator" : " ~2.4,<2.5.0 " ,
27
27
"symfony/http-foundation" : " ~2.2" ,
28
28
"symfony/http-kernel" : " ~2.4" ,
29
29
"symfony/security-csrf" : " ~2.4" ,
Original file line number Diff line number Diff line change @@ -34,24 +34,4 @@ public function testRegisterCommands()
34
34
35
35
$ this ->assertNull ($ bundle2 ->registerCommands ($ app ));
36
36
}
37
-
38
- public function testRegisterCommandsIngoreCommandAsAService ()
39
- {
40
- $ container = new ContainerBuilder ();
41
- $ container ->addCompilerPass (new AddConsoleCommandPass ());
42
- $ definition = new Definition ('Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionPresentBundle\Command\FooCommand ' );
43
- $ definition ->addTag ('console.command ' );
44
- $ container ->setDefinition ('my-command ' , $ definition );
45
- $ container ->compile ();
46
-
47
8000
- $ application = $ this ->getMock ('Symfony\Component\Console\Application ' );
48
- // Never called, because it's the
49
- // Symfony\Bundle\FrameworkBundle\Console\Application that register
50
- // commands as a service
51
- $ application ->expects ($ this ->never ())->method ('add ' );
52
-
53
- $ bundle = new ExtensionPresentBundle ();
54
- $ bundle ->setContainer ($ container );
55
- $ bundle ->registerCommands ($ application );
56
- }
57
37
}
Original file line number Diff line number Diff line change 22
22
"symfony/event-dispatcher" : " ~2.1" ,
23
23
"symfony/expression-language" : " ~2.4" ,
24
24
"symfony/http-foundation" : " ~2.4" ,
25
- "symfony/validator" : " ~2.2" ,
25
+ "symfony/validator" : " ~2.2,<2.5.0 " ,
26
26
"psr/log" : " ~1.0" ,
27
27
"ircmaxell/password-compat" : " 1.0.*"
28
28
},
Original file line number Diff line number Diff line change 29
29
},
30
30
"require-dev" : {
31
31
"symfony/routing" : " ~2.2" ,
32
- "symfony/validator" : " ~2.2" ,
32
+ "symfony/validator" : " ~2.2,<2.5.0 " ,
33
33
"doctrine/common" : " ~2.2" ,
34
34
"doctrine/dbal" : " ~2.2" ,
35
35
"psr/log" : " ~1.0" ,
Original file line number Diff line number Diff line change 25
25
"symfony/intl" : " ~2.3" ,
26
26
"symfony/yaml" : " ~2.0" ,
27
27
"symfony/config" : " ~2.2" ,
28
+ "symfony/expression-language" : " ~2.4" ,
28
29
"doctrine/annotations" : " ~1.0" ,
29
30
"doctrine/cache" : " ~1.0"
30
31
},
You can’t perform that action at this time.
0 commit comments