Skip to content

Commit 9c46eed

Browse files
committed
fix Rector errors
1 parent e324ced commit 9c46eed

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

tests/DatabaseHandlerTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ public function testLater(): void
345345
'id' => 2,
346346
'status' => Status::RESERVED->value,
347347
]);
348+
$this->assertInstanceOf(QueueJob::class, $queueJob);
348349

349350
$result = $handler->later($queueJob, 60);
350351

@@ -367,6 +368,7 @@ public function testFailedAndKeepJob(): void
367368
$queueJob = $handler->pop('queue1', ['default']);
368369

369370
$err = new Exception('Sample exception');
371+
$this->assertInstanceOf(QueueJob::class, $queueJob);
370372
$result = $handler->failed($queueJob, $err, true);
371373

372374
$this->assertTrue($result);
@@ -387,6 +389,7 @@ public function testFailedAndDontKeepJob(): void
387389
$queueJob = $handler->pop('queue1', ['default']);
388390

389391
$err = new Exception('Sample exception');
392+
$this->assertInstanceOf(QueueJob::class, $queueJob);
390393
$result = $handler->failed($queueJob, $err, false);
391394

392395
$this->assertTrue($result);
@@ -407,6 +410,7 @@ public function testDone(): void
407410
{
408411
$handler = new DatabaseHandler($this->config);
409412
$queueJob = $handler->pop('queue1', ['default']);
413+
$this->assertInstanceOf(QueueJob::class, $queueJob);
410414

411415
$result = $handler->done($queueJob);
412416

@@ -477,6 +481,7 @@ public function testFlush(): void
477481
$queueJob = $handler->pop('queue1', ['default']);
478482

479483
$err = new Exception('Sample exception here');
484+
$this->assertInstanceOf(QueueJob::class, $queueJob);
480485
$result = $handler->failed($queueJob, $err, true);
481486

482487
$this->assertTrue($result);

tests/PredisHandlerTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ public function testLater(): void
264264
$predis = self::getPrivateProperty($handler, 'predis');
265265
$this->assertSame(1, $predis->hexists('queues:queue1::reserved', $queueJob->id));
266266
$this->assertSame(0, $predis->zcard('queues:queue1:default'));
267+
$this->assertInstanceOf(QueueJob::class, $queueJob);
267268

268269
$result = $handler->later($queueJob, 60);
269270

@@ -281,6 +282,7 @@ public function testFailedAndKeepJob(): void
281282
$queueJob = $handler->pop('queue1', ['default']);
282283

283284
$err = new Exception('Sample exception');
285+
$this->assertInstanceOf(QueueJob::class, $queueJob);
284286
$result = $handler->failed($queueJob, $err, true);
285287

286288
$predis = self::getPrivateProperty($handler, 'predis');
@@ -305,6 +307,7 @@ public function testFailedAndDontKeepJob(): void
305307
$queueJob = $handler->pop('queue1', ['default']);
306308

307309
$err = new Exception('Sample exception');
310+
$this->assertInstanceOf(QueueJob::class, $queueJob);
308311
$result = $handler->failed($queueJob, $err, false);
309312

310313
$predis = self::getPrivateProperty($handler, 'predis');
@@ -330,6 +333,7 @@ public function testDone(): void
330333

331334
$predis = self::getPrivateProperty($handler, 'predis');
332335
$this->assertSame(0, $predis->zcard('queues:queue1:default'));
336+
$this->assertInstanceOf(QueueJob::class, $queueJob);
333337

334338
$result = $handler->done($queueJob);
335339

tests/RedisHandlerTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ public function testLater(): void
252252
$redis = self::getPrivateProperty($handler, 'redis');
253253
$this->assertTrue($redis->hExists('queues:queue1::reserved', (string) $queueJob->id));
254254
$this->assertSame(0, $redis->zCard('queues:queue1:default'));
255+
$this->assertInstanceOf(QueueJob::class, $queueJob);
255256

256257
$result = $handler->later($queueJob, 60);
257258

@@ -266,6 +267,7 @@ public function testFailedAndKeepJob(): void
266267
$queueJob = $handler->pop('queue1', ['default']);
267268

268269
$err = new Exception('Sample exception');
270+
$this->assertInstanceOf(QueueJob::class, $queueJob);
269271
$result = $handler->failed($queueJob, $err, true);
270272

271273
$redis = self::getPrivateProperty($handler, 'redis');
@@ -287,6 +289,7 @@ public function testFailedAndDontKeepJob(): void
287289
$queueJob = $handler->pop('queue1', ['default']);
288290

289291
$err = new Exception('Sample exception');
292+
$this->assertInstanceOf(QueueJob::class, $queueJob);
290293
$result = $handler->failed($queueJob, $err, false);
291294

292295
$redis = self::getPrivateProperty($handler, 'redis');
@@ -309,6 +312,7 @@ public function testDone(): void
309312

310313
$redis = self::getPrivateProperty($handler, 'redis');
311314
$this->assertSame(0, $redis->zCard('queues:queue1:default'));
315+
$this->assertInstanceOf(QueueJob::class, $queueJob);
312316

313317
$result = $handler->done($queueJob);
314318

0 commit comments

Comments
 (0)