@@ -40,11 +40,10 @@ public function testJobCanBeQueued()
40
40
$ this ->assertTrue ((bool )Resque::enqueue ('jobs ' , 'Test_Job ' ));
41
41
}
42
42
43
- /**
44
- * @expectedException \Resque\Exceptions\RedisException
45
- */
46
43
public function testRedisErrorThrowsExceptionOnJobCreation ()
47
44
{
45
+ $ this ->expectException ('\Resque\Exceptions\RedisException ' );
46
+
48
47
$ mockCredis = $ this ->getMockBuilder ('Credis_Client ' )
49
48
->setMethods (['connect ' , '__call ' ])
50
49
->getMock ();
@@ -69,11 +68,10 @@ public function testQeueuedJobCanBeReserved()
69
68
$ this ->assertEquals ('Test_Job ' , $ job ->payload ['class ' ]);
70
69
}
71
70
72
- /**
73
- * @expectedException InvalidArgumentException
74
- */
75
71
public function testObjectArgumentsCannotBePassedToJob ()
76
72
{
73
+ $ this ->expectException ('InvalidArgumentException ' );
74
+
77
75
$ args = new stdClass ();
78
76
$ args ->test = 'somevalue ' ;
79
77
Resque::enqueue ('jobs ' , 'Test_Job ' , $ args );
@@ -146,22 +144,20 @@ public function testFailedJobExceptionsAreCaught()
146
144
$ this ->assertEquals (1 , Stat::get ('failed: ' .$ this ->worker ));
147
145
}
148
146
149
- /**
150
- * @expectedException \Resque\Exceptions\ResqueException
151
- */
152
147
public function testJobWithoutPerformMethodThrowsException ()
153
148
{
149
+ $ this ->expectException ('\Resque\Exceptions\ResqueException ' );
150
+
154
151
Resque::enqueue ('jobs ' , 'Test_Job_Without_Perform_Method ' );
155
152
$ job = $ this ->worker ->reserve ();
156
153
$ job ->worker = $ this ->worker ;
157
154
$ job ->perform ();
158
155
}
159
156
160
- /**
161
- * @expectedException Resque\Exceptions\ResqueException
162
- */
163
157
public function testInvalidJobThrowsException ()
164
158
{
159
+ $ this ->expectException ('Resque\Exceptions\ResqueException ' );
160
+
165
161
Resque::enqueue ('jobs ' , 'Invalid_Job ' );
166
162
$ job = $ this ->worker ->reserve ();
167
163
$ job ->worker = $ this ->worker ;
@@ -363,7 +359,7 @@ public function testDequeueSeveralItemsWithArgs()
363
359
$ this ->assertEquals ($ removedItems , 2 );
364
360
$ this ->assertEquals (Resque::size ($ queue ), 1 );
365
361
$ item = Resque::pop ($ queue );
366
- $ this ->assertInternalType ( ' array ' , $ item ['args ' ]);
362
+ $ this ->assertIsArray ( $ item ['args ' ]);
367
363
$ this ->assertEquals (10 , $ item ['args ' ][0 ]['bar ' ], 'Wrong items were dequeued from queue! ' );
368
364
}
369
365
0 commit comments