1414use Illuminate \Support \Facades \DB ;
1515use Illuminate \Support \Facades \Event ;
1616use Illuminate \Support \Facades \Queue ;
17+ use PHPUnit \Framework \Attributes \Test ;
1718use Stackkit \LaravelGoogleCloudTasksQueue \CloudTasksApi ;
1819use Stackkit \LaravelGoogleCloudTasksQueue \CloudTasksQueue ;
1920use Stackkit \LaravelGoogleCloudTasksQueue \Events \JobReleased ;
2728
2829class QueueTest extends TestCase
2930{
30- /**
31- * @test
32- */
31+ #[Test]
3332 public function a_http_request_with_the_handler_url_is_made ()
3433 {
3534 // Arrange
@@ -44,9 +43,7 @@ public function a_http_request_with_the_handler_url_is_made()
4443 });
4544 }
4645
47- /**
48- * @test
49- */
46+ #[Test]
5047 public function it_posts_to_the_handler ()
5148 {
5249 // Arrange
@@ -61,9 +58,7 @@ public function it_posts_to_the_handler()
6158 });
6259 }
6360
64- /**
65- * @test
66- */
61+ #[Test]
6762 public function it_posts_to_the_correct_handler_url ()
6863 {
6964 // Arrange
@@ -79,9 +74,7 @@ public function it_posts_to_the_correct_handler_url()
7974 });
8075 }
8176
82- /**
83- * @test
84- */
77+ #[Test]
8578 public function it_posts_the_serialized_job_payload_to_the_handler ()
8679 {
8780 // Arrange
@@ -100,9 +93,7 @@ public function it_posts_the_serialized_job_payload_to_the_handler()
10093 });
10194 }
10295
103- /**
104- * @test
105- */
96+ #[Test]
10697 public function it_will_set_the_scheduled_time_when_dispatching_later ()
10798 {
10899 // Arrange
@@ -118,9 +109,7 @@ public function it_will_set_the_scheduled_time_when_dispatching_later()
118109 });
119110 }
120111
121- /**
122- * @test
123- */
112+ #[Test]
124113 public function test_dispatch_deadline_config ()
125114 {
126115 // Arrange
@@ -137,9 +126,7 @@ public function test_dispatch_deadline_config()
137126 });
138127 }
139128
140- /**
141- * @test
142- */
129+ #[Test]
143130 public function it_posts_the_task_the_correct_queue ()
144131 {
145132 // Arrange
@@ -169,9 +156,7 @@ public function it_posts_the_task_the_correct_queue()
169156 });
170157 }
171158
172- /**
173- * @test
174- */
159+ #[Test]
175160 public function it_can_dispatch_after_commit_inline ()
176161 {
177162 // Arrange
@@ -191,9 +176,7 @@ public function it_can_dispatch_after_commit_inline()
191176 });
192177 }
193178
194- /**
195- * @test
196- */
179+ #[Test]
197180 public function it_can_dispatch_after_commit_through_config ()
198181 {
199182 // Arrange
@@ -214,9 +197,7 @@ public function it_can_dispatch_after_commit_through_config()
214197 });
215198 }
216199
217- /**
218- * @test
219- */
200+ #[Test]
220201 public function jobs_can_be_released ()
221202 {
222203 // Arrange
@@ -258,9 +239,7 @@ public function jobs_can_be_released()
258239 });
259240 }
260241
261- /**
262- * @test
263- */
242+ #[Test]
264243 public function jobs_can_be_released_with_a_delay ()
265244 {
266245 // Arrange
@@ -287,7 +266,7 @@ public function jobs_can_be_released_with_a_delay()
287266 });
288267 }
289268
290- /** @test */
269+ #[Test]
291270 public function test_default_backoff ()
292271 {
293272 // Arrange
@@ -303,7 +282,7 @@ public function test_default_backoff()
303282 });
304283 }
305284
306- /** @test */
285+ #[Test]
307286 public function test_backoff_from_queue_config ()
308287 {
309288 // Arrange
@@ -322,7 +301,7 @@ public function test_backoff_from_queue_config()
322301 });
323302 }
324303
325- /** @test */
304+ #[Test]
326305 public function test_backoff_from_job ()
327306 {
328307 // Arrange
@@ -342,7 +321,7 @@ public function test_backoff_from_job()
342321 });
343322 }
344323
345- /** @test */
324+ #[Test]
346325 public function test_exponential_backoff_from_job_method ()
347326 {
348327 // Arrange
@@ -370,7 +349,7 @@ public function test_exponential_backoff_from_job_method()
370349 });
371350 }
372351
373- /** @test */
352+ #[Test]
374353 public function test_failing_method_on_job ()
375354 {
376355 // Arrange
@@ -387,7 +366,7 @@ public function test_failing_method_on_job()
387366 Event::assertDispatched (fn (JobOutput $ event ) => $ event ->output === 'FailingJob:failed ' );
388367 }
389368
390- /** @test */
369+ #[Test]
391370 public function test_queue_before_and_after_hooks ()
392371 {
393372 // Arrange
@@ -408,7 +387,7 @@ public function test_queue_before_and_after_hooks()
408387 Event::assertDispatched (fn (JobOutput $ event ) => $ event ->output === 'Queue::after:Tests\Support\SimpleJob ' );
409388 }
410389
411- /** @test */
390+ #[Test]
412391 public function test_queue_looping_hook_not_supported_with_this_package ()
413392 {
414393 // Arrange
@@ -426,7 +405,7 @@ public function test_queue_looping_hook_not_supported_with_this_package()
426405 Event::assertDispatched (fn (JobOutput $ event ) => $ event ->output === 'SimpleJob:success ' );
427406 }
428407
429- /** @test */
408+ #[Test]
430409 public function test_ignoring_jobs_with_deleted_models ()
431410 {
432411 // Arrange
@@ -457,9 +436,7 @@ public function test_ignoring_jobs_with_deleted_models()
457436 CloudTasksApi::assertTaskNotDeleted ($ job ->task ->getName ());
458437 }
459438
460- /**
461- * @test
462- */
439+ #[Test]
463440 public function it_adds_a_task_name_based_on_the_display_name ()
464441 {
465442 // Arrange
@@ -477,9 +454,7 @@ public function it_adds_a_task_name_based_on_the_display_name()
477454 });
478455 }
479456
480- /**
481- * @test
482- */
457+ #[Test]
483458 public function headers_can_be_added_to_the_task ()
484459 {
485460 // Arrange
@@ -498,9 +473,7 @@ public function headers_can_be_added_to_the_task()
498473 });
499474 }
500475
501- /**
502- * @test
503- */
476+ #[Test]
504477 public function headers_can_be_added_to_the_task_with_job_context ()
505478 {
506479 // Arrange
0 commit comments