14
14
use Illuminate \Support \Facades \DB ;
15
15
use Illuminate \Support \Facades \Event ;
16
16
use Illuminate \Support \Facades \Queue ;
17
+ use PHPUnit \Framework \Attributes \Test ;
17
18
use Stackkit \LaravelGoogleCloudTasksQueue \CloudTasksApi ;
18
19
use Stackkit \LaravelGoogleCloudTasksQueue \CloudTasksQueue ;
19
20
use Stackkit \LaravelGoogleCloudTasksQueue \Events \JobReleased ;
27
28
28
29
class QueueTest extends TestCase
29
30
{
30
- /**
31
- * @test
32
- */
31
+ #[Test]
33
32
public function a_http_request_with_the_handler_url_is_made ()
34
33
{
35
34
// Arrange
@@ -44,9 +43,7 @@ public function a_http_request_with_the_handler_url_is_made()
44
43
});
45
44
}
46
45
47
- /**
48
- * @test
49
- */
46
+ #[Test]
50
47
public function it_posts_to_the_handler ()
51
48
{
52
49
// Arrange
@@ -61,9 +58,7 @@ public function it_posts_to_the_handler()
61
58
});
62
59
}
63
60
64
- /**
65
- * @test
66
- */
61
+ #[Test]
67
62
public function it_posts_to_the_correct_handler_url ()
68
63
{
69
64
// Arrange
@@ -79,9 +74,7 @@ public function it_posts_to_the_correct_handler_url()
79
74
});
80
75
}
81
76
82
- /**
83
- * @test
84
- */
77
+ #[Test]
85
78
public function it_posts_the_serialized_job_payload_to_the_handler ()
86
79
{
87
80
// Arrange
@@ -100,9 +93,7 @@ public function it_posts_the_serialized_job_payload_to_the_handler()
100
93
});
101
94
}
102
95
103
- /**
104
- * @test
105
- */
96
+ #[Test]
106
97
public function it_will_set_the_scheduled_time_when_dispatching_later ()
107
98
{
108
99
// Arrange
@@ -118,9 +109,7 @@ public function it_will_set_the_scheduled_time_when_dispatching_later()
118
109
});
119
110
}
120
111
121
- /**
122
- * @test
123
- */
112
+ #[Test]
124
113
public function test_dispatch_deadline_config ()
125
114
{
126
115
// Arrange
@@ -137,9 +126,7 @@ public function test_dispatch_deadline_config()
137
126
});
138
127
}
139
128
140
- /**
141
- * @test
142
- */
129
+ #[Test]
143
130
public function it_posts_the_task_the_correct_queue ()
144
131
{
145
132
// Arrange
@@ -169,9 +156,7 @@ public function it_posts_the_task_the_correct_queue()
169
156
});
170
157
}
171
158
172
- /**
173
- * @test
174
- */
159
+ #[Test]
175
160
public function it_can_dispatch_after_commit_inline ()
176
161
{
177
162
// Arrange
@@ -191,9 +176,7 @@ public function it_can_dispatch_after_commit_inline()
191
176
});
192
177
}
193
178
194
- /**
195
- * @test
196
- */
179
+ #[Test]
197
180
public function it_can_dispatch_after_commit_through_config ()
198
181
{
199
182
// Arrange
@@ -214,9 +197,7 @@ public function it_can_dispatch_after_commit_through_config()
214
197
});
215
198
}
216
199
217
- /**
218
- * @test
219
- */
200
+ #[Test]
220
201
public function jobs_can_be_released ()
221
202
{
222
203
// Arrange
@@ -258,9 +239,7 @@ public function jobs_can_be_released()
258
239
});
259
240
}
260
241
261
- /**
262
- * @test
263
- */
242
+ #[Test]
264
243
public function jobs_can_be_released_with_a_delay ()
265
244
{
266
245
// Arrange
@@ -287,7 +266,7 @@ public function jobs_can_be_released_with_a_delay()
287
266
});
288
267
}
289
268
290
- /** @test */
269
+ #[Test]
291
270
public function test_default_backoff ()
292
271
{
293
272
// Arrange
@@ -303,7 +282,7 @@ public function test_default_backoff()
303
282
});
304
283
}
305
284
306
- /** @test */
285
+ #[Test]
307
286
public function test_backoff_from_queue_config ()
308
287
{
309
288
// Arrange
@@ -322,7 +301,7 @@ public function test_backoff_from_queue_config()
322
301
});
323
302
}
324
303
325
- /** @test */
304
+ #[Test]
326
305
public function test_backoff_from_job ()
327
306
{
328
307
// Arrange
@@ -342,7 +321,7 @@ public function test_backoff_from_job()
342
321
});
343
322
}
344
323
345
- /** @test */
324
+ #[Test]
346
325
public function test_exponential_backoff_from_job_method ()
347
326
{
348
327
// Arrange
@@ -370,7 +349,7 @@ public function test_exponential_backoff_from_job_method()
370
349
});
371
350
}
372
351
373
- /** @test */
352
+ #[Test]
374
353
public function test_failing_method_on_job ()
375
354
{
376
355
// Arrange
@@ -387,7 +366,7 @@ public function test_failing_method_on_job()
387
366
Event::assertDispatched (fn (JobOutput $ event ) => $ event ->output === 'FailingJob:failed ' );
388
367
}
389
368
390
- /** @test */
369
+ #[Test]
391
370
public function test_queue_before_and_after_hooks ()
392
371
{
393
372
// Arrange
@@ -408,7 +387,7 @@ public function test_queue_before_and_after_hooks()
408
387
Event::assertDispatched (fn (JobOutput $ event ) => $ event ->output === 'Queue::after:Tests\Support\SimpleJob ' );
409
388
}
410
389
411
- /** @test */
390
+ #[Test]
412
391
public function test_queue_looping_hook_not_supported_with_this_package ()
413
392
{
414
393
// Arrange
@@ -426,7 +405,7 @@ public function test_queue_looping_hook_not_supported_with_this_package()
426
405
Event::assertDispatched (fn (JobOutput $ event ) => $ event ->output === 'SimpleJob:success ' );
427
406
}
428
407
429
- /** @test */
408
+ #[Test]
430
409
public function test_ignoring_jobs_with_deleted_models ()
431
410
{
432
411
// Arrange
@@ -457,9 +436,7 @@ public function test_ignoring_jobs_with_deleted_models()
457
436
CloudTasksApi::assertTaskNotDeleted ($ job ->task ->getName ());
458
437
}
459
438
460
- /**
461
- * @test
462
- */
439
+ #[Test]
463
440
public function it_adds_a_task_name_based_on_the_display_name ()
464
441
{
465
442
// Arrange
@@ -477,9 +454,7 @@ public function it_adds_a_task_name_based_on_the_display_name()
477
454
});
478
455
}
479
456
480
- /**
481
- * @test
482
- */
457
+ #[Test]
483
458
public function headers_can_be_added_to_the_task ()
484
459
{
485
460
// Arrange
@@ -498,9 +473,7 @@ public function headers_can_be_added_to_the_task()
498
473
});
499
474
}
500
475
501
- /**
502
- * @test
503
- */
476
+ #[Test]
504
477
public function headers_can_be_added_to_the_task_with_job_context ()
505
478
{
506
479
// Arrange
0 commit comments