From 747a5d6f2087e156242ed67d71eff33733407c60 Mon Sep 17 00:00:00 2001 From: Attila Fulop <1162360+fulopattila122@users.noreply.github.com> Date: Thu, 14 Nov 2024 13:03:55 +0200 Subject: [PATCH] Poor man's test reset --- tests/JobExecutionTest.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/JobExecutionTest.php b/tests/JobExecutionTest.php index a7eac6c..7a6732f 100644 --- a/tests/JobExecutionTest.php +++ b/tests/JobExecutionTest.php @@ -16,6 +16,8 @@ class JobExecutionTest extends TestCase /** @test */ public function it_can_find_and_entry_by_tracking_id() { + JobExecution::ofJobClass(SampleTrackableJob::class)->delete(); + $job = new SampleTrackableJob(new SampleTask()); $job->generateJobTrackingId(); JobTracker::createFor($job); @@ -29,6 +31,8 @@ public function it_can_find_and_entry_by_tracking_id() /** @test */ public function it_can_return_the_entries_of_a_given_job_class() { + JobExecution::ofJobClass(SampleTrackableJob::class)->delete(); + foreach (range(1, 10) as $i) { $job = new SampleTrackableJob(new SampleTask()); $job->generateJobTrackingId(); @@ -42,6 +46,8 @@ public function it_can_return_the_entries_of_a_given_job_class() /** @test */ public function it_can_return_the_active_entries_of_a_given_job_class() { + JobExecution::ofJobClass(SampleTrackableJob::class)->delete(); + foreach (range(1, 4) as $i) { $job = new SampleTrackableJob(new SampleTask(), JobStatus::COMPLETED()); $job->generateJobTrackingId(); @@ -65,6 +71,8 @@ public function it_can_return_the_active_entries_of_a_given_job_class() /** @test */ public function it_can_return_the_entries_of_a_given_job_class_and_limit_the_record_count() { + JobExecution::ofJobClass(SampleTrackableJob::class)->delete(); + foreach (range(1, 10) as $i) { $job = new SampleTrackableJob(new SampleTask()); $job->generateJobTrackingId();