@@ -30,21 +30,6 @@ public function testPushProperlyPushesJobOntoIronWithoutEncryption()
3030 $ queue ->push ('foo ' , [1 , 2 , 3 ]);
3131 }
3232
33- public function testPushProperlyPushesJobOntoIronWithClosures ()
34- {
35- $ queue = new Collective \IronQueue \IronQueue ($ iron = m::mock ('IronMQ\IronMQ ' ), m::mock ('Illuminate\Http\Request ' ), 'default ' , true );
36- $ crypt = m::mock ('Illuminate\Contracts\Encryption\Encrypter ' );
37- $ queue ->setEncrypter ($ crypt );
38- $ name = 'Foo ' ;
39- $ closure = (new Serializer ())->serialize ($ innerClosure = function () use ($ name ) { return $ name ; });
40- $ crypt ->shouldReceive ('encrypt ' )->once ()->with ($ closure )->andReturn ('serial_closure ' );
41- $ crypt ->shouldReceive ('encrypt ' )->once ()->with (json_encode ([
42- 'job ' => 'IlluminateQueueClosure ' , 'data ' => ['closure ' => 'serial_closure ' ], 'attempts ' => 1 , 'queue ' => 'default ' ,
43- ]))->andReturn ('encrypted ' );
44- $ iron ->shouldReceive ('postMessage ' )->once ()->with ('default ' , 'encrypted ' , [])->andReturn ((object ) ['id ' => 1 ]);
45- $ queue ->push ($ innerClosure );
46- }
47-
4833 public function testDelayedPushProperlyPushesJobOntoIron ()
4934 {
5035 $ queue = new Collective \IronQueue \IronQueue ($ iron = m::mock ('IronMQ\IronMQ ' ), m::mock ('Illuminate\Http\Request ' ), 'default ' , true );
@@ -60,7 +45,7 @@ public function testDelayedPushProperlyPushesJobOntoIron()
6045 public function testDelayedPushProperlyPushesJobOntoIronWithTimestamp ()
6146 {
6247 $ now = Carbon \Carbon::now ();
63- $ queue = $ this ->getMock ('Collective\IronQueue\IronQueue ' , ['getTime ' ], [$ iron = m::mock ('IronMQ\IronMQ ' ), m::mock ('Illuminate\Http\Request ' ), 'default ' , true ]);
48+ $ queue = $ this ->getMockBuilder ('Collective\IronQueue\IronQueue ' )-> setMethods ( ['getTime ' ])-> setConstructorArgs ( [$ iron = m::mock ('IronMQ\IronMQ ' ), m::mock ('Illuminate\Http\Request ' ), 'default ' , true ])-> getMock ( );
6449 $ crypt = m::mock ('Illuminate\Contracts\Encryption\Encrypter ' );
6550 $ queue ->setEncrypter ($ crypt );
6651 $ queue ->expects ($ this ->once ())->method ('getTime ' )->will ($ this ->returnValue ($ now ->getTimestamp ()));
@@ -124,7 +109,7 @@ public function testDeleteJobWithExpiredReservationIdThrowsAnException()
124109
125110 public function testPushedJobsCanBeMarshaled ()
126111 {
127- $ queue = $ this ->getMock ('Collective\IronQueue\IronQueue ' , ['createPushedIronJob ' ], [$ iron = m::mock ('IronMQ\IronMQ ' ), $ request = m::mock ('Illuminate\Http\Request ' ), 'default ' , true ]);
112+ $ queue = $ this ->getMockBuilder ('Collective\IronQueue\IronQueue ' )-> setMethods ( ['createPushedIronJob ' ])-> setConstructorArgs ( [$ iron = m::mock ('IronMQ\IronMQ ' ), $ request = m::mock ('Illuminate\Http\Request ' ), 'default ' , true ])-> getMock ( );
128113 $ crypt = m::mock ('Illuminate\Contracts\Encryption\Encrypter ' );
129114 $ queue ->setEncrypter ($ crypt );
130115 $ request ->shouldReceive ('header ' )->once ()->with ('iron-message-id ' )->andReturn ('message-id ' );
0 commit comments