@@ -30,6 +30,7 @@ public function testRequeue (): void {
3030 QsBatch::factory ()->create (['pending_since ' => Carbon::now ()->subSeconds (200 ), 'id ' => 1 , 'done ' => 0 , 'wiki_id ' => 1 , 'entityIds ' => 'a,b ' ]);
3131 QsBatch::factory ()->create (['pending_since ' => Carbon::now ()->subSeconds (400 ), 'id ' => 2 , 'done ' => 0 , 'wiki_id ' => 1 , 'entityIds ' => 'a,b ' ]);
3232 QsBatch::factory ()->create (['processing_attempts ' => 3 , 'id ' => 3 , 'done ' => 0 , 'wiki_id ' => 1 , 'entityIds ' => 'a,b ' ]);
33+ QsBatch::factory ()->create (['failed ' => 1 , 'processing_attempts ' => 4 , 'id ' => 4 , 'done ' => 0 , 'wiki_id ' => 1 , 'entityIds ' => 'a,b ' ]);
3334
3435 $ mockExceptionHandler = $ this ->createMock (ExceptionHandler::class);
3536 $ mockExceptionHandler
@@ -44,8 +45,10 @@ public function testRequeue (): void {
4445 ->method ('fail ' );
4546 $ job ->handle ();
4647
47- $ this ->assertEquals (QsBatch::where ('pending_since ' , '= ' , null )->count (), 2 );
48- $ this ->assertEquals (QsBatch::where ('failed ' , '= ' , true )->count (), 1 );
48+ $ this ->assertEquals (QsBatch::where ('pending_since ' , '= ' , null )->count (), 3 );
49+ $ this ->assertEquals (QsBatch::where ('failed ' , '= ' , true )->count (), 2 );
4950 $ this ->assertEquals (QsBatch::where ('id ' , '= ' , 2 )->first ()->processing_attempts , 1 );
51+ $ this ->assertEquals (QsBatch::where ('id ' , '= ' , 4 )->first ()->processing_attempts , 4 );
52+ $ this ->assertEquals (QsBatch::where ('id ' , '= ' , 4 )->first ()->pending_since , null );
5053 }
5154}
0 commit comments