@@ -16,47 +16,41 @@ public function tearDown()
16
16
17
17
public function testDefaultConnectionCanBeResolved ()
18
18
{
19
- $ config = new Repository ([
20
- 'queue.default ' => 'sync ' ,
21
- 'queue.connections.sync ' => ['driver ' => 'sync ' ],
22
- ]);
23
-
24
19
$ app = [
25
- 'config ' => $ config ,
20
+ 'config ' => [
21
+ 'queue.default ' => 'sync ' ,
22
+ 'queue.connections.sync ' => ['driver ' => 'sync ' ],
23
+ ],
26
24
'encrypter ' => $ encrypter = m::mock ('Illuminate\Contracts\Encryption\Encrypter ' ),
27
25
];
28
26
29
27
$ manager = new QueueManager ($ app );
30
28
$ connector = m::mock ('StdClass ' );
31
29
$ queue = m::mock ('StdClass ' );
32
30
$ queue ->shouldReceive ('setConnectionName ' )->once ()->with ('sync ' )->andReturnSelf ();
33
- $ queue ->shouldReceive ('setQueuePrefix ' )->once ()->with ('' )->andReturnSelf ();
34
31
$ connector ->shouldReceive ('connect ' )->once ()->with (['driver ' => 'sync ' ])->andReturn ($ queue );
35
32
$ manager ->addConnector ('sync ' , function () use ($ connector ) {
36
33
return $ connector ;
37
34
});
38
- $ queue ->shouldReceive ('setContainer ' )->once ()->with ($ app );
39
35
36
+ $ queue ->shouldReceive ('setContainer ' )->once ()->with ($ app );
40
37
$ this ->assertSame ($ queue , $ manager ->connection ('sync ' ));
41
38
}
42
39
43
40
public function testOtherConnectionCanBeResolved ()
44
41
{
45
- $ config = new Repository ([
46
- 'queue.default ' => 'sync ' ,
47
- 'queue.connections.foo ' => ['driver ' => 'bar ' ],
48
- ]);
49
-
50
42
$ app = [
51
- 'config ' => $ config ,
43
+ 'config ' => [
44
+ 'queue.default ' => 'sync ' ,
45
+ 'queue.connections.foo ' => ['driver ' => 'bar ' ],
46
+ ],
52
47
'encrypter ' => $ encrypter = m::mock ('Illuminate\Contracts\Encryption\Encrypter ' ),
53
48
];
54
49
55
50
$ manager = new QueueManager ($ app );
56
51
$ connector = m::mock ('StdClass ' );
57
52
$ queue = m::mock ('StdClass ' );
58
53
$ queue ->shouldReceive ('setConnectionName ' )->once ()->with ('foo ' )->andReturnSelf ();
59
- $ queue ->shouldReceive ('setQueuePrefix ' )->once ()->with ('' )->andReturnSelf ();
60
54
$ connector ->shouldReceive ('connect ' )->once ()->with (['driver ' => 'bar ' ])->andReturn ($ queue );
61
55
$ manager ->addConnector ('bar ' , function () use ($ connector ) {
62
56
return $ connector ;
@@ -68,20 +62,17 @@ public function testOtherConnectionCanBeResolved()
68
62
69
63
public function testNullConnectionCanBeResolved ()
70
64
{
71
- $ config = new Repository ([
72
- 'queue.default ' => 'null ' ,
73
- ]);
74
-
75
65
$ app = [
76
- 'config ' => $ config ,
66
+ 'config ' => [
67
+ 'queue.default ' => 'null ' ,
68
+ ],
77
69
'encrypter ' => $ encrypter = m::mock ('Illuminate\Contracts\Encryption\Encrypter ' ),
78
70
];
79
71
80
72
$ manager = new QueueManager ($ app );
81
73
$ connector = m::mock ('StdClass ' );
82
74
$ queue = m::mock ('StdClass ' );
83
75
$ queue ->shouldReceive ('setConnectionName ' )->once ()->with ('null ' )->andReturnSelf ();
84
- $ queue ->shouldReceive ('setQueuePrefix ' )->once ()->with ('' )->andReturnSelf ();
85
76
$ connector ->shouldReceive ('connect ' )->once ()->with (['driver ' => 'null ' ])->andReturn ($ queue );
86
77
$ manager ->addConnector ('null ' , function () use ($ connector ) {
87
78
return $ connector ;
0 commit comments