File: 0007-Fix-PHPUnit-12-compatibility.patch

package info (click to toggle)
php-nesbot-carbon 2.73.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 19,884 kB
  • sloc: php: 158,586; xml: 99; makefile: 33; sh: 14
file content (1777 lines) | stat: -rw-r--r-- 62,293 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
From: Robin Gustafsson <robin@rgson.se>
Date: Wed, 12 Mar 2025 22:11:17 +0100
Subject: Fix PHPUnit 12 compatibility

Upstream is preserving PHP 7 compatibility on version 2.x so PHPUnit 12
won't be supported.

Forwarded: not-needed
---
 tests/Carbon/AddMonthsTest.php                     | 49 ++++++++--------------
 tests/Carbon/CreateTest.php                        |  4 +-
 .../Exceptions/NotLocaleAwareExceptionTest.php     |  4 +-
 tests/Carbon/GettersTest.php                       | 10 ++---
 tests/Carbon/IsTest.php                            |  5 +--
 tests/Carbon/IssetTest.php                         |  4 +-
 tests/Carbon/LocalizationTest.php                  | 10 ++---
 tests/Carbon/ModifyNearDSTChangeTest.php           |  7 ++--
 tests/Carbon/SerializationTest.php                 |  4 +-
 tests/Carbon/SettersTest.php                       |  4 +-
 tests/Carbon/StartEndOfTest.php                    |  7 ++--
 tests/Carbon/WeekTest.php                          |  9 ++--
 tests/CarbonImmutable/AddMonthsTest.php            | 49 ++++++++--------------
 tests/CarbonImmutable/GenericMacroTest.php         |  5 +--
 tests/CarbonImmutable/GettersTest.php              | 10 ++---
 tests/CarbonImmutable/IsTest.php                   |  5 +--
 tests/CarbonImmutable/IssetTest.php                |  4 +-
 tests/CarbonImmutable/LocalizationTest.php         | 10 ++---
 tests/CarbonImmutable/ModifyNearDSTChangeTest.php  |  7 ++--
 tests/CarbonImmutable/SerializationTest.php        |  4 +-
 tests/CarbonImmutable/SettersTest.php              |  4 +-
 tests/CarbonImmutable/StartEndOfTest.php           |  7 ++--
 tests/CarbonImmutable/WeekTest.php                 |  9 ++--
 tests/CarbonInterval/AddTest.php                   |  4 +-
 tests/CarbonInterval/CascadeTest.php               | 16 +++----
 tests/CarbonInterval/FromStringTest.php            |  7 ++--
 tests/CarbonInterval/ParseFromLocaleTest.php       |  9 ++--
 tests/CarbonInterval/ToPeriodTest.php              |  5 +--
 tests/CarbonInterval/TotalTest.php                 | 11 +++--
 tests/CarbonPeriod/CreateTest.php                  | 33 ++++-----------
 tests/CarbonPeriod/IteratorTest.php                |  5 +--
 tests/CarbonPeriod/ToStringTest.php                |  9 ++--
 tests/CarbonTimeZone/ConversionsTest.php           |  7 ++--
 tests/CommonTraits/MacroContextNestingTest.php     |  9 ++--
 tests/Doctrine/CarbonTypesTest.php                 | 29 ++++++-------
 tests/Laravel/ServiceProviderTest.php              |  5 +--
 36 files changed, 146 insertions(+), 234 deletions(-)

diff --git a/tests/Carbon/AddMonthsTest.php b/tests/Carbon/AddMonthsTest.php
index 5616b3b..6163087 100644
--- a/tests/Carbon/AddMonthsTest.php
+++ b/tests/Carbon/AddMonthsTest.php
@@ -15,6 +15,7 @@ namespace Tests\Carbon;
 
 use Carbon\Carbon;
 use Generator;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Tests\AbstractTestCase;
 
 class AddMonthsTest extends AbstractTestCase
@@ -43,26 +44,24 @@ class AddMonthsTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\Carbon\AddMonthsTest::dataForTestAddMonthNoOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestAddMonthNoOverflow')]
     public function testAddMonthNoOverflow($months, $y, $m, $d)
     {
         $this->assertCarbon($this->carbon->addMonthNoOverflow($months), $y, $m, $d);
     }
 
     /**
-     * @dataProvider \Tests\Carbon\AddMonthsTest::dataForTestAddMonthNoOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestAddMonthNoOverflow')]
     public function testAddMonthsNoOverflow($months, $y, $m, $d)
     {
         $this->assertCarbon($this->carbon->addMonthsNoOverflow($months), $y, $m, $d);
@@ -78,26 +77,24 @@ class AddMonthsTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\Carbon\AddMonthsTest::dataForTestSubMonthNoOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestSubMonthNoOverflow')]
     public function testSubMonthNoOverflow($months, $y, $m, $d)
     {
         $this->assertCarbon($this->carbon->subMonthNoOverflow($months), $y, $m, $d);
     }
 
     /**
-     * @dataProvider \Tests\Carbon\AddMonthsTest::dataForTestSubMonthNoOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestSubMonthNoOverflow')]
     public function testSubMonthsNoOverflow($months, $y, $m, $d)
     {
         $this->assertCarbon($this->carbon->subMonthsNoOverflow($months), $y, $m, $d);
@@ -113,26 +110,24 @@ class AddMonthsTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\Carbon\AddMonthsTest::dataForTestAddMonthWithOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestAddMonthWithOverflow')]
     public function testAddMonthWithOverflow($months, $y, $m, $d)
     {
         $this->assertCarbon($this->carbon->addMonthWithOverflow($months), $y, $m, $d);
     }
 
     /**
-     * @dataProvider \Tests\Carbon\AddMonthsTest::dataForTestAddMonthWithOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestAddMonthWithOverflow')]
     public function testAddMonthsWithOverflow($months, $y, $m, $d)
     {
         $this->assertCarbon($this->carbon->addMonthsWithOverflow($months), $y, $m, $d);
@@ -148,26 +143,24 @@ class AddMonthsTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\Carbon\AddMonthsTest::dataForTestSubMonthWithOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestSubMonthWithOverflow')]
     public function testSubMonthWithOverflow($months, $y, $m, $d)
     {
         $this->assertCarbon($this->carbon->subMonthWithOverflow($months), $y, $m, $d);
     }
 
     /**
-     * @dataProvider \Tests\Carbon\AddMonthsTest::dataForTestSubMonthWithOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestSubMonthWithOverflow')]
     public function testSubMonthsWithOverflow($months, $y, $m, $d)
     {
         $this->assertCarbon($this->carbon->subMonthsWithOverflow($months), $y, $m, $d);
@@ -200,13 +193,12 @@ class AddMonthsTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\Carbon\AddMonthsTest::dataForTestAddMonthWithOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestAddMonthWithOverflow')]
     public function testUseOverflowAddMonth($months, $y, $m, $d)
     {
         Carbon::useMonthsOverflow(true);
@@ -214,13 +206,12 @@ class AddMonthsTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\Carbon\AddMonthsTest::dataForTestAddMonthWithOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestAddMonthWithOverflow')]
     public function testUseOverflowAddMonths($months, $y, $m, $d)
     {
         Carbon::useMonthsOverflow(true);
@@ -228,13 +219,12 @@ class AddMonthsTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\Carbon\AddMonthsTest::dataForTestSubMonthWithOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestSubMonthWithOverflow')]
     public function testUseOverflowSubMonth($months, $y, $m, $d)
     {
         Carbon::useMonthsOverflow(true);
@@ -242,13 +232,12 @@ class AddMonthsTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\Carbon\AddMonthsTest::dataForTestSubMonthWithOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestSubMonthWithOverflow')]
     public function testUseOverflowSubMonths($months, $y, $m, $d)
     {
         Carbon::useMonthsOverflow(true);
@@ -256,13 +245,12 @@ class AddMonthsTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\Carbon\AddMonthsTest::dataForTestAddMonthNoOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestAddMonthNoOverflow')]
     public function testSkipOverflowAddMonth($months, $y, $m, $d)
     {
         Carbon::useMonthsOverflow(false);
@@ -270,13 +258,12 @@ class AddMonthsTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\Carbon\AddMonthsTest::dataForTestAddMonthNoOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestAddMonthNoOverflow')]
     public function testSkipOverflowAddMonths($months, $y, $m, $d)
     {
         Carbon::useMonthsOverflow(false);
@@ -284,13 +271,12 @@ class AddMonthsTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\Carbon\AddMonthsTest::dataForTestSubMonthNoOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestSubMonthNoOverflow')]
     public function testSkipOverflowSubMonth($months, $y, $m, $d)
     {
         Carbon::useMonthsOverflow(false);
@@ -298,13 +284,12 @@ class AddMonthsTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\Carbon\AddMonthsTest::dataForTestSubMonthNoOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestSubMonthNoOverflow')]
     public function testSkipOverflowSubMonths($months, $y, $m, $d)
     {
         Carbon::useMonthsOverflow(false);
diff --git a/tests/Carbon/CreateTest.php b/tests/Carbon/CreateTest.php
index f7416ab..c81c183 100644
--- a/tests/Carbon/CreateTest.php
+++ b/tests/Carbon/CreateTest.php
@@ -19,6 +19,7 @@ use Carbon\Exceptions\OutOfRangeException;
 use DateTime;
 use DateTimeZone;
 use InvalidArgumentException;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Tests\AbstractTestCase;
 
 class CreateTest extends AbstractTestCase
@@ -307,10 +308,9 @@ class CreateTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\Carbon\CreateTest::dataForLocales
-     *
      * @group localization
      */
+    #[DataProvider('dataForLocales')]
     public function testParseFromLocaleForEachLocale($locale)
     {
         $expectedDate = Carbon::parse('today 4:26');
diff --git a/tests/Carbon/Exceptions/NotLocaleAwareExceptionTest.php b/tests/Carbon/Exceptions/NotLocaleAwareExceptionTest.php
index 8a8ee07..1686e38 100644
--- a/tests/Carbon/Exceptions/NotLocaleAwareExceptionTest.php
+++ b/tests/Carbon/Exceptions/NotLocaleAwareExceptionTest.php
@@ -14,6 +14,7 @@ namespace Tests\Carbon\Exceptions;
 use Carbon\Exceptions\NotLocaleAwareException;
 use Generator;
 use stdClass;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Tests\AbstractTestCase;
 
 class NotLocaleAwareExceptionTest extends AbstractTestCase
@@ -31,13 +32,12 @@ class NotLocaleAwareExceptionTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\Carbon\Exceptions\NotLocaleAwareExceptionTest::dataForTestNotAPeriodException
-     *
      * @param mixed  $object
      * @param string $message
      *
      * @return void
      */
+    #[DataProvider('dataForTestNotAPeriodException')]
     public function testNotAPeriodException($object, $message): void
     {
         $exception = new NotLocaleAwareException($object);
diff --git a/tests/Carbon/GettersTest.php b/tests/Carbon/GettersTest.php
index 34a249e..e722c54 100644
--- a/tests/Carbon/GettersTest.php
+++ b/tests/Carbon/GettersTest.php
@@ -16,6 +16,7 @@ namespace Tests\Carbon;
 use Carbon\Carbon;
 use Generator;
 use InvalidArgumentException;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Tests\AbstractTestCase;
 
 class GettersTest extends AbstractTestCase
@@ -261,11 +262,10 @@ class GettersTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\Carbon\GettersTest::dataForTestQuarter
-     *
      * @param int $month
      * @param int $quarter
      */
+    #[DataProvider('dataForTestQuarter')]
     public function testQuarterFirstOfMonth($month, $quarter)
     {
         $c = Carbon::create(2015, $month, 1)->startOfMonth();
@@ -273,11 +273,10 @@ class GettersTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\Carbon\GettersTest::dataForTestQuarter
-     *
      * @param int $month
      * @param int $quarter
      */
+    #[DataProvider('dataForTestQuarter')]
     public function testQuarterMiddleOfMonth($month, $quarter)
     {
         $c = Carbon::create(2015, $month, 15, 12, 13, 14);
@@ -285,11 +284,10 @@ class GettersTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\Carbon\GettersTest::dataForTestQuarter
-     *
      * @param int $month
      * @param int $quarter
      */
+    #[DataProvider('dataForTestQuarter')]
     public function testQuarterLastOfMonth($month, $quarter)
     {
         $c = Carbon::create(2015, $month, 1)->endOfMonth();
diff --git a/tests/Carbon/IsTest.php b/tests/Carbon/IsTest.php
index 0617c6f..057a455 100644
--- a/tests/Carbon/IsTest.php
+++ b/tests/Carbon/IsTest.php
@@ -18,6 +18,7 @@ use Carbon\Carbon;
 use DateTime;
 use Generator;
 use InvalidArgumentException;
+use PHPUnit\Framework\Attributes\DataProvider;
 use stdClass;
 use Tests\AbstractTestCase;
 
@@ -970,9 +971,7 @@ class IsTest extends AbstractTestCase
         yield ['r'];
     }
 
-    /**
-     * @dataProvider \Tests\Carbon\IsTest::dataForFormatLetters
-     */
+    #[DataProvider('dataForFormatLetters')]
     public function testHasFormatWithSingleLetter($letter)
     {
         $output = Carbon::now()->format($letter);
diff --git a/tests/Carbon/IssetTest.php b/tests/Carbon/IssetTest.php
index 451a588..d0afd21 100644
--- a/tests/Carbon/IssetTest.php
+++ b/tests/Carbon/IssetTest.php
@@ -15,6 +15,7 @@ namespace Tests\Carbon;
 
 use Carbon\Carbon;
 use Generator;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Tests\AbstractTestCase;
 
 class IssetTest extends AbstractTestCase
@@ -94,10 +95,9 @@ class IssetTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\Carbon\IssetTest::dataForTestIssetReturnTrueForProperties
-     *
      * @param string $property
      */
+    #[DataProvider('dataForTestIssetReturnTrueForProperties')]
     public function testIssetReturnTrueForProperties(string $property): void
     {
         Carbon::useStrictMode(false);
diff --git a/tests/Carbon/LocalizationTest.php b/tests/Carbon/LocalizationTest.php
index 3d6e7ba..19bc960 100644
--- a/tests/Carbon/LocalizationTest.php
+++ b/tests/Carbon/LocalizationTest.php
@@ -20,6 +20,7 @@ use Carbon\Language;
 use Carbon\Translator;
 use Generator;
 use InvalidArgumentException;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Symfony\Component\Translation\IdentityTranslator;
 use Symfony\Component\Translation\Loader\ArrayLoader;
 use Symfony\Component\Translation\MessageCatalogue;
@@ -316,10 +317,9 @@ class LocalizationTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\Carbon\LocalizationTest::dataForLocales
-     *
      * @param string $locale
      */
+    #[DataProvider('dataForLocales')]
     public function testSetLocale($locale)
     {
         $this->assertTrue(Carbon::setLocale($locale));
@@ -327,10 +327,9 @@ class LocalizationTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\Carbon\LocalizationTest::dataForLocales
-     *
      * @param string $locale
      */
+    #[DataProvider('dataForLocales')]
     public function testSetTranslator($locale)
     {
         $ori = Carbon::getTranslator();
@@ -369,10 +368,9 @@ class LocalizationTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\Carbon\LocalizationTest::dataForTestSetLocaleWithMalformedLocale
-     *
      * @param string $malformedLocale
      */
+    #[DataProvider('dataForTestSetLocaleWithMalformedLocale')]
     public function testSetLocaleWithMalformedLocale($malformedLocale)
     {
         $this->assertTrue(Carbon::setLocale($malformedLocale));
diff --git a/tests/Carbon/ModifyNearDSTChangeTest.php b/tests/Carbon/ModifyNearDSTChangeTest.php
index 4870752..cb09559 100644
--- a/tests/Carbon/ModifyNearDSTChangeTest.php
+++ b/tests/Carbon/ModifyNearDSTChangeTest.php
@@ -15,6 +15,7 @@ namespace Tests\Carbon;
 
 use Carbon\Carbon;
 use Generator;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Tests\AbstractTestCase;
 
 class ModifyNearDSTChangeTest extends AbstractTestCase
@@ -25,9 +26,8 @@ class ModifyNearDSTChangeTest extends AbstractTestCase
      * @param string $dateString
      * @param int    $addHours
      * @param string $expected
-     *
-     * @dataProvider \Tests\Carbon\ModifyNearDSTChangeTest::dataForTransitionTests
      */
+    #[DataProvider('dataForTransitionTests')]
     public function testTransitionInNonDefaultTimezone($dateString, $addHours, $expected)
     {
         date_default_timezone_set('Europe/london');
@@ -42,9 +42,8 @@ class ModifyNearDSTChangeTest extends AbstractTestCase
      * @param string $dateString
      * @param int    $addHours
      * @param string $expected
-     *
-     * @dataProvider \Tests\Carbon\ModifyNearDSTChangeTest::dataForTransitionTests
      */
+    #[DataProvider('dataForTransitionTests')]
     public function testTransitionInDefaultTimezone($dateString, $addHours, $expected)
     {
         date_default_timezone_set('America/New_York');
diff --git a/tests/Carbon/SerializationTest.php b/tests/Carbon/SerializationTest.php
index 8bc2371..08aa457 100644
--- a/tests/Carbon/SerializationTest.php
+++ b/tests/Carbon/SerializationTest.php
@@ -20,6 +20,7 @@ use InvalidArgumentException;
 use ReflectionClass;
 use ReflectionObject;
 use ReflectionProperty;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Tests\AbstractTestCase;
 use Throwable;
 
@@ -84,9 +85,8 @@ class SerializationTest extends AbstractTestCase
 
     /**
      * @param mixed $value
-     *
-     * @dataProvider \Tests\Carbon\SerializationTest::dataForTestFromUnserializedWithInvalidValue
      */
+    #[DataProvider('dataForTestFromUnserializedWithInvalidValue')]
     public function testFromUnserializedWithInvalidValue($value)
     {
         $this->expectExceptionObject(new InvalidArgumentException(
diff --git a/tests/Carbon/SettersTest.php b/tests/Carbon/SettersTest.php
index e1a5e46..d9852f0 100644
--- a/tests/Carbon/SettersTest.php
+++ b/tests/Carbon/SettersTest.php
@@ -19,6 +19,7 @@ use DateTimeZone;
 use Exception;
 use Generator;
 use InvalidArgumentException;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Tests\AbstractTestCase;
 
 class SettersTest extends AbstractTestCase
@@ -499,13 +500,12 @@ class SettersTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\Carbon\SettersTest::dataForTestSetTimeFromTimeString
-     *
      * @param int    $hour
      * @param int    $minute
      * @param int    $second
      * @param string $time
      */
+    #[DataProvider('dataForTestSetTimeFromTimeString')]
     public function testSetTimeFromTimeString($hour, $minute, $second, $time)
     {
         Carbon::setTestNow(Carbon::create(2016, 2, 12, 1, 2, 3));
diff --git a/tests/Carbon/StartEndOfTest.php b/tests/Carbon/StartEndOfTest.php
index 0db7024..a153fa6 100644
--- a/tests/Carbon/StartEndOfTest.php
+++ b/tests/Carbon/StartEndOfTest.php
@@ -16,6 +16,7 @@ namespace Tests\Carbon;
 use Carbon\Carbon;
 use Generator;
 use InvalidArgumentException;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Tests\AbstractTestCase;
 
 class StartEndOfTest extends AbstractTestCase
@@ -459,11 +460,10 @@ class StartEndOfTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\Carbon\StartEndOfTest::dataForTestStartOfQuarter
-     *
      * @param int $month
      * @param int $startOfQuarterMonth
      */
+    #[DataProvider('dataForTestStartOfQuarter')]
     public function testStartOfQuarter($month, $startOfQuarterMonth)
     {
         $dt = Carbon::create(2015, $month, 15, 1, 2, 3);
@@ -493,12 +493,11 @@ class StartEndOfTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\Carbon\StartEndOfTest::dataForTestEndOfQuarter
-     *
      * @param int $month
      * @param int $endOfQuarterMonth
      * @param int $endOfQuarterDay
      */
+    #[DataProvider('dataForTestEndOfQuarter')]
     public function testEndOfQuarter($month, $endOfQuarterMonth, $endOfQuarterDay)
     {
         $dt = Carbon::create(2015, $month, 15, 1, 2, 3);
diff --git a/tests/Carbon/WeekTest.php b/tests/Carbon/WeekTest.php
index 0f64cc4..39d7043 100644
--- a/tests/Carbon/WeekTest.php
+++ b/tests/Carbon/WeekTest.php
@@ -15,6 +15,7 @@ namespace Tests\Carbon;
 
 use Carbon\Carbon;
 use Carbon\CarbonInterface;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Tests\AbstractTestCase;
 
 class WeekTest extends AbstractTestCase
@@ -5438,9 +5439,7 @@ class WeekTest extends AbstractTestCase
         $this->assertSame('2022-10-18 00:00', Carbon::today()->weekday(CarbonInterface::TUESDAY)->format('Y-m-d H:i'));
     }
 
-    /**
-     * @dataProvider getDaysFromStartOfWeekDataProvider
-     */
+    #[DataProvider('getDaysFromStartOfWeekDataProvider')]
     public function testGetDaysFromStartOfWeek(string $locale, string $date, int $daysCount)
     {
         $this->assertSame(
@@ -5473,9 +5472,7 @@ class WeekTest extends AbstractTestCase
         ];
     }
 
-    /**
-     * @dataProvider getDaysFromStartOfWeekDataProviderExplicit
-     */
+    #[DataProvider('getDaysFromStartOfWeekDataProviderExplicit')]
     public function testGetDaysFromStartOfWeekExplicit(int $start, string $date, int $daysCount)
     {
         static $locales = [null, 'pt_BR', 'de_CH', 'ar_MA'];
diff --git a/tests/CarbonImmutable/AddMonthsTest.php b/tests/CarbonImmutable/AddMonthsTest.php
index bf90c29..d9fd26d 100644
--- a/tests/CarbonImmutable/AddMonthsTest.php
+++ b/tests/CarbonImmutable/AddMonthsTest.php
@@ -14,6 +14,7 @@ declare(strict_types=1);
 namespace Tests\CarbonImmutable;
 
 use Carbon\CarbonImmutable as Carbon;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Tests\AbstractTestCase;
 
 class AddMonthsTest extends AbstractTestCase
@@ -45,26 +46,24 @@ class AddMonthsTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\CarbonImmutable\AddMonthsTest::dataForTestAddMonthNoOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestAddMonthNoOverflow')]
     public function testAddMonthNoOverflow($months, $y, $m, $d)
     {
         $this->assertCarbon($this->carbon->addMonthNoOverflow($months), $y, $m, $d);
     }
 
     /**
-     * @dataProvider \Tests\CarbonImmutable\AddMonthsTest::dataForTestAddMonthNoOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestAddMonthNoOverflow')]
     public function testAddMonthsNoOverflow($months, $y, $m, $d)
     {
         $this->assertCarbon($this->carbon->addMonthsNoOverflow($months), $y, $m, $d);
@@ -82,26 +81,24 @@ class AddMonthsTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\CarbonImmutable\AddMonthsTest::dataForTestSubMonthNoOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestSubMonthNoOverflow')]
     public function testSubMonthNoOverflow($months, $y, $m, $d)
     {
         $this->assertCarbon($this->carbon->subMonthNoOverflow($months), $y, $m, $d);
     }
 
     /**
-     * @dataProvider \Tests\CarbonImmutable\AddMonthsTest::dataForTestSubMonthNoOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestSubMonthNoOverflow')]
     public function testSubMonthsNoOverflow($months, $y, $m, $d)
     {
         $this->assertCarbon($this->carbon->subMonthsNoOverflow($months), $y, $m, $d);
@@ -119,26 +116,24 @@ class AddMonthsTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\CarbonImmutable\AddMonthsTest::dataForTestAddMonthWithOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestAddMonthWithOverflow')]
     public function testAddMonthWithOverflow($months, $y, $m, $d)
     {
         $this->assertCarbon($this->carbon->addMonthWithOverflow($months), $y, $m, $d);
     }
 
     /**
-     * @dataProvider \Tests\CarbonImmutable\AddMonthsTest::dataForTestAddMonthWithOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestAddMonthWithOverflow')]
     public function testAddMonthsWithOverflow($months, $y, $m, $d)
     {
         $this->assertCarbon($this->carbon->addMonthsWithOverflow($months), $y, $m, $d);
@@ -156,26 +151,24 @@ class AddMonthsTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\CarbonImmutable\AddMonthsTest::dataForTestSubMonthWithOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestSubMonthWithOverflow')]
     public function testSubMonthWithOverflow($months, $y, $m, $d)
     {
         $this->assertCarbon($this->carbon->subMonthWithOverflow($months), $y, $m, $d);
     }
 
     /**
-     * @dataProvider \Tests\CarbonImmutable\AddMonthsTest::dataForTestSubMonthWithOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestSubMonthWithOverflow')]
     public function testSubMonthsWithOverflow($months, $y, $m, $d)
     {
         $this->assertCarbon($this->carbon->subMonthsWithOverflow($months), $y, $m, $d);
@@ -208,13 +201,12 @@ class AddMonthsTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\CarbonImmutable\AddMonthsTest::dataForTestAddMonthWithOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestAddMonthWithOverflow')]
     public function testUseOverflowAddMonth($months, $y, $m, $d)
     {
         Carbon::useMonthsOverflow(true);
@@ -222,13 +214,12 @@ class AddMonthsTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\CarbonImmutable\AddMonthsTest::dataForTestAddMonthWithOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestAddMonthWithOverflow')]
     public function testUseOverflowAddMonths($months, $y, $m, $d)
     {
         Carbon::useMonthsOverflow(true);
@@ -236,13 +227,12 @@ class AddMonthsTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\CarbonImmutable\AddMonthsTest::dataForTestSubMonthWithOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestSubMonthWithOverflow')]
     public function testUseOverflowSubMonth($months, $y, $m, $d)
     {
         Carbon::useMonthsOverflow(true);
@@ -250,13 +240,12 @@ class AddMonthsTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\CarbonImmutable\AddMonthsTest::dataForTestSubMonthWithOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestSubMonthWithOverflow')]
     public function testUseOverflowSubMonths($months, $y, $m, $d)
     {
         Carbon::useMonthsOverflow(true);
@@ -264,13 +253,12 @@ class AddMonthsTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\CarbonImmutable\AddMonthsTest::dataForTestAddMonthNoOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestAddMonthNoOverflow')]
     public function testSkipOverflowAddMonth($months, $y, $m, $d)
     {
         Carbon::useMonthsOverflow(false);
@@ -278,13 +266,12 @@ class AddMonthsTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\CarbonImmutable\AddMonthsTest::dataForTestAddMonthNoOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestAddMonthNoOverflow')]
     public function testSkipOverflowAddMonths($months, $y, $m, $d)
     {
         Carbon::useMonthsOverflow(false);
@@ -292,13 +279,12 @@ class AddMonthsTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\CarbonImmutable\AddMonthsTest::dataForTestSubMonthNoOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestSubMonthNoOverflow')]
     public function testSkipOverflowSubMonth($months, $y, $m, $d)
     {
         Carbon::useMonthsOverflow(false);
@@ -306,13 +292,12 @@ class AddMonthsTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\CarbonImmutable\AddMonthsTest::dataForTestSubMonthNoOverflow
-     *
      * @param int $months
      * @param int $y
      * @param int $m
      * @param int $d
      */
+    #[DataProvider('dataForTestSubMonthNoOverflow')]
     public function testSkipOverflowSubMonths($months, $y, $m, $d)
     {
         Carbon::useMonthsOverflow(false);
diff --git a/tests/CarbonImmutable/GenericMacroTest.php b/tests/CarbonImmutable/GenericMacroTest.php
index 01edf6d..8d8e402 100644
--- a/tests/CarbonImmutable/GenericMacroTest.php
+++ b/tests/CarbonImmutable/GenericMacroTest.php
@@ -15,14 +15,13 @@ namespace Tests\CarbonImmutable;
 
 use BadMethodCallException;
 use Carbon\CarbonImmutable as Carbon;
+use PHPUnit\Framework\Attributes\RequiresPhp;
 use Tests\AbstractTestCaseWithOldNow;
 use Throwable;
 
 class GenericMacroTest extends AbstractTestCaseWithOldNow
 {
-    /**
-     * @requires PHP < 8.0
-     */
+    #[RequiresPhp('< 8.0')]
     public function testGenericMacroBinding()
     {
         Carbon::genericMacro(function ($method) {
diff --git a/tests/CarbonImmutable/GettersTest.php b/tests/CarbonImmutable/GettersTest.php
index 553d441..2d13104 100644
--- a/tests/CarbonImmutable/GettersTest.php
+++ b/tests/CarbonImmutable/GettersTest.php
@@ -15,6 +15,7 @@ namespace Tests\CarbonImmutable;
 
 use Carbon\CarbonImmutable as Carbon;
 use InvalidArgumentException;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Tests\AbstractTestCase;
 
 class GettersTest extends AbstractTestCase
@@ -185,11 +186,10 @@ class GettersTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\CarbonImmutable\GettersTest::dataForTestQuarter
-     *
      * @param int $month
      * @param int $quarter
      */
+    #[DataProvider('dataForTestQuarter')]
     public function testQuarterFirstOfMonth($month, $quarter)
     {
         $c = Carbon::create(2015, $month, 1)->startOfMonth();
@@ -197,11 +197,10 @@ class GettersTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\CarbonImmutable\GettersTest::dataForTestQuarter
-     *
      * @param int $month
      * @param int $quarter
      */
+    #[DataProvider('dataForTestQuarter')]
     public function testQuarterMiddleOfMonth($month, $quarter)
     {
         $c = Carbon::create(2015, $month, 15, 12, 13, 14);
@@ -209,11 +208,10 @@ class GettersTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\CarbonImmutable\GettersTest::dataForTestQuarter
-     *
      * @param int $month
      * @param int $quarter
      */
+    #[DataProvider('dataForTestQuarter')]
     public function testQuarterLastOfMonth($month, $quarter)
     {
         $c = Carbon::create(2015, $month, 1)->endOfMonth();
diff --git a/tests/CarbonImmutable/IsTest.php b/tests/CarbonImmutable/IsTest.php
index bcf5cc9..e232e9a 100644
--- a/tests/CarbonImmutable/IsTest.php
+++ b/tests/CarbonImmutable/IsTest.php
@@ -17,6 +17,7 @@ use Carbon\CarbonImmutable as Carbon;
 use DateTime;
 use Generator;
 use InvalidArgumentException;
+use PHPUnit\Framework\Attributes\DataProvider;
 use stdClass;
 use Tests\AbstractTestCase;
 
@@ -954,9 +955,7 @@ class IsTest extends AbstractTestCase
         yield ['r'];
     }
 
-    /**
-     * @dataProvider \Tests\CarbonImmutable\IsTest::dataForFormatLetters
-     */
+    #[DataProvider('dataForFormatLetters')]
     public function testHasFormatWithSingleLetter($letter)
     {
         $output = Carbon::now()->format($letter);
diff --git a/tests/CarbonImmutable/IssetTest.php b/tests/CarbonImmutable/IssetTest.php
index 9f84d0a..e4a1a15 100644
--- a/tests/CarbonImmutable/IssetTest.php
+++ b/tests/CarbonImmutable/IssetTest.php
@@ -15,6 +15,7 @@ namespace Tests\CarbonImmutable;
 
 use Carbon\CarbonImmutable as Carbon;
 use Generator;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Tests\AbstractTestCase;
 
 class IssetTest extends AbstractTestCase
@@ -94,10 +95,9 @@ class IssetTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\CarbonImmutable\IssetTest::dataForTestIssetReturnTrueForProperties
-     *
      * @param string $property
      */
+    #[DataProvider('dataForTestIssetReturnTrueForProperties')]
     public function testIssetReturnTrueForProperties(string $property): void
     {
         Carbon::useStrictMode(false);
diff --git a/tests/CarbonImmutable/LocalizationTest.php b/tests/CarbonImmutable/LocalizationTest.php
index 9d3a338..5d0f6c9 100644
--- a/tests/CarbonImmutable/LocalizationTest.php
+++ b/tests/CarbonImmutable/LocalizationTest.php
@@ -19,6 +19,7 @@ use Carbon\Exceptions\NotLocaleAwareException;
 use Carbon\Language;
 use Carbon\Translator;
 use InvalidArgumentException;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Symfony\Component\Translation\IdentityTranslator;
 use Symfony\Component\Translation\Loader\ArrayLoader;
 use Symfony\Component\Translation\MessageCatalogue;
@@ -317,10 +318,9 @@ class LocalizationTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\CarbonImmutable\LocalizationTest::dataForLocales
-     *
      * @param string $locale
      */
+    #[DataProvider('dataForLocales')]
     public function testSetLocale($locale)
     {
         $this->assertTrue(Carbon::setLocale($locale));
@@ -328,10 +328,9 @@ class LocalizationTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\CarbonImmutable\LocalizationTest::dataForLocales
-     *
      * @param string $locale
      */
+    #[DataProvider('dataForLocales')]
     public function testSetTranslator($locale)
     {
         $ori = Carbon::getTranslator();
@@ -371,10 +370,9 @@ class LocalizationTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\CarbonImmutable\LocalizationTest::dataForTestSetLocaleWithMalformedLocale
-     *
      * @param string $malformedLocale
      */
+    #[DataProvider('dataForTestSetLocaleWithMalformedLocale')]
     public function testSetLocaleWithMalformedLocale($malformedLocale)
     {
         $this->assertTrue(Carbon::setLocale($malformedLocale));
diff --git a/tests/CarbonImmutable/ModifyNearDSTChangeTest.php b/tests/CarbonImmutable/ModifyNearDSTChangeTest.php
index cf3a6c4..13268df 100644
--- a/tests/CarbonImmutable/ModifyNearDSTChangeTest.php
+++ b/tests/CarbonImmutable/ModifyNearDSTChangeTest.php
@@ -15,6 +15,7 @@ namespace Tests\CarbonImmutable;
 
 use Carbon\CarbonImmutable as Carbon;
 use Generator;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Tests\AbstractTestCase;
 
 class ModifyNearDSTChangeTest extends AbstractTestCase
@@ -25,9 +26,8 @@ class ModifyNearDSTChangeTest extends AbstractTestCase
      * @param string $dateString
      * @param int    $addHours
      * @param string $expected
-     *
-     * @dataProvider \Tests\CarbonImmutable\ModifyNearDSTChangeTest::dataForTransitionTests
      */
+    #[DataProvider('dataForTransitionTests')]
     public function testTransitionInNonDefaultTimezone($dateString, $addHours, $expected)
     {
         date_default_timezone_set('Europe/london');
@@ -42,9 +42,8 @@ class ModifyNearDSTChangeTest extends AbstractTestCase
      * @param string $dateString
      * @param int    $addHours
      * @param string $expected
-     *
-     * @dataProvider \Tests\CarbonImmutable\ModifyNearDSTChangeTest::dataForTransitionTests
      */
+    #[DataProvider('dataForTransitionTests')]
     public function testTransitionInDefaultTimezone($dateString, $addHours, $expected)
     {
         date_default_timezone_set('America/New_York');
diff --git a/tests/CarbonImmutable/SerializationTest.php b/tests/CarbonImmutable/SerializationTest.php
index 2db1162..0f86af2 100644
--- a/tests/CarbonImmutable/SerializationTest.php
+++ b/tests/CarbonImmutable/SerializationTest.php
@@ -16,6 +16,7 @@ namespace Tests\CarbonImmutable;
 use Carbon\CarbonImmutable as Carbon;
 use DateTimeImmutable;
 use InvalidArgumentException;
+use PHPUnit\Framework\Attributes\DataProvider;
 use ReflectionClass;
 use ReflectionObject;
 use ReflectionProperty;
@@ -81,9 +82,8 @@ class SerializationTest extends AbstractTestCase
 
     /**
      * @param mixed $value
-     *
-     * @dataProvider \Tests\CarbonImmutable\SerializationTest::dataForTestFromUnserializedWithInvalidValue
      */
+    #[DataProvider('dataForTestFromUnserializedWithInvalidValue')]
     public function testFromUnserializedWithInvalidValue($value)
     {
         $this->expectExceptionObject(new InvalidArgumentException(
diff --git a/tests/CarbonImmutable/SettersTest.php b/tests/CarbonImmutable/SettersTest.php
index 5e786f0..5ef42ff 100644
--- a/tests/CarbonImmutable/SettersTest.php
+++ b/tests/CarbonImmutable/SettersTest.php
@@ -16,6 +16,7 @@ namespace Tests\CarbonImmutable;
 use Carbon\CarbonImmutable as Carbon;
 use DateTimeZone;
 use InvalidArgumentException;
+use PHPUnit\Framework\Attributes\DataProvider;
 use RuntimeException;
 use Tests\AbstractTestCase;
 
@@ -342,13 +343,12 @@ class SettersTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\CarbonImmutable\SettersTest::dataForTestSetTimeFromTimeString
-     *
      * @param int    $hour
      * @param int    $minute
      * @param int    $second
      * @param string $time
      */
+    #[DataProvider('dataForTestSetTimeFromTimeString')]
     public function testSetTimeFromTimeString($hour, $minute, $second, $time)
     {
         Carbon::setTestNow(Carbon::create(2016, 2, 12, 1, 2, 3));
diff --git a/tests/CarbonImmutable/StartEndOfTest.php b/tests/CarbonImmutable/StartEndOfTest.php
index 73bdf05..419d1fe 100644
--- a/tests/CarbonImmutable/StartEndOfTest.php
+++ b/tests/CarbonImmutable/StartEndOfTest.php
@@ -14,6 +14,7 @@ declare(strict_types=1);
 namespace Tests\CarbonImmutable;
 
 use Carbon\CarbonImmutable as Carbon;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Tests\AbstractTestCase;
 
 class StartEndOfTest extends AbstractTestCase
@@ -377,11 +378,10 @@ class StartEndOfTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\CarbonImmutable\StartEndOfTest::dataForTestStartOfQuarter
-     *
      * @param int $month
      * @param int $startOfQuarterMonth
      */
+    #[DataProvider('dataForTestStartOfQuarter')]
     public function testStartOfQuarter($month, $startOfQuarterMonth)
     {
         $dt = Carbon::create(2015, $month, 15, 1, 2, 3);
@@ -413,12 +413,11 @@ class StartEndOfTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\CarbonImmutable\StartEndOfTest::dataForTestEndOfQuarter
-     *
      * @param int $month
      * @param int $endOfQuarterMonth
      * @param int $endOfQuarterDay
      */
+    #[DataProvider('dataForTestEndOfQuarter')]
     public function testEndOfQuarter($month, $endOfQuarterMonth, $endOfQuarterDay)
     {
         $dt = Carbon::create(2015, $month, 15, 1, 2, 3);
diff --git a/tests/CarbonImmutable/WeekTest.php b/tests/CarbonImmutable/WeekTest.php
index 4c7af11..42a1e45 100644
--- a/tests/CarbonImmutable/WeekTest.php
+++ b/tests/CarbonImmutable/WeekTest.php
@@ -15,6 +15,7 @@ namespace Tests\CarbonImmutable;
 
 use Carbon\CarbonImmutable as Carbon;
 use Carbon\CarbonInterface;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Tests\AbstractTestCase;
 
 class WeekTest extends AbstractTestCase
@@ -5432,9 +5433,7 @@ class WeekTest extends AbstractTestCase
         $this->assertSame(CarbonInterface::MONDAY, $date->isoWeekday());
     }
 
-    /**
-     * @dataProvider getDaysFromStartOfWeekDataProvider
-     */
+    #[DataProvider('getDaysFromStartOfWeekDataProvider')]
     public function testGetDaysFromStartOfWeek(string $locale, string $date, int $daysCount)
     {
         $this->assertSame(
@@ -5467,9 +5466,7 @@ class WeekTest extends AbstractTestCase
         ];
     }
 
-    /**
-     * @dataProvider getDaysFromStartOfWeekDataProviderExplicit
-     */
+    #[DataProvider('getDaysFromStartOfWeekDataProviderExplicit')]
     public function testGetDaysFromStartOfWeekExplicit(int $start, string $date, int $daysCount)
     {
         static $locales = [null, 'pt_BR', 'de_CH', 'ar_MA'];
diff --git a/tests/CarbonInterval/AddTest.php b/tests/CarbonInterval/AddTest.php
index 6064fff..0bcc3a2 100644
--- a/tests/CarbonInterval/AddTest.php
+++ b/tests/CarbonInterval/AddTest.php
@@ -20,6 +20,7 @@ use DateTime;
 use DateTimeImmutable;
 use Generator;
 use InvalidArgumentException;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Tests\AbstractTestCase;
 
 class AddTest extends AbstractTestCase
@@ -131,12 +132,11 @@ class AddTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\CarbonInterval\AddTest::dataForAddsResults
-     *
      * @param int $base
      * @param int $increment
      * @param int $expectedResult
      */
+    #[DataProvider('dataForAddsResults')]
     public function testAddSign($base, $increment, $expectedResult)
     {
         $interval = new CarbonInterval();
diff --git a/tests/CarbonInterval/CascadeTest.php b/tests/CarbonInterval/CascadeTest.php
index fe235f5..335ed34 100644
--- a/tests/CarbonInterval/CascadeTest.php
+++ b/tests/CarbonInterval/CascadeTest.php
@@ -16,6 +16,7 @@ namespace Tests\CarbonInterval;
 use Carbon\Carbon;
 use Carbon\CarbonInterval;
 use Generator;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Tests\AbstractTestCase;
 
 class CascadeTest extends AbstractTestCase
@@ -33,9 +34,7 @@ class CascadeTest extends AbstractTestCase
         );
     }
 
-    /**
-     * @dataProvider \Tests\CarbonInterval\CascadeTest::dataForIntervalSpecs
-     */
+    #[DataProvider('dataForIntervalSpecs')]
     public function testCascadesOverflowedValues($spec, $expected)
     {
         $interval = CarbonInterval::fromString($spec)->cascade();
@@ -55,10 +54,9 @@ class CascadeTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\CarbonInterval\CascadeTest::dataForMixedSignsIntervalSpecs
-     *
      * @throws \Exception
      */
+    #[DataProvider('dataForMixedSignsIntervalSpecs')]
     public function testMixedSignsCascadesOverflowedValues($units, $expected, $expectingInversion)
     {
         $interval = new CarbonInterval(0);
@@ -218,9 +216,7 @@ class CascadeTest extends AbstractTestCase
         $this->assertSame(43012, $interval->microseconds);
     }
 
-    /**
-     * @dataProvider \Tests\CarbonInterval\CascadeTest::dataForCustomIntervalSpecs
-     */
+    #[DataProvider('dataForCustomIntervalSpecs')]
     public function testCustomCascadesOverflowedValues($spec, $expected)
     {
         $cascades = CarbonInterval::getCascadeFactors();
@@ -245,9 +241,7 @@ class CascadeTest extends AbstractTestCase
         yield ['2y 123mo 5w 6d 47h 160m 217s', '2yrs 123mos 7w 2d 1h 43m 37s'];
     }
 
-    /**
-     * @dataProvider \Tests\CarbonInterval\CascadeTest::dataForCustomIntervalSpecsLongFormat
-     */
+    #[DataProvider('dataForCustomIntervalSpecsLongFormat')]
     public function testCustomCascadesOverflowedValuesLongFormat($spec, $expected)
     {
         $cascades = CarbonInterval::getCascadeFactors();
diff --git a/tests/CarbonInterval/FromStringTest.php b/tests/CarbonInterval/FromStringTest.php
index de79a0a..5a745e1 100644
--- a/tests/CarbonInterval/FromStringTest.php
+++ b/tests/CarbonInterval/FromStringTest.php
@@ -16,16 +16,16 @@ namespace Tests\CarbonInterval;
 use Carbon\CarbonInterval;
 use Generator;
 use InvalidArgumentException;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Tests\AbstractTestCase;
 
 class FromStringTest extends AbstractTestCase
 {
     /**
-     * @dataProvider \Tests\CarbonInterval\FromStringTest::dataForValidStrings
-     *
      * @param string         $string
      * @param CarbonInterval $expected
      */
+    #[DataProvider('dataForValidStrings')]
     public function testReturnsInterval($string, $expected)
     {
         $result = CarbonInterval::fromString($string);
@@ -114,11 +114,10 @@ class FromStringTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\CarbonInterval\FromStringTest::dataForInvalidStrings
-     *
      * @param string $string
      * @param string $part
      */
+    #[DataProvider('dataForInvalidStrings')]
     public function testThrowsExceptionForUnknownValues($string, $part)
     {
         $message = null;
diff --git a/tests/CarbonInterval/ParseFromLocaleTest.php b/tests/CarbonInterval/ParseFromLocaleTest.php
index 342369b..99a85d4 100644
--- a/tests/CarbonInterval/ParseFromLocaleTest.php
+++ b/tests/CarbonInterval/ParseFromLocaleTest.php
@@ -16,18 +16,18 @@ namespace Tests\CarbonInterval;
 use Carbon\CarbonInterval;
 use Generator;
 use InvalidArgumentException;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Tests\AbstractTestCase;
 
 class ParseFromLocaleTest extends AbstractTestCase
 {
     /**
-     * @dataProvider \Tests\CarbonInterval\ParseFromLocaleTest::dataForValidStrings
-     *
      * @param string         $string
      * @param string         $locale
      * @param CarbonInterval $expected
      */
-    public function testReturnsInterval($string, $locale, $expected)
+    #[DataProvider('dataForValidStrings')]
+     public function testReturnsInterval($string, $locale, $expected)
     {
         $result = CarbonInterval::parseFromLocale($string, $locale);
 
@@ -112,12 +112,11 @@ class ParseFromLocaleTest extends AbstractTestCase
     }
 
     /**
-     * @dataProvider \Tests\CarbonInterval\ParseFromLocaleTest::dataForInvalidStrings
-     *
      * @param string $string
      * @param string $part
      * @param string $locale
      */
+    #[DataProvider('dataForInvalidStrings')]
     public function testThrowsExceptionForUnknownValues($string, $part, $locale)
     {
         $message = null;
diff --git a/tests/CarbonInterval/ToPeriodTest.php b/tests/CarbonInterval/ToPeriodTest.php
index 2cbf232..2fef511 100644
--- a/tests/CarbonInterval/ToPeriodTest.php
+++ b/tests/CarbonInterval/ToPeriodTest.php
@@ -17,13 +17,12 @@ use Carbon\Carbon;
 use Carbon\CarbonInterval;
 use Carbon\CarbonPeriod;
 use Generator;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Tests\AbstractTestCase;
 
 class ToPeriodTest extends AbstractTestCase
 {
-    /**
-     * @dataProvider \Tests\CarbonInterval\ToPeriodTest::dataForToPeriodParameters
-     */
+    #[DataProvider('dataForToPeriodParameters')]
     public function testConvertToDatePeriod($interval, $arguments, $expected)
     {
         $period = ([$interval, 'toPeriod'])(...$arguments);
diff --git a/tests/CarbonInterval/TotalTest.php b/tests/CarbonInterval/TotalTest.php
index 2c4ce03..a412e37 100644
--- a/tests/CarbonInterval/TotalTest.php
+++ b/tests/CarbonInterval/TotalTest.php
@@ -17,13 +17,13 @@ use Carbon\Carbon;
 use Carbon\CarbonInterval;
 use Generator;
 use InvalidArgumentException;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Tests\AbstractTestCase;
 
 class TotalTest extends AbstractTestCase
 {
-    /**
-     * @dataProvider \Tests\CarbonInterval\TotalTest::dataForIntervalSpecs
-     */
+
+    #[DataProvider('dataForIntervalSpecs')]
     public function testReturnsTotalValue($spec, $unit, $expected)
     {
         $this->assertSame(
@@ -94,9 +94,8 @@ class TotalTest extends AbstractTestCase
         yield [1, CarbonInterval::hours(0)->hours(-150)->invert()];
     }
 
-    /**
-     * @dataProvider \Tests\CarbonInterval\TotalTest::dataForNegativeIntervals
-     */
+
+    #[DataProvider('dataForNegativeIntervals')]
     public function testGetNegativeTotalsViaGetters($factor, $interval)
     {
         $this->assertSame($factor * 150 * 60 * 60 * 1000 * 1000, $interval->totalMicroseconds);
diff --git a/tests/CarbonPeriod/CreateTest.php b/tests/CarbonPeriod/CreateTest.php
index 7f80812..7ac5243 100644
--- a/tests/CarbonPeriod/CreateTest.php
+++ b/tests/CarbonPeriod/CreateTest.php
@@ -25,14 +25,13 @@ use DatePeriod;
 use DateTime;
 use Generator;
 use InvalidArgumentException;
+use PHPUnit\Framework\Attributes\DataProvider;
 use stdClass;
 use Tests\AbstractTestCase;
 
 class CreateTest extends AbstractTestCase
 {
-    /**
-     * @dataProvider \Tests\CarbonPeriod\CreateTest::dataForIso8601String
-     */
+    #[DataProvider('dataForIso8601String')]
     public function testCreateFromIso8601String($arguments, $expected)
     {
         $periodClass = static::$periodClass;
@@ -91,9 +90,7 @@ class CreateTest extends AbstractTestCase
         $this->assertInfinite($period->getRecurrences());
     }
 
-    /**
-     * @dataProvider \Tests\CarbonPeriod\CreateTest::dataForPartialIso8601String
-     */
+    #[DataProvider('dataForPartialIso8601String')]
     public function testCreateFromPartialIso8601String($iso, $from, $to)
     {
         $periodClass = static::$periodClass;
@@ -118,9 +115,7 @@ class CreateTest extends AbstractTestCase
         yield ['2007-12-14T13:30/15:30', '2007-12-14 13:30', '2007-12-14 15:30'];
     }
 
-    /**
-     * @dataProvider \Tests\CarbonPeriod\CreateTest::dataForInvalidIso8601String
-     */
+    #[DataProvider('dataForInvalidIso8601String')]
     public function testCreateFromInvalidIso8601String($iso)
     {
         $this->expectExceptionObject(new InvalidArgumentException(
@@ -141,9 +136,7 @@ class CreateTest extends AbstractTestCase
         yield ['/'];
     }
 
-    /**
-     * @dataProvider \Tests\CarbonPeriod\CreateTest::dataForStartDateAndEndDate
-     */
+    #[DataProvider('dataForStartDateAndEndDate')]
     public function testCreateFromStartDateAndEndDate($arguments, $expected)
     {
         $periodClass = static::$periodClass;
@@ -196,9 +189,7 @@ class CreateTest extends AbstractTestCase
             ];
     }
 
-    /**
-     * @dataProvider \Tests\CarbonPeriod\CreateTest::dataForStartDateAndIntervalAndEndDate
-     */
+    #[DataProvider('dataForStartDateAndIntervalAndEndDate')]
     public function testCreateFromStartDateAndIntervalAndEndDate($arguments, $expected)
     {
         $periodClass = static::$periodClass;
@@ -257,9 +248,7 @@ class CreateTest extends AbstractTestCase
         ];
     }
 
-    /**
-     * @dataProvider \Tests\CarbonPeriod\CreateTest::dataForStartDateAndIntervalAndRecurrences
-     */
+    #[DataProvider('dataForStartDateAndIntervalAndRecurrences')]
     public function testCreateFromStartDateAndIntervalAndRecurrences($arguments, $expected)
     {
         $periodClass = static::$periodClass;
@@ -288,9 +277,7 @@ class CreateTest extends AbstractTestCase
         ];
     }
 
-    /**
-     * @dataProvider \Tests\CarbonPeriod\CreateTest::dataForStartDateAndRecurrences
-     */
+    #[DataProvider('dataForStartDateAndRecurrences')]
     public function testCreateFromStartDateAndRecurrences($arguments, $expected)
     {
         $periodClass = static::$periodClass;
@@ -345,9 +332,7 @@ class CreateTest extends AbstractTestCase
         );
     }
 
-    /**
-     * @dataProvider \Tests\CarbonPeriod\CreateTest::dataForInvalidParameters
-     */
+    #[DataProvider('dataForInvalidParameters')]
     public function testCreateFromInvalidParameters(...$arguments)
     {
         $this->expectExceptionObject(new InvalidArgumentException(
diff --git a/tests/CarbonPeriod/IteratorTest.php b/tests/CarbonPeriod/IteratorTest.php
index 62b9d25..973b0b7 100644
--- a/tests/CarbonPeriod/IteratorTest.php
+++ b/tests/CarbonPeriod/IteratorTest.php
@@ -17,6 +17,7 @@ use Carbon\Carbon;
 use Carbon\CarbonInterval;
 use Carbon\CarbonPeriod;
 use Generator;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Tests\AbstractTestCase;
 use Tests\CarbonPeriod\Fixtures\CarbonPeriodFactory;
 
@@ -111,9 +112,7 @@ class IteratorTest extends AbstractTestCase
         $this->assertFalse($period->valid());
     }
 
-    /**
-     * @dataProvider dataForIterateBackwardsArguments
-     */
+    #[DataProvider('dataForIterateBackwardsArguments')]
     public function testIterateBackwards($arguments, $expected)
     {
         $periodClass = static::$periodClass;
diff --git a/tests/CarbonPeriod/ToStringTest.php b/tests/CarbonPeriod/ToStringTest.php
index 178efca..652546f 100644
--- a/tests/CarbonPeriod/ToStringTest.php
+++ b/tests/CarbonPeriod/ToStringTest.php
@@ -18,13 +18,12 @@ use Carbon\CarbonImmutable;
 use Carbon\CarbonInterval;
 use Carbon\CarbonPeriod;
 use Generator;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Tests\AbstractTestCase;
 
 class ToStringTest extends AbstractTestCase
 {
-    /**
-     * @dataProvider \Tests\CarbonPeriod\ToStringTest::dataForToString
-     */
+    #[DataProvider('dataForToString')]
     public function testToString($period, $expected)
     {
         $this->assertSame(
@@ -92,9 +91,7 @@ class ToStringTest extends AbstractTestCase
         );
     }
 
-    /**
-     * @dataProvider \Tests\CarbonPeriod\ToStringTest::dataForToIso8601String
-     */
+    #[DataProvider('dataForToIso8601String')]
     public function testToIso8601String($period, $expected)
     {
         $this->assertSame(
diff --git a/tests/CarbonTimeZone/ConversionsTest.php b/tests/CarbonTimeZone/ConversionsTest.php
index 2cbd43f..8a85774 100644
--- a/tests/CarbonTimeZone/ConversionsTest.php
+++ b/tests/CarbonTimeZone/ConversionsTest.php
@@ -18,6 +18,7 @@ use Carbon\CarbonTimeZone;
 use DateTimeZone;
 use Generator;
 use InvalidArgumentException;
+use PHPUnit\Framework\Attributes\DataProvider;
 use stdClass;
 use Tests\AbstractTestCaseWithOldNow;
 
@@ -82,9 +83,8 @@ class ConversionsTest extends AbstractTestCaseWithOldNow
      * @param string     $date
      * @param string     $expectedOffset
      * @param string|int $timezone
-     *
-     * @dataProvider \Tests\CarbonTimeZone\ConversionsTest::dataForToOffsetName
      */
+    #[DataProvider('dataForToOffsetName')]
     public function testToOffsetName($date, $expectedOffset, $timezone)
     {
         Carbon::setTestNow(Carbon::parse($date));
@@ -97,9 +97,8 @@ class ConversionsTest extends AbstractTestCaseWithOldNow
      * @param string     $date
      * @param string     $expectedOffset
      * @param string|int $timezone
-     *
-     * @dataProvider \Tests\CarbonTimeZone\ConversionsTest::dataForToOffsetName
      */
+    #[DataProvider('dataForToOffsetName')]
     public function testToOffsetNameDateAsParam($date, $expectedOffset, $timezone)
     {
         $offset = (new CarbonTimeZone($timezone))->toOffsetName(Carbon::parse($date));
diff --git a/tests/CommonTraits/MacroContextNestingTest.php b/tests/CommonTraits/MacroContextNestingTest.php
index b921778..d98a908 100644
--- a/tests/CommonTraits/MacroContextNestingTest.php
+++ b/tests/CommonTraits/MacroContextNestingTest.php
@@ -18,6 +18,7 @@ use Carbon\CarbonImmutable;
 use Carbon\CarbonInterval;
 use Carbon\CarbonPeriod;
 use Generator;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Tests\AbstractTestCaseWithOldNow;
 
 class MacroContextNestingTest extends AbstractTestCaseWithOldNow
@@ -31,12 +32,11 @@ class MacroContextNestingTest extends AbstractTestCaseWithOldNow
     }
 
     /**
-     * @dataProvider \Tests\CommonTraits\MacroContextNestingTest::dataForMacroableClasses
-     *
      * @param string      $class
      * @param mixed       $sample
      * @param string|null $reference
      */
+    #[DataProvider('dataForMacroableClasses')]
     public function testMacroContextNesting($class, $sample, $reference)
     {
         $macro1 = 'macro'.(mt_rand(100, 999999) * 2);
@@ -64,12 +64,11 @@ class MacroContextNestingTest extends AbstractTestCaseWithOldNow
     }
 
     /**
-     * @dataProvider \Tests\CommonTraits\MacroContextNestingTest::dataForMacroableClasses
-     *
      * @param string $class
      * @param mixed  $sample
      */
-    public function testMacroContextDetectionNesting($class, $sample)
+    #[DataProvider('dataForMacroableClasses')]
+    public function testMacroContextDetectionNesting($class, $sample, $reference)
     {
         $macro1 = 'macro'.(mt_rand(100, 999999) * 2);
         $class::macro($macro1, static function () {
diff --git a/tests/Doctrine/CarbonTypesTest.php b/tests/Doctrine/CarbonTypesTest.php
index fd7e6ad..48ac0f5 100644
--- a/tests/Doctrine/CarbonTypesTest.php
+++ b/tests/Doctrine/CarbonTypesTest.php
@@ -28,6 +28,7 @@ use Doctrine\DBAL\Platforms\MySQLPlatform;
 use Doctrine\DBAL\Types\ConversionException;
 use Doctrine\DBAL\Types\Type;
 use Exception;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Tests\AbstractTestCase;
 
 class CarbonTypesTest extends AbstractTestCase
@@ -60,11 +61,10 @@ class CarbonTypesTest extends AbstractTestCase
      *
      * @param string $name
      *
-     * @dataProvider \Tests\Doctrine\CarbonTypesTest::dataForTypes
-     *
      * @throws Exception
      */
-    public function testGetSQLDeclaration(string $name)
+    #[DataProvider('dataForTypes')]
+    public function testGetSQLDeclaration(string $name, string $class, string $typeClass, bool $hintRequired)
     {
         $type = Type::getType($name);
 
@@ -135,11 +135,10 @@ class CarbonTypesTest extends AbstractTestCase
      * @param string $name
      * @param string $class
      *
-     * @dataProvider \Tests\Doctrine\CarbonTypesTest::dataForTypes
-     *
      * @throws Exception
      */
-    public function testConvertToPHPValue(string $name, string $class)
+    #[DataProvider('dataForTypes')]
+    public function testConvertToPHPValue(string $name, string $class, string $typeClass, bool $hintRequired)
     {
         $type = Type::getType($name);
 
@@ -164,11 +163,10 @@ class CarbonTypesTest extends AbstractTestCase
      * @param string $name
      * @param string $class
      *
-     * @dataProvider \Tests\Doctrine\CarbonTypesTest::dataForTypes
-     *
      * @throws Exception
      */
-    public function testConvertToPHPValueFailure(string $name, string $class, string $typeClass)
+    #[DataProvider('dataForTypes')]
+    public function testConvertToPHPValueFailure(string $name, string $class, string $typeClass, bool $hintRequired)
     {
         $conversion = version_compare(self::getDbalVersion(), '4.0.0', '>=')
             ? "to \"$typeClass\" as an error was triggered by the unserialization: "
@@ -186,11 +184,10 @@ class CarbonTypesTest extends AbstractTestCase
      *
      * @param string $name
      *
-     * @dataProvider \Tests\Doctrine\CarbonTypesTest::dataForTypes
-     *
      * @throws Exception
      */
-    public function testConvertToDatabaseValue(string $name)
+    #[DataProvider('dataForTypes')]
+    public function testConvertToDatabaseValue(string $name, string $class, string $typeClass, bool $hintRequired)
     {
         $type = Type::getType($name);
 
@@ -206,11 +203,10 @@ class CarbonTypesTest extends AbstractTestCase
      *
      * @param string $name
      *
-     * @dataProvider \Tests\Doctrine\CarbonTypesTest::dataForTypes
-     *
      * @throws Exception
      */
-    public function testConvertToDatabaseValueFailure(string $name, string $class, string $typeClass)
+    #[DataProvider('dataForTypes')]
+    public function testConvertToDatabaseValueFailure(string $name, string $class, string $typeClass, bool $hintRequired)
     {
         $quote = class_exists('Doctrine\\DBAL\\Version') ? "'" : '';
         $conversion = version_compare(self::getDbalVersion(), '4.0.0', '>=')
@@ -232,10 +228,9 @@ class CarbonTypesTest extends AbstractTestCase
      * @param string $typeClass
      * @param bool   $hintRequired
      *
-     * @dataProvider \Tests\Doctrine\CarbonTypesTest::dataForTypes
-     *
      * @throws Exception
      */
+    #[DataProvider('dataForTypes')]
     public function testRequiresSQLCommentHint(string $name, string $class, string $typeClass, bool $hintRequired)
     {
         if (version_compare(self::getDbalVersion(), '4.0.0', '>=')) {
diff --git a/tests/Laravel/ServiceProviderTest.php b/tests/Laravel/ServiceProviderTest.php
index c9d3100..ff289a2 100644
--- a/tests/Laravel/ServiceProviderTest.php
+++ b/tests/Laravel/ServiceProviderTest.php
@@ -23,6 +23,7 @@ use Illuminate\Events\Dispatcher;
 use Illuminate\Events\EventDispatcher;
 use Illuminate\Support\Carbon as SupportCarbon;
 use Illuminate\Support\Facades\Date;
+use PHPUnit\Framework\Attributes\DataProvider;
 use PHPUnit\Framework\TestCase;
 use stdClass;
 
@@ -42,9 +43,7 @@ class ServiceProviderTest extends TestCase
         yield [new EventDispatcher()];
     }
 
-    /**
-     * @dataProvider \Tests\Laravel\ServiceProviderTest::dataForDispatchers
-     */
+    #[DataProvider('dataForDispatchers')]
     public function testBoot($dispatcher)
     {
         // Reset language