You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BatchContentGenerationTest empty-collection test reimplements the branch instead of calling the job #16
Found while clearing the quarantined test groups (#14).
php/tests/Feature/Jobs/BatchContentGenerationTest.php, test does not dispatch any ProcessContentTask when collection is empty, never calls BatchContentGeneration. It builds its own empty collection, runs its own copy of the early-return branch, and asserts on that:
$emptyTasks = collect([]);
if ($emptyTasks->isEmpty()) {
// Simulates handle() early returnLog::info('BatchContentGeneration: No normal priority tasks to process');
} else {
foreach ($emptyTasksas$task) {
ProcessContentTask::dispatch($task);
}
}
Queue::assertNothingPushed();
It passes whatever handle() does, including if handle() is deleted. It is a test of the test.
The sibling test immediately above it (logs an info message when no tasks are found) now exercises the real path against a real content_tasks table after #14, so the coverage is genuinely there. This one should either be deleted as redundant, or rewritten to assert Queue::assertNothingPushed() after a real handle() call on the empty table.
Activity