File: 0007-Modernize-PHPUnit-syntax.patch

package info (click to toggle)
php-phpseclib3 3.0.46-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,528 kB
  • sloc: php: 30,756; xml: 392; makefile: 21
file content (974 lines) | stat: -rw-r--r-- 33,860 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
From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit@debian.org>
Date: Sun, 16 Feb 2025 12:39:55 +0100
Subject: Modernize PHPUnit syntax

---
 tests/Functional/Net/SFTPUserStoryTest.php | 47 ++++++++++++++++++++++++++++++
 tests/Functional/Net/SSH2AgentTest.php     |  2 ++
 tests/Functional/Net/SSH2Test.php          | 18 ++++++++++++
 tests/Unit/Crypt/AES/TestCase.php          |  4 +++
 tests/Unit/Crypt/BlowfishTest.php          |  2 ++
 tests/Unit/Crypt/DSA/CreateKeyTest.php     |  2 ++
 tests/Unit/Crypt/EC/CurveTest.php          |  7 +++++
 tests/Unit/Crypt/GCMTest.php               |  3 ++
 tests/Unit/Crypt/HashTest.php              |  7 +++++
 tests/Unit/Crypt/RC2Test.php               |  2 ++
 tests/Unit/Crypt/RC4Test.php               |  2 ++
 tests/Unit/Crypt/RSA/CreateKeyTest.php     |  2 ++
 tests/Unit/Crypt/RSA/LoadKeyTest.php       |  1 +
 tests/Unit/Crypt/RandomTest.php            |  2 ++
 tests/Unit/Crypt/Salsa20Test.php           |  2 ++
 tests/Unit/Crypt/TripleDESTest.php         |  4 +++
 tests/Unit/Net/SSH2UnitTest.php            | 21 +++++++++++++
 17 files changed, 128 insertions(+)

diff --git a/tests/Functional/Net/SFTPUserStoryTest.php b/tests/Functional/Net/SFTPUserStoryTest.php
index 650209c..86dd611 100644
--- a/tests/Functional/Net/SFTPUserStoryTest.php
+++ b/tests/Functional/Net/SFTPUserStoryTest.php
@@ -10,6 +10,8 @@ namespace phpseclib3\Tests\Functional\Net;
 
 use phpseclib3\Net\SFTP;
 use phpseclib3\Tests\PhpseclibFunctionalTestCase;
+use PHPUnit\Framework\Attributes\Depends;
+use PHPUnit\Framework\Attributes\Group;
 
 class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
 {
@@ -41,6 +43,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testConstructor */
+    #[Depends('testConstructor')]
     public function testPasswordLogin($sftp)
     {
         $username = $this->getEnv('SSH_USERNAME');
@@ -54,6 +57,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testPasswordLogin */
+    #[Depends('testPasswordLogin')]
     public function testPwdHome($sftp)
     {
         $this->assertEquals(
@@ -66,6 +70,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testPwdHome */
+    #[Depends('testPwdHome')]
     public function testMkDirScratch($sftp)
     {
         $dirname = self::$scratchDir;
@@ -86,6 +91,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testMkDirScratch */
+    #[Depends('testMkDirScratch')]
     public function testChDirScratch($sftp)
     {
         $this->assertTrue(
@@ -117,6 +123,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testChDirScratch */
+    #[Depends('testChDirScratch')]
     public function testStatOnDir($sftp)
     {
         $this->assertNotSame(
@@ -139,6 +146,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testStatOnDir */
+    #[Depends('testStatOnDir')]
     public function testPutSizeGetFile($sftp)
     {
         $this->assertTrue(
@@ -179,6 +187,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testStatOnDir */
+    #[Depends('testStatOnDir')]
     public function testPutSizeGetFileCallback($sftp)
     {
         self::$buffer = self::$exampleData;
@@ -203,6 +212,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testPutSizeGetFile */
+    #[Depends('testPutSizeGetFile')]
     public function testTouch($sftp)
     {
         $this->assertTrue(
@@ -219,6 +229,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testTouch */
+    #[Depends('testTouch')]
     public function testTruncate($sftp)
     {
         $this->assertTrue(
@@ -244,6 +255,8 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
      * @group github850
      */
     /** @depends testTruncate */
+    #[Depends('testTruncate')]
+    #[Group('github850')]
     public function testChModOnFile($sftp)
     {
         $this->assertNotFalse(
@@ -255,6 +268,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testChModOnFile */
+    #[Depends('testChModOnFile')]
     public function testChDirOnFile($sftp)
     {
         $this->assertFalse(
@@ -266,6 +280,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testChDirOnFile */
+    #[Depends('testChDirOnFile')]
     public function testFileExistsIsFileIsDirFile($sftp)
     {
         $this->assertTrue(
@@ -287,6 +302,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testFileExistsIsFileIsDirFile */
+    #[Depends('testFileExistsIsFileIsDirFile')]
     public function testFileExistsIsFileIsDirFileNonexistent($sftp)
     {
         $this->assertFalse(
@@ -308,6 +324,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testFileExistsIsFileIsDirFileNonexistent */
+    #[Depends('testFileExistsIsFileIsDirFileNonexistent')]
     public function testSortOrder($sftp)
     {
         $this->assertTrue(
@@ -359,6 +376,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testSortOrder */
+    #[Depends('testSortOrder')]
     public function testResourceXfer($sftp)
     {
         $fp = fopen('res.txt', 'w+');
@@ -377,6 +395,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testResourceXfer */
+    #[Depends('testResourceXfer')]
     public function testSymlink($sftp)
     {
         $this->assertTrue(
@@ -388,6 +407,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testSymlink */
+    #[Depends('testSymlink')]
     public function testStatLstatCache($sftp)
     {
         $stat = $sftp->stat('symlink');
@@ -402,6 +422,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testStatLstatCache */
+    #[Depends('testStatLstatCache')]
     public function testLinkFile($sftp)
     {
         $this->assertTrue(
@@ -421,6 +442,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testLinkFile */
+    #[Depends('testLinkFile')]
     public function testReadlink($sftp)
     {
         $this->assertIsString(
@@ -435,6 +457,8 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
      * @group github716
      */
     /** @depends testReadlink */
+    #[Depends('testReadlink')]
+    #[Group('github716')]
     public function testStatOnCWD($sftp)
     {
         $stat = $sftp->stat('.');
@@ -457,6 +481,8 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
      * @group github402
      */
     /** @depends testStatOnCWD */
+    #[Depends('testStatOnCWD')]
+    #[Group('github402')]
     public function testStatcacheFix($sftp)
     {
         // Name used for both directory and file.
@@ -478,6 +504,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testStatcacheFix */
+    #[Depends('testStatcacheFix')]
     public function testChDirUpHome($sftp)
     {
         $this->assertTrue(
@@ -495,6 +522,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testChDirUpHome */
+    #[Depends('testChDirUpHome')]
     public function testFileExistsIsFileIsDirDir($sftp)
     {
         $this->assertTrue(
@@ -516,6 +544,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testFileExistsIsFileIsDirDir */
+    #[Depends('testFileExistsIsFileIsDirDir')]
     public function testTruncateLargeFile($sftp)
     {
         $filesize = (4 * 1024 + 16) * 1024 * 1024;
@@ -528,6 +557,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testTruncateLargeFile */
+    #[Depends('testTruncateLargeFile')]
     public function testRmDirScratch($sftp)
     {
         $this->assertFalse(
@@ -540,6 +570,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testRmDirScratch */
+    #[Depends('testRmDirScratch')]
     public function testDeleteRecursiveScratch($sftp)
     {
         $this->assertTrue(
@@ -552,6 +583,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testDeleteRecursiveScratch */
+    #[Depends('testDeleteRecursiveScratch')]
     public function testRmDirScratchNonexistent($sftp)
     {
         $this->assertFalse(
@@ -567,6 +599,8 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
      * @group github706
      */
     /** @depends testRmDirScratchNonexistent */
+    #[Depends('testRmDirScratchNonexistent')]
+    #[Group('github706')]
     public function testDeleteEmptyDir($sftp)
     {
         $this->assertTrue(
@@ -601,6 +635,8 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
      * @group github735
      */
     /** @depends testDeleteEmptyDir */
+    #[Depends('testDeleteEmptyDir')]
+    #[Group('github735')]
     public function testStatVsLstat($sftp)
     {
         $this->assertTrue($sftp->mkdir(self::$scratchDir));
@@ -648,6 +684,8 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
      * @group github830
      */
     /** @depends testStatVsLstat */
+    #[Depends('testStatVsLstat')]
+    #[Group('github830')]
     public function testUploadOffsets($sftp)
     {
         $sftp->put('offset.txt', 'res.txt', SFTP::SOURCE_LOCAL_FILE, 0, 10);
@@ -668,6 +706,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testUploadOffsets */
+    #[Depends('testUploadOffsets')]
     public function testReadableWritable($sftp)
     {
         $sftp->chmod(0000, 'offset.txt');
@@ -691,6 +730,8 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
      * @group github999
      */
     /** @depends testReadableWritable */
+    #[Depends('testReadableWritable')]
+    #[Group('github999')]
     public function testExecNlist($sftp)
     {
         $sftp->enablePTY();
@@ -704,6 +745,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testExecNlist */
+    #[Depends('testExecNlist')]
     public function testRawlistDisabledStatCache($sftp)
     {
         $this->assertTrue($sftp->mkdir(self::$scratchDir));
@@ -732,6 +774,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testRawlistDisabledStatCache */
+    #[Depends('testRawlistDisabledStatCache')]
     public function testChownChgrp($sftp)
     {
         $stat = $sftp->stat(self::$scratchDir);
@@ -750,6 +793,8 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
      * @group github1934
      */
     /** @depends testChownChgrp */
+    #[Depends('testChownChgrp')]
+    #[Group('github1934')]
     public function testCallableGetWithLength($sftp)
     {
         $sftp->put('test.txt', 'zzzzz');
@@ -761,6 +806,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testPasswordLogin */
+    #[Depends('testPasswordLogin')]
     public function testStatVfs($sftp)
     {
         $sftp->put('test.txt', 'aaaaa');
@@ -782,6 +828,7 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testPasswordLogin */
+    #[Depends('testPasswordLogin')]
     public function testPosixRename($sftp)
     {
         $sftp->put('test1.txt', 'aaaaa');
diff --git a/tests/Functional/Net/SSH2AgentTest.php b/tests/Functional/Net/SSH2AgentTest.php
index badaa62..b5ce99f 100644
--- a/tests/Functional/Net/SSH2AgentTest.php
+++ b/tests/Functional/Net/SSH2AgentTest.php
@@ -11,6 +11,7 @@ namespace phpseclib3\Tests\Functional\Net;
 use phpseclib3\Net\SSH2;
 use phpseclib3\System\SSH\Agent;
 use phpseclib3\Tests\PhpseclibFunctionalTestCase;
+use PHPUnit\Framework\Attributes\Depends;
 
 class SSH2AgentTest extends PhpseclibFunctionalTestCase
 {
@@ -38,6 +39,7 @@ class SSH2AgentTest extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testAgentLogin */
+    #[Depends('testAgentLogin')]
     public function testAgentForward($args)
     {
         $ssh = $args['ssh'];
diff --git a/tests/Functional/Net/SSH2Test.php b/tests/Functional/Net/SSH2Test.php
index ce5cb45..4597aad 100644
--- a/tests/Functional/Net/SSH2Test.php
+++ b/tests/Functional/Net/SSH2Test.php
@@ -11,6 +11,10 @@ namespace phpseclib3\Tests\Functional\Net;
 use phpseclib3\Exception\NoSupportedAlgorithmsException;
 use phpseclib3\Net\SSH2;
 use phpseclib3\Tests\PhpseclibFunctionalTestCase;
+use PHPUnit\Framework\Attributes\DataProvider;
+use PHPUnit\Framework\Attributes\Depends;
+use PHPUnit\Framework\Attributes\Group;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
 class SSH2Test extends PhpseclibFunctionalTestCase
 {
@@ -56,6 +60,9 @@ class SSH2Test extends PhpseclibFunctionalTestCase
      * @group github412
      */
     /** @depends testConstructor */
+    #[Depends('testConstructor')]
+    #[Group('github408')]
+    #[Group('github412')]
     public function testPreLogin(SSH2 $ssh)
     {
         $this->assertFalse(
@@ -98,6 +105,7 @@ class SSH2Test extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testPreLogin */
+    #[Depends('testPreLogin')]
     public function testBadPassword(SSH2 $ssh)
     {
         $username = $this->getEnv('SSH_USERNAME');
@@ -126,6 +134,7 @@ class SSH2Test extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testBadPassword */
+    #[Depends('testBadPassword')]
     public function testPasswordLogin(SSH2 $ssh)
     {
         $username = $this->getEnv('SSH_USERNAME');
@@ -153,6 +162,9 @@ class SSH2Test extends PhpseclibFunctionalTestCase
      * @requires PHPUnit < 10
      */
     /** @depends testPasswordLogin */
+    #[Depends('testPasswordLogin')]
+    #[Group('github280')]
+    #[RequiresPhpunit('< 10')]
     public function testExecWithMethodCallback(SSH2 $ssh)
     {
         $callbackObject = $this->getMockBuilder('stdClass')
@@ -207,6 +219,8 @@ class SSH2Test extends PhpseclibFunctionalTestCase
      * @group github1009
      */
     /** @depends testExecWithMethodCallback */
+    #[Depends('testExecWithMethodCallback')]
+    #[Group('github1009')]
     public function testDisablePTY(SSH2 $ssh)
     {
         $ssh->enablePTY();
@@ -277,6 +291,8 @@ class SSH2Test extends PhpseclibFunctionalTestCase
      * @group github1167
      */
     /** @depends testDisablePTY */
+    #[Depends('testDisablePTY')]
+    #[Group('github1167')]
     public function testChannelDataAfterOpen(SSH2 $ssh)
     {
         // Ubuntu's OpenSSH from 5.8 to 6.9 didn't work with multiple channels. see
@@ -392,6 +408,7 @@ class SSH2Test extends PhpseclibFunctionalTestCase
     }
 
     /** @depends testOpenShell */
+    #[Depends('testOpenShell')]
     public function testResetOpenShell(SSH2 $ssh)
     {
         $ssh->reset();
@@ -629,6 +646,7 @@ class SSH2Test extends PhpseclibFunctionalTestCase
      * @param string $algorithm
      */
     /** @dataProvider getCryptoAlgorithms */
+    #[DataProvider('getCryptoAlgorithms')]
     public function testCryptoAlgorithms($type, $algorithm)
     {
         $ssh = $this->getSSH2();
diff --git a/tests/Unit/Crypt/AES/TestCase.php b/tests/Unit/Crypt/AES/TestCase.php
index f8adb69..4373f36 100644
--- a/tests/Unit/Crypt/AES/TestCase.php
+++ b/tests/Unit/Crypt/AES/TestCase.php
@@ -13,6 +13,7 @@ use phpseclib3\Crypt\Rijndael;
 use phpseclib3\Exception\InconsistentSetupException;
 use phpseclib3\Exception\InsufficientSetupException;
 use phpseclib3\Tests\PhpseclibTestCase;
+use PHPUnit\Framework\Attributes\DataProvider;
 
 abstract class TestCase extends PhpseclibTestCase
 {
@@ -71,6 +72,7 @@ abstract class TestCase extends PhpseclibTestCase
     }
 
     /** @dataProvider continuousBufferCombos */
+    #[DataProvider('continuousBufferCombos')]
     public function testEncryptDecryptWithContinuousBuffer($mode, $plaintext, $iv, $key)
     {
         $aes = new AES($mode);
@@ -182,6 +184,7 @@ abstract class TestCase extends PhpseclibTestCase
     }
 
     /** @dataProvider continuousBufferBatteryCombos */
+    #[DataProvider('continuousBufferBatteryCombos')]
     public function testContinuousBufferBattery($op, $mode, $test)
     {
         $iv = str_repeat('x', 16);
@@ -226,6 +229,7 @@ abstract class TestCase extends PhpseclibTestCase
      * Pretty much the same as testContinuousBufferBattery with the caveat that continuous mode is not enabled.
      */
     /** @dataProvider continuousBufferBatteryCombosWithoutSingleCombos */
+    #[DataProvider('continuousBufferBatteryCombosWithoutSingleCombos')]
     public function testNonContinuousBufferBattery($op, $mode, $test)
     {
         $iv = str_repeat('x', 16);
diff --git a/tests/Unit/Crypt/BlowfishTest.php b/tests/Unit/Crypt/BlowfishTest.php
index 8237aaa..149d2a5 100644
--- a/tests/Unit/Crypt/BlowfishTest.php
+++ b/tests/Unit/Crypt/BlowfishTest.php
@@ -11,6 +11,7 @@ namespace phpseclib3\Tests\Unit\Crypt;
 use phpseclib3\Crypt\Blowfish;
 use phpseclib3\Crypt\Random;
 use phpseclib3\Tests\PhpseclibTestCase;
+use PHPUnit\Framework\Attributes\DataProvider;
 
 class BlowfishTest extends PhpseclibTestCase
 {
@@ -74,6 +75,7 @@ class BlowfishTest extends PhpseclibTestCase
     }
 
     /** @dataProvider engineVectors */
+    #[DataProvider('engineVectors')]
     public function testVectors($engine, $key, $plaintext, $expected)
     {
         $bf = new Blowfish('cbc');
diff --git a/tests/Unit/Crypt/DSA/CreateKeyTest.php b/tests/Unit/Crypt/DSA/CreateKeyTest.php
index c87f5fd..1263346 100644
--- a/tests/Unit/Crypt/DSA/CreateKeyTest.php
+++ b/tests/Unit/Crypt/DSA/CreateKeyTest.php
@@ -13,6 +13,7 @@ use phpseclib3\Crypt\DSA\Parameters;
 use phpseclib3\Crypt\DSA\PrivateKey;
 use phpseclib3\Crypt\DSA\PublicKey;
 use phpseclib3\Tests\PhpseclibTestCase;
+use PHPUnit\Framework\Attributes\Depends;
 
 /**
  * @requires PHP 7.0
@@ -39,6 +40,7 @@ class CreateKeyTest extends PhpseclibTestCase
     }
 
     /** @depends testCreateParameters */
+    #[Depends('testCreateParameters')]
     public function testCreateKey($params)
     {
         $privatekey = DSA::createKey();
diff --git a/tests/Unit/Crypt/EC/CurveTest.php b/tests/Unit/Crypt/EC/CurveTest.php
index 068831d..624ad31 100644
--- a/tests/Unit/Crypt/EC/CurveTest.php
+++ b/tests/Unit/Crypt/EC/CurveTest.php
@@ -13,6 +13,7 @@ use phpseclib3\Crypt\EC\Curves\Ed448;
 use phpseclib3\Crypt\PublicKeyLoader;
 use phpseclib3\File\ASN1;
 use phpseclib3\Tests\PhpseclibTestCase;
+use PHPUnit\Framework\Attributes\DataProvider;
 
 class CurveTest extends PhpseclibTestCase
 {
@@ -79,6 +80,7 @@ class CurveTest extends PhpseclibTestCase
      * Verify that the base points are correct and verify the finite field math
      */
     /** @dataProvider curves */
+    #[DataProvider('curves')]
     public function testBasePoint($name)
     {
         $class = 'phpseclib3\Crypt\EC\Curves\\' . $name;
@@ -92,6 +94,7 @@ class CurveTest extends PhpseclibTestCase
      * @requires PHP 7.0
      */
      /** @dataProvider curves */
+    #[DataProvider('curves')]
     public function testKeyGeneration($name)
     {
         $class = 'phpseclib3\Crypt\EC\Curves\\' . $name;
@@ -105,6 +108,7 @@ class CurveTest extends PhpseclibTestCase
      * Verify that OIDs have corresponding curve class
      */
     /** @dataProvider curvesWithOIDs */
+    #[DataProvider('curvesWithOIDs')]
     public function testCurveExistance($name)
     {
         $this->assertFileExists(__DIR__ . "/../../../../phpseclib/Crypt/EC/Curves/$name.php");
@@ -114,6 +118,7 @@ class CurveTest extends PhpseclibTestCase
      * Verify that all named curves have a corresponding OID
      */
     /** @dataProvider allCurves */
+    #[DataProvider('allCurves')]
     public function testOIDExistance($name)
     {
         switch ($name) {
@@ -130,6 +135,7 @@ class CurveTest extends PhpseclibTestCase
      * @requires PHP 7.0
      */
     /** @dataProvider curves */
+    #[DataProvider('curves')]
     public function testInternalSign($name)
     {
         // tests utilizing dataProvider only seem to output when all the dataProvider input
@@ -175,6 +181,7 @@ class CurveTest extends PhpseclibTestCase
      * @requires PHP 7.0
      */
     /** @dataProvider curves */
+    #[DataProvider('curves')]
     public function testInternalVerify($name)
     {
         if (substr($name, 0, 4) == 'sect') {
diff --git a/tests/Unit/Crypt/GCMTest.php b/tests/Unit/Crypt/GCMTest.php
index 27bcb2c..2b26e82 100644
--- a/tests/Unit/Crypt/GCMTest.php
+++ b/tests/Unit/Crypt/GCMTest.php
@@ -10,6 +10,7 @@ namespace phpseclib3\Tests\Unit\Crypt;
 
 use phpseclib3\Crypt\AES;
 use phpseclib3\Tests\PhpseclibTestCase;
+use PHPUnit\Framework\Attributes\DataProvider;
 
 class GCMTest extends PhpseclibTestCase
 {
@@ -105,6 +106,7 @@ class GCMTest extends PhpseclibTestCase
     }
 
     /** @dataProvider engine128Vectors */
+    #[DataProvider('engine128Vectors')]
     public function test128Vectors($engine, $key, $plaintext, $nonce, $aad, $ciphertext, $tag)
     {
         $aes = new AES('gcm');
@@ -216,6 +218,7 @@ class GCMTest extends PhpseclibTestCase
     }
 
     /** @dataProvider engine256Vectors */
+    #[DataProvider('engine256Vectors')]
     public function test256Vectors($engine, $key, $plaintext, $nonce, $aad, $ciphertext, $tag)
     {
         $aes = new AES('gcm');
diff --git a/tests/Unit/Crypt/HashTest.php b/tests/Unit/Crypt/HashTest.php
index 5dd4cb1..0dd5e37 100644
--- a/tests/Unit/Crypt/HashTest.php
+++ b/tests/Unit/Crypt/HashTest.php
@@ -11,6 +11,7 @@ namespace phpseclib3\Tests\Unit\Crypt;
 use phpseclib3\Crypt\Hash;
 use phpseclib3\Exception\UnsupportedAlgorithmException;
 use phpseclib3\Tests\PhpseclibTestCase;
+use PHPUnit\Framework\Attributes\DataProvider;
 
 class HashTest extends PhpseclibTestCase
 {
@@ -169,12 +170,14 @@ class HashTest extends PhpseclibTestCase
     }
 
     /** @dataProvider hmacData */
+    #[DataProvider('hmacData')]
     public function testHMAC($hash, $key, $message, $result)
     {
         $this->assertHMACsTo($hash, $key, $message, $result);
     }
 
     /** @dataProvider hmacData */
+    #[DataProvider('hmacData')]
     public function testHMAC96($hash, $key, $message, $result)
     {
         if ($hash == 'aes_cmac') {
@@ -395,12 +398,14 @@ class HashTest extends PhpseclibTestCase
     }
 
     /** @dataProvider hashData */
+    #[DataProvider('hashData')]
     public function testHash($hash, $message, $result)
     {
         $this->assertHashesTo($hash, $message, $result);
     }
 
     /** @dataProvider hashData */
+    #[DataProvider('hashData')]
     public function testHash96($hash, $message, $result)
     {
         if (preg_match('#^sha3-\d+#', $hash) || preg_match('#^shake(?:128|256)-\d+#', $hash) || $hash === 'keccak256') {
@@ -439,6 +444,7 @@ class HashTest extends PhpseclibTestCase
     }
 
     /** @dataProvider lengths */
+    #[DataProvider('lengths')]
     public function testGetLengthKnown($algorithm, $length)
     {
         $hash = new Hash($algorithm);
@@ -490,6 +496,7 @@ class HashTest extends PhpseclibTestCase
     }
 
     /** @dataProvider UMACs */
+    #[DataProvider('UMACs')]
     public function testUMACs($message, $algo, $tag, $error)
     {
         $k = 'abcdefghijklmnop'; // A 16-byte UMAC key
diff --git a/tests/Unit/Crypt/RC2Test.php b/tests/Unit/Crypt/RC2Test.php
index 6f7ba35..bb8c9b5 100644
--- a/tests/Unit/Crypt/RC2Test.php
+++ b/tests/Unit/Crypt/RC2Test.php
@@ -10,6 +10,7 @@ namespace phpseclib3\Tests\Unit\Crypt;
 
 use phpseclib3\Crypt\RC2;
 use phpseclib3\Tests\PhpseclibTestCase;
+use PHPUnit\Framework\Attributes\DataProvider;
 
 class RC2Test extends PhpseclibTestCase
 {
@@ -110,6 +111,7 @@ class RC2Test extends PhpseclibTestCase
     }
 
     /** @dataProvider engineVectors */
+    #[DataProvider('engineVectors')]
     public function testVectors($engine, $key, $keyLen, $plaintext, $ciphertext)
     {
         $rc2 = new RC2('cbc');
diff --git a/tests/Unit/Crypt/RC4Test.php b/tests/Unit/Crypt/RC4Test.php
index 0a45e7b..d6e51d9 100644
--- a/tests/Unit/Crypt/RC4Test.php
+++ b/tests/Unit/Crypt/RC4Test.php
@@ -11,6 +11,7 @@ namespace phpseclib3\Tests\Unit\Crypt;
 use phpseclib3\Crypt\Random;
 use phpseclib3\Crypt\RC4;
 use phpseclib3\Tests\PhpseclibTestCase;
+use PHPUnit\Framework\Attributes\DataProvider;
 
 class RC4Test extends PhpseclibTestCase
 {
@@ -201,6 +202,7 @@ class RC4Test extends PhpseclibTestCase
     }
 
     /** @dataProvider engineVectors */
+    #[DataProvider('engineVectors')]
     public function testVectors($engine, $key, $offset, $expected)
     {
         $rc4 = new RC4();
diff --git a/tests/Unit/Crypt/RSA/CreateKeyTest.php b/tests/Unit/Crypt/RSA/CreateKeyTest.php
index 913b760..a0988a2 100644
--- a/tests/Unit/Crypt/RSA/CreateKeyTest.php
+++ b/tests/Unit/Crypt/RSA/CreateKeyTest.php
@@ -14,6 +14,7 @@ use phpseclib3\Crypt\RSA\Formats\Keys\PKCS8;
 use phpseclib3\Crypt\RSA\PrivateKey;
 use phpseclib3\Crypt\RSA\PublicKey;
 use phpseclib3\Tests\PhpseclibTestCase;
+use PHPUnit\Framework\Attributes\Depends;
 
 class CreateKeyTest extends PhpseclibTestCase
 {
@@ -32,6 +33,7 @@ class CreateKeyTest extends PhpseclibTestCase
     }
 
     /** @depends testCreateKey */
+    #[Depends('testCreateKey')]
     public function testEncryptDecrypt($args)
     {
         list($publickey, $privatekey) = $args;
diff --git a/tests/Unit/Crypt/RSA/LoadKeyTest.php b/tests/Unit/Crypt/RSA/LoadKeyTest.php
index 566fcc3..607cf20 100644
--- a/tests/Unit/Crypt/RSA/LoadKeyTest.php
+++ b/tests/Unit/Crypt/RSA/LoadKeyTest.php
@@ -62,6 +62,7 @@ class LoadKeyTest extends PhpseclibTestCase
     }
 
     /** @dataProvider getGarbageStrings */
+    #[DataProvider('getGarbageStrings')]
     public function testBadKey($key)
     {
         $this->expectException(NoKeyLoadedException::class);
diff --git a/tests/Unit/Crypt/RandomTest.php b/tests/Unit/Crypt/RandomTest.php
index 5ab3fe0..acddf94 100644
--- a/tests/Unit/Crypt/RandomTest.php
+++ b/tests/Unit/Crypt/RandomTest.php
@@ -10,6 +10,7 @@ namespace phpseclib3\Tests\Unit\Crypt;
 
 use phpseclib3\Crypt\Random;
 use phpseclib3\Tests\PhpseclibTestCase;
+use PHPUnit\Framework\Attributes\DataProvider;
 
 class RandomTest extends PhpseclibTestCase
 {
@@ -25,6 +26,7 @@ class RandomTest extends PhpseclibTestCase
     }
 
     /** @dataProvider stringLengthData */
+    #[DataProvider('stringLengthData')]
     public function testStringLength($length)
     {
         $this->assertSame(
diff --git a/tests/Unit/Crypt/Salsa20Test.php b/tests/Unit/Crypt/Salsa20Test.php
index 82a3162..b811db8 100644
--- a/tests/Unit/Crypt/Salsa20Test.php
+++ b/tests/Unit/Crypt/Salsa20Test.php
@@ -10,6 +10,7 @@ namespace phpseclib3\Tests\Unit\Crypt;
 
 use phpseclib3\Crypt\Salsa20;
 use phpseclib3\Tests\PhpseclibTestCase;
+use PHPUnit\Framework\Attributes\DataProvider;
 
 class Salsa20Test extends PhpseclibTestCase
 {
@@ -145,6 +146,7 @@ class Salsa20Test extends PhpseclibTestCase
     }
 
     /** @dataProvider engineVectors */
+    #[DataProvider('engineVectors')]
     public function testVectors($engine, $key, $iv, $expected)
     {
         $cipher = new Salsa20();
diff --git a/tests/Unit/Crypt/TripleDESTest.php b/tests/Unit/Crypt/TripleDESTest.php
index 7f35f73..b0282d3 100644
--- a/tests/Unit/Crypt/TripleDESTest.php
+++ b/tests/Unit/Crypt/TripleDESTest.php
@@ -10,6 +10,7 @@ namespace phpseclib3\Tests\Unit\Crypt;
 
 use phpseclib3\Crypt\TripleDES;
 use phpseclib3\Tests\PhpseclibTestCase;
+use PHPUnit\Framework\Attributes\DataProvider;
 
 class TripleDESTest extends PhpseclibTestCase
 {
@@ -104,6 +105,7 @@ class TripleDESTest extends PhpseclibTestCase
     }
 
     /** @dataProvider engineVectors */
+    #[DataProvider('engineVectors')]
     public function testVectors($engine, $key, $plaintext, $expected)
     {
         $des = new TripleDES('cbc');
@@ -155,6 +157,7 @@ class TripleDESTest extends PhpseclibTestCase
     }
 
     /** @dataProvider engineIVVectors */
+    #[DataProvider('engineIVVectors')]
     public function testVectorsWithIV($engine, $key, $iv, $plaintext, $expected)
     {
         $des = new TripleDES('cbc');
@@ -196,6 +199,7 @@ class TripleDESTest extends PhpseclibTestCase
      * @return void
      */
     /** @dataProvider provideForCorrectSelfUseInLambda */
+    #[DataProvider('provideForCorrectSelfUseInLambda')]
     public function testCorrectSelfUseInLambda($key, $expectedCiphertext)
     {
         $td = new TripleDES('ecb');
diff --git a/tests/Unit/Net/SSH2UnitTest.php b/tests/Unit/Net/SSH2UnitTest.php
index 13e8a58..2413eed 100644
--- a/tests/Unit/Net/SSH2UnitTest.php
+++ b/tests/Unit/Net/SSH2UnitTest.php
@@ -13,6 +13,8 @@ use phpseclib3\Exception\InsufficientSetupException;
 use phpseclib3\Exception\TimeoutException;
 use phpseclib3\Net\SSH2;
 use phpseclib3\Tests\PhpseclibTestCase;
+use PHPUnit\Framework\Attributes\DataProvider;
+use PHPUnit\Framework\Attributes\RequiresPhpunit;
 
 class SSH2UnitTest extends PhpseclibTestCase
 {
@@ -37,6 +39,7 @@ class SSH2UnitTest extends PhpseclibTestCase
      * @requires PHPUnit < 10
      * Verify that MASK_* constants remain distinct
      */
+    #[RequiresPhpunit('< 10')]
     public function testBitmapMasks()
     {
         $reflection = new \ReflectionClass(SSH2::class);
@@ -55,6 +58,8 @@ class SSH2UnitTest extends PhpseclibTestCase
      * @requires PHPUnit < 10
      */
     /** @dataProvider formatLogDataProvider */
+    #[DataProvider('formatLogDataProvider')]
+    #[RequiresPhpunit('< 10')]
     public function testFormatLog(array $message_log, array $message_number_log, $expected)
     {
         $ssh = $this->createSSHMock();
@@ -66,6 +71,7 @@ class SSH2UnitTest extends PhpseclibTestCase
     /**
      * @requires PHPUnit < 10
      */
+    #[RequiresPhpunit('< 10')]
     public function testGenerateIdentifier()
     {
         $identifier = self::callFunc($this->createSSHMock(), 'generate_identifier');
@@ -101,6 +107,7 @@ class SSH2UnitTest extends PhpseclibTestCase
     /**
      * @requires PHPUnit < 10
      */
+    #[RequiresPhpunit('< 10')]
     public function testGetExitStatusIfNotConnected()
     {
         $ssh = $this->createSSHMock();
@@ -111,6 +118,7 @@ class SSH2UnitTest extends PhpseclibTestCase
     /**
      * @requires PHPUnit < 10
      */
+    #[RequiresPhpunit('< 10')]
     public function testPTYIDefaultValue()
     {
         $ssh = $this->createSSHMock();
@@ -120,6 +128,7 @@ class SSH2UnitTest extends PhpseclibTestCase
     /**
      * @requires PHPUnit < 10
      */
+    #[RequiresPhpunit('< 10')]
     public function testEnablePTY()
     {
         $ssh = $this->createSSHMock();
@@ -134,6 +143,7 @@ class SSH2UnitTest extends PhpseclibTestCase
     /**
      * @requires PHPUnit < 10
      */
+    #[RequiresPhpunit('< 10')]
     public function testQuietModeDefaultValue()
     {
         $ssh = $this->createSSHMock();
@@ -144,6 +154,7 @@ class SSH2UnitTest extends PhpseclibTestCase
     /**
      * @requires PHPUnit < 10
      */
+    #[RequiresPhpunit('< 10')]
     public function testEnableQuietMode()
     {
         $ssh = $this->createSSHMock();
@@ -170,6 +181,7 @@ class SSH2UnitTest extends PhpseclibTestCase
     /**
      * @requires PHPUnit < 10
      */
+    #[RequiresPhpunit('< 10')]
     public function testReadUnauthenticated()
     {
         $this->expectException(InsufficientSetupException::class);
@@ -183,6 +195,7 @@ class SSH2UnitTest extends PhpseclibTestCase
     /**
      * @requires PHPUnit < 10
      */
+    #[RequiresPhpunit('< 10')]
     public function testWriteUnauthenticated()
     {
         $this->expectException(InsufficientSetupException::class);
@@ -196,6 +209,7 @@ class SSH2UnitTest extends PhpseclibTestCase
     /**
      * @requires PHPUnit < 10
      */
+    #[RequiresPhpunit('< 10')]
     public function testWriteOpensShell()
     {
         $ssh = $this->getMockBuilder(SSH2::class)
@@ -218,6 +232,7 @@ class SSH2UnitTest extends PhpseclibTestCase
     /**
      * @requires PHPUnit < 10
      */
+    #[RequiresPhpunit('< 10')]
     public function testOpenShellWhenOpen()
     {
         $ssh = $this->getMockBuilder(SSH2::class)
@@ -244,6 +259,7 @@ class SSH2UnitTest extends PhpseclibTestCase
     /**
      * @requires PHPUnit < 10
      */
+    #[RequiresPhpunit('< 10')]
     public function testGetStreamTimeout()
     {
         $default = ini_get('default_socket_timeout');
@@ -295,6 +311,7 @@ class SSH2UnitTest extends PhpseclibTestCase
     /**
      * @requires PHPUnit < 10
      */
+    #[RequiresPhpunit('< 10')]
     public function testSendChannelPacketNoBufferedData()
     {
         $ssh = $this->getMockBuilder('phpseclib3\Net\SSH2')
@@ -322,6 +339,7 @@ class SSH2UnitTest extends PhpseclibTestCase
     /**
      * @requires PHPUnit < 10
      */
+    #[RequiresPhpunit('< 10')]
     public function testSendChannelPacketBufferedData()
     {
         $ssh = $this->getMockBuilder('phpseclib3\Net\SSH2')
@@ -350,6 +368,7 @@ class SSH2UnitTest extends PhpseclibTestCase
     /**
      * @requires PHPUnit < 10
      */
+    #[RequiresPhpunit('< 10')]
     public function testSendChannelPacketTimeout()
     {
         $this->expectException(TimeoutException::class);
@@ -380,6 +399,7 @@ class SSH2UnitTest extends PhpseclibTestCase
     /**
      * @requires PHPUnit < 10
      */
+    #[RequiresPhpunit('< 10')]
     public function testSendChannelPacketNoWindowAdjustment()
     {
         $this->expectException(\RuntimeException::class);
@@ -405,6 +425,7 @@ class SSH2UnitTest extends PhpseclibTestCase
     /**
      * @requires PHPUnit < 10
      */
+    #[RequiresPhpunit('< 10')]
     public function testDisconnectHelper()
     {
         $ssh = $this->getMockBuilder('phpseclib3\Net\SSH2')