2323use Cake \Queue \Test \test_app \src \Job \LogToDebugWithServiceJob ;
2424use Cake \Queue \Test \TestCase \DebugLogTrait ;
2525use Cake \TestSuite \TestCase ;
26+ use PHPUnit \Framework \Attributes \DataProvider ;
27+ use PHPUnit \Framework \Attributes \RunInSeparateProcess ;
2628use TestApp \Job \LogToDebugJob ;
2729use TestApp \Job \RequeueJob ;
2830use TestApp \WelcomeMailerListener ;
@@ -48,9 +50,8 @@ public function testDescriptionOutput()
4850
4951 /**
5052 * Test that queue will run for one second
51- *
52- * @runInSeparateProcess
5353 */
54+ #[RunInSeparateProcess]
5455 public function testQueueProcessesStart ()
5556 {
5657 Configure::write ('Queue ' , [
@@ -65,9 +66,8 @@ public function testQueueProcessesStart()
6566
6667 /**
6768 * Test that queue will run for one second with valid listener
68- *
69- * @runInSeparateProcess
7069 */
70+ #[RunInSeparateProcess]
7171 public function testQueueProcessesWithListener ()
7272 {
7373 Configure::write ('Queue ' , [
@@ -83,9 +83,8 @@ public function testQueueProcessesWithListener()
8383
8484 /**
8585 * Test that queue will abort when the passed config is not present in the app configuration.
86- *
87- * @runInSeparateProcess
8886 */
87+ #[RunInSeparateProcess]
8988 public function testQueueWillAbortWithMissingConfig ()
9089 {
9190 Configure::write ('Queue ' , [
@@ -102,9 +101,8 @@ public function testQueueWillAbortWithMissingConfig()
102101
103102 /**
104103 * Test that queue will abort with invalid listener
105- *
106- * @runInSeparateProcess
107104 */
105+ #[RunInSeparateProcess]
108106 public function testQueueProcessesWithInvalidListener ()
109107 {
110108 Configure::write ('Queue ' , [
@@ -121,9 +119,8 @@ public function testQueueProcessesWithInvalidListener()
121119
122120 /**
123121 * Test that queue will write to specified logger option
124- *
125- * @runInSeparateProcess
126122 */
123+ #[RunInSeparateProcess]
127124 public function testQueueProcessesWithLogger ()
128125 {
129126 Configure::write ('Queue ' , [
@@ -156,10 +153,9 @@ public static function dataProviderCallableTypes(): array
156153
157154 /**
158155 * Start up the worker queue, push a job, and see that it processes
159- *
160- * @dataProvider dataProviderCallableTypes
161- * @runInSeparateProcess
162156 */
157+ #[DataProvider('dataProviderCallableTypes ' )]
158+ #[RunInSeparateProcess]
163159 public function testQueueProcessesJob ($ callable )
164160 {
165161 $ config = [
@@ -185,9 +181,8 @@ public function testQueueProcessesJob($callable)
185181
186182 /**
187183 * Set the processor name, Start up the worker queue, push a job, and see that it processes
188- *
189- * @runInSeparateProcess
190184 */
185+ #[RunInSeparateProcess]
191186 public function testQueueProcessesJobWithProcessor ()
192187 {
193188 $ config = [
@@ -212,9 +207,8 @@ public function testQueueProcessesJobWithProcessor()
212207
213208 /**
214209 * Test non-default queue name
215- *
216- * @runInSeparateProcess
217210 */
211+ #[RunInSeparateProcess]
218212 public function testQueueProcessesJobWithOtherQueue ()
219213 {
220214 $ config = [
@@ -240,9 +234,8 @@ public function testQueueProcessesJobWithOtherQueue()
240234
241235 /**
242236 * Test max-attempts option
243- *
244- * @runInSeparateProcess
245237 */
238+ #[RunInSeparateProcess]
246239 public function testQueueProcessesJobWithMaxAttempts ()
247240 {
248241 $ config = [
@@ -268,9 +261,8 @@ public function testQueueProcessesJobWithMaxAttempts()
268261
269262 /**
270263 * Test DI service injection works in tasks
271- *
272- * @runInSeparateProcess
273264 */
265+ #[RunInSeparateProcess]
274266 public function testQueueProcessesJobWithDIService ()
275267 {
276268 $ this ->skipIf (version_compare (Configure::version (), '4.2 ' , '< ' ), 'DI Container is only available since CakePHP 4.2 ' );
@@ -296,9 +288,8 @@ public function testQueueProcessesJobWithDIService()
296288
297289 /**
298290 * Test that queue will process when a unique cache is configured.
299- *
300- * @runInSeparateProcess
301291 */
292+ #[RunInSeparateProcess]
302293 public function testQueueProcessesWithUniqueCacheConfigured ()
303294 {
304295 $ config = [
0 commit comments