File tree 2 files changed +21
-4
lines changed
src/Symfony/Bundle/FrameworkBundle 2 files changed +21
-4
lines changed Original file line number Diff line number Diff line change 17
17
use Symfony \Component \Console \Output \OutputInterface ;
18
18
use Symfony \Component \HttpKernel \KernelInterface ;
19
19
use Symfony \Component \HttpKernel \Kernel ;
20
- use Symfony \Component \HttpKernel \Bundle ;
21
20
22
21
/**
23
22
* Application.
Original file line number Diff line number Diff line change @@ -22,14 +22,32 @@ public function testBundleInterfaceImplementation()
22
22
{
23
23
$ bundle = $ this ->getMock ("Symfony\Component\HttpKernel\Bundle\BundleInterface " );
24
24
25
+ $ kernel = $ this ->getKernel (array ($ bundle ));
26
+
27
+ $ application = new Application ($ kernel );
28
+ $ application ->doRun (new ArrayInput (array ('list ' )), new NullOutput ());
29
+ }
30
+
31
+ public function testBundleCommandsAreRegistered ()
32
+ {
33
+ $ bundle = $ this ->getMock ("Symfony\Component\HttpKernel\Bundle\Bundle " );
34
+ $ bundle ->expects ($ this ->once ())->method ('registerCommands ' );
35
+
36
+ $ kernel = $ this ->getKernel (array ($ bundle ));
37
+
38
+ $ application = new Application ($ kernel );
39
+ $ application ->doRun (new ArrayInput (array ('list ' )), new NullOutput ());
40
+ }
41
+
42
+ private function getKernel (array $ bundles )
43
+ {
25
44
$ kernel = $ this ->getMock ("Symfony\Component\HttpKernel\KernelInterface " );
26
45
$ kernel
27
46
->expects ($ this ->any ())
28
47
->method ('getBundles ' )
29
- ->will ($ this ->returnValue (array ( $ bundle ) ))
48
+ ->will ($ this ->returnValue ($ bundles ))
30
49
;
31
50
32
- $ application = new Application ($ kernel );
33
- $ application ->doRun (new ArrayInput (array ('list ' )), new NullOutput ());
51
+ return $ kernel ;
34
52
}
35
53
}
You can’t perform that action at this time.
0 commit comments