File tree 2 files changed +36
-0
lines changed
2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace Quartz \Bundle ;
4
4
5
+ use Quartz \Bridge \DI \QuartzJobCompilerPass ;
6
+ use Symfony \Component \DependencyInjection \ContainerBuilder ;
5
7
use Symfony \Component \HttpKernel \Bundle \Bundle ;
6
8
7
9
class QuartzBundle extends Bundle
8
10
{
11
+ public function build (ContainerBuilder $ container )
12
+ {
13
+ $ container ->addCompilerPass (new QuartzJobCompilerPass ());
14
+ }
9
15
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Quartz \Bundle \Tests ;
4
+
5
+ use PHPUnit \Framework \TestCase ;
6
+ use Quartz \Bridge \DI \QuartzJobCompilerPass ;
7
+ use Quartz \Bundle \QuartzBundle ;
8
+ use Symfony \Component \DependencyInjection \ContainerBuilder ;
9
+ use Symfony \Component \HttpKernel \Bundle \Bundle ;
10
+
11
+ class QuartzBundleTest extends TestCase
12
+ {
13
+ public function testShouldExtendBundleClass ()
14
+ {
15
+ $ this ->assertInstanceOf (Bundle::class, new QuartzBundle ());
16
+ }
17
+
18
+ public function testShouldRegisterExpectedCompilerPasses ()
19
+ {
20
+ $ container = $ this ->createMock (ContainerBuilder::class);
21
+ $ container
22
+ ->expects ($ this ->at (0 ))
23
+ ->method ('addCompilerPass ' )
24
+ ->with ($ this ->isInstanceOf (QuartzJobCompilerPass::class))
25
+ ;
26
+
27
+ $ bundle = new QuartzBundle ();
28
+ $ bundle ->build ($ container );
29
+ }
30
+ }
You can’t perform that action at this time.
0 commit comments