File: 0006-Use-expectException-instead-of-setExpectedException.patch

package info (click to toggle)
pdepend 2.12.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 19,000 kB
  • sloc: php: 60,009; xml: 1,423; makefile: 35; pascal: 34; sql: 34; sh: 8
file content (911 lines) | stat: -rw-r--r-- 41,530 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
From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit@debian.org>
Date: Fri, 23 Aug 2019 20:25:40 -1000
Subject: Use expectException instead of setExpectedException

---
 .../Bugs/ClassDeclarationWithoutBodyBug065Test.php | 16 ++++++-------
 .../ParentKeywordAsParameterTypeHintBug087Test.php |  4 ++--
 src/test/php/PDepend/EngineTest.php                | 14 ++++++------
 .../Issues/NamespaceSupportIssue002Test.php        |  6 ++---
 .../CodeRankAnalyzer/StrategyFactoryTest.php       |  2 +-
 src/test/php/PDepend/ParserTest.php                | 16 ++++++-------
 .../php/PDepend/Report/Dependencies/XmlTest.php    |  2 +-
 src/test/php/PDepend/Report/Jdepend/XmlTest.php    |  2 +-
 .../php/PDepend/Report/Overview/PyramidTest.php    | 12 +++++-----
 .../PDepend/Report/ReportGeneratorFactoryTest.php  |  2 +-
 src/test/php/PDepend/Report/Summary/XmlTest.php    |  2 +-
 .../Source/AST/ASTConstantDefinitionTest.php       |  2 +-
 .../PDepend/Source/AST/ASTFieldDeclarationTest.php |  2 +-
 .../PDepend/Source/AST/ASTFormalParameterTest.php  |  2 +-
 .../PDepend/Source/AST/ASTListExpressionTest.php   |  2 +-
 src/test/php/PDepend/Source/AST/ASTMethodTest.php  |  2 +-
 .../PDepend/Source/AST/ASTStaticReferenceTest.php  |  4 ++--
 .../PHP80/ConstructorPropertyPromotionTest.php     |  4 ++--
 .../PHP/Features/PHP80/MatchExpressionTest.php     |  4 ++--
 .../PHP/Features/PHP81/ReadonlyClassTest.php       |  2 +-
 .../PDepend/Source/Language/PHP/PHPBuilderTest.php | 12 +++++-----
 .../Source/Language/PHP/PHPParserVersion53Test.php |  2 +-
 .../Source/Language/PHP/PHPParserVersion54Test.php |  2 +-
 .../Source/Language/PHP/PHPParserVersion55Test.php |  2 +-
 .../Source/Language/PHP/PHPParserVersion56Test.php |  4 ++--
 .../Source/Language/PHP/PHPParserVersion70Test.php | 26 +++++++++++-----------
 .../Source/Language/PHP/PHPParserVersion71Test.php |  4 ++--
 .../Source/Language/PHP/PHPParserVersion73Test.php |  2 +-
 .../Source/Language/PHP/PHPParserVersion74Test.php |  2 +-
 .../Parser/ASTAllocationExpressionParsingTest.php  |  2 +-
 .../php/PDepend/Source/Parser/SymbolTableTest.php  |  8 +++----
 31 files changed, 84 insertions(+), 84 deletions(-)

diff --git a/src/test/php/PDepend/Bugs/ClassDeclarationWithoutBodyBug065Test.php b/src/test/php/PDepend/Bugs/ClassDeclarationWithoutBodyBug065Test.php
index 1467f5e..56be9d7 100644
--- a/src/test/php/PDepend/Bugs/ClassDeclarationWithoutBodyBug065Test.php
+++ b/src/test/php/PDepend/Bugs/ClassDeclarationWithoutBodyBug065Test.php
@@ -61,7 +61,7 @@ class ClassDeclarationWithoutBodyBug065Test extends AbstractRegressionTest
      */
     public function testInterfaceDeclarationWithoutBody()
     {
-        $this->setExpectedException(
+        $this->expectException(
             'RuntimeException',
             'Unexpected end of token stream in file: '
         );
@@ -77,7 +77,7 @@ class ClassDeclarationWithoutBodyBug065Test extends AbstractRegressionTest
      */
     public function testInterfaceDeclarationWithExtendWithoutBody()
     {
-        $this->setExpectedException(
+        $this->expectException(
             'RuntimeException',
             'Unexpected end of token stream in file: '
         );
@@ -93,7 +93,7 @@ class ClassDeclarationWithoutBodyBug065Test extends AbstractRegressionTest
      */
     public function testInterfaceDeclarationWithInvalidInterfaceList()
     {
-        $this->setExpectedException(
+        $this->expectException(
             'RuntimeException',
             'Unexpected token: {, line: 2, col: 28, file: '
         );
@@ -109,7 +109,7 @@ class ClassDeclarationWithoutBodyBug065Test extends AbstractRegressionTest
      */
     public function testClassDeclarationWithoutBody()
     {
-        $this->setExpectedException(
+        $this->expectException(
             'RuntimeException',
             'Unexpected end of token stream in file: '
         );
@@ -125,7 +125,7 @@ class ClassDeclarationWithoutBodyBug065Test extends AbstractRegressionTest
      */
     public function testClassDeclarationWithExtendsWithoutClassName()
     {
-        $this->setExpectedException(
+        $this->expectException(
             'RuntimeException',
             'Unexpected end of token stream in file: '
         );
@@ -141,7 +141,7 @@ class ClassDeclarationWithoutBodyBug065Test extends AbstractRegressionTest
      */
     public function testClassDeclarationWithExtendsWithoutInterfaceName()
     {
-        $this->setExpectedException(
+        $this->expectException(
             'RuntimeException',
             'Unexpected end of token stream in file: '
         );
@@ -157,7 +157,7 @@ class ClassDeclarationWithoutBodyBug065Test extends AbstractRegressionTest
      */
     public function testClassDeclarationWithParentInterfaceWithoutBody()
     {
-        $this->setExpectedException(
+        $this->expectException(
             'RuntimeException',
             'Unexpected end of token stream in file: '
         );
@@ -173,7 +173,7 @@ class ClassDeclarationWithoutBodyBug065Test extends AbstractRegressionTest
      */
     public function testClassDeclarationWithIncompleteParentInterfaceWithoutBody()
     {
-        $this->setExpectedException(
+        $this->expectException(
             'RuntimeException',
             'Unexpected end of token stream in file: '
         );
diff --git a/src/test/php/PDepend/Bugs/ParentKeywordAsParameterTypeHintBug087Test.php b/src/test/php/PDepend/Bugs/ParentKeywordAsParameterTypeHintBug087Test.php
index 1c45a86..f802ec6 100644
--- a/src/test/php/PDepend/Bugs/ParentKeywordAsParameterTypeHintBug087Test.php
+++ b/src/test/php/PDepend/Bugs/ParentKeywordAsParameterTypeHintBug087Test.php
@@ -81,7 +81,7 @@ class ParentKeywordAsParameterTypeHintBug087Test extends AbstractRegressionTest
      */
     public function testParserThrowsExpectedExceptionForParentTypeHintInFunction()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\InvalidStateException',
             'The keyword "parent" was used as type hint but the parameter ' .
             'declaration is not in a class scope.'
@@ -97,7 +97,7 @@ class ParentKeywordAsParameterTypeHintBug087Test extends AbstractRegressionTest
      */
     public function testParserThrowsExpectedExceptionForParentTypeHintWithRootClass()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\InvalidStateException',
             'The keyword "parent" was used as type hint but the ' .
             'class "Baz" does not declare a parent.'
diff --git a/src/test/php/PDepend/EngineTest.php b/src/test/php/PDepend/EngineTest.php
index 71a5cc4..90f83c0 100644
--- a/src/test/php/PDepend/EngineTest.php
+++ b/src/test/php/PDepend/EngineTest.php
@@ -66,7 +66,7 @@ class EngineTest extends AbstractTest
         $dir = dirname(__FILE__) . '/foobar';
         $msg = "Invalid directory '{$dir}' added.";
 
-        $this->setExpectedException('InvalidArgumentException', $msg);
+        $this->expectException('InvalidArgumentException', $msg);
 
         $engine = $this->createEngineFixture();
         $engine->addDirectory($dir);
@@ -133,7 +133,7 @@ class EngineTest extends AbstractTest
     public function testAnalyzeThrowsAnExceptionForNoSourceDirectory()
     {
         $engine = $this->createEngineFixture();
-        $this->setExpectedException('RuntimeException', 'No source directory and file set.');
+        $this->expectException('RuntimeException', 'No source directory and file set.');
         $engine->analyze();
     }
 
@@ -199,7 +199,7 @@ class EngineTest extends AbstractTest
      */
     public function testCountClassesWithoutAnalyzeFail()
     {
-        $this->setExpectedException(
+        $this->expectException(
             'RuntimeException',
             'countClasses() doesn\'t work before the source was analyzed.'
         );
@@ -232,7 +232,7 @@ class EngineTest extends AbstractTest
      */
     public function testCountNamespacesWithoutAnalyzeFail()
     {
-        $this->setExpectedException(
+        $this->expectException(
             'RuntimeException',
             'countNamespaces() doesn\'t work before the source was analyzed.'
         );
@@ -275,7 +275,7 @@ class EngineTest extends AbstractTest
      */
     public function testGetNamespaceWithoutAnalyzeFail()
     {
-        $this->setExpectedException(
+        $this->expectException(
             'RuntimeException',
             'getNamespace() doesn\'t work before the source was analyzed.'
         );
@@ -293,7 +293,7 @@ class EngineTest extends AbstractTest
      */
     public function testGetNamespacesWithUnknownPackageFail()
     {
-        $this->setExpectedException(
+        $this->expectException(
             'OutOfBoundsException',
             'Unknown namespace "nspace".'
         );
@@ -332,7 +332,7 @@ class EngineTest extends AbstractTest
      */
     public function testGetNamespacesWithoutAnalyzeFail()
     {
-        $this->setExpectedException(
+        $this->expectException(
             'RuntimeException',
             'getNamespaces() doesn\'t work before the source was analyzed.'
         );
diff --git a/src/test/php/PDepend/Issues/NamespaceSupportIssue002Test.php b/src/test/php/PDepend/Issues/NamespaceSupportIssue002Test.php
index 9740c26..3ef8745 100644
--- a/src/test/php/PDepend/Issues/NamespaceSupportIssue002Test.php
+++ b/src/test/php/PDepend/Issues/NamespaceSupportIssue002Test.php
@@ -113,7 +113,7 @@ class NamespaceSupportIssue002Test extends AbstractFeatureTest
      */
     public function testParserThrowsExpectedExceptionWhenUseDeclarationContextEndsOnBackslash()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: as, line: 2, col: 19, file: '
         );
@@ -177,7 +177,7 @@ class NamespaceSupportIssue002Test extends AbstractFeatureTest
      */
     public function testParserThrowsExpectedExceptionForNamespaceDeclarationWithoutIdentifierAndSemicolonSyntax()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: ;, line: 2, col: 18, file: '
         );
@@ -193,7 +193,7 @@ class NamespaceSupportIssue002Test extends AbstractFeatureTest
      */
     public function testParserThrowsExpectedExceptionForLeadingBackslashInIdentifier()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: {, line: 2, col: 13, file: '
         );
diff --git a/src/test/php/PDepend/Metrics/Analyzer/CodeRankAnalyzer/StrategyFactoryTest.php b/src/test/php/PDepend/Metrics/Analyzer/CodeRankAnalyzer/StrategyFactoryTest.php
index 8d46598..48382ec 100644
--- a/src/test/php/PDepend/Metrics/Analyzer/CodeRankAnalyzer/StrategyFactoryTest.php
+++ b/src/test/php/PDepend/Metrics/Analyzer/CodeRankAnalyzer/StrategyFactoryTest.php
@@ -66,7 +66,7 @@ class StrategyFactoryTest extends AbstractTest
     {
         $factory = new StrategyFactory();
 
-        $this->setExpectedException(
+        $this->expectException(
             'InvalidArgumentException',
             'Cannot load file for identifier "foo_bar_baz".'
         );
diff --git a/src/test/php/PDepend/ParserTest.php b/src/test/php/PDepend/ParserTest.php
index ed7f2dd..607daa9 100644
--- a/src/test/php/PDepend/ParserTest.php
+++ b/src/test/php/PDepend/ParserTest.php
@@ -132,7 +132,7 @@ class ParserTest extends AbstractTest
     public function testParserWithUnclosedClassFail()
     {
         $sourceFile = $this->createCodeResourceUriForTest();
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\TokenStreamEndException',
             "Unexpected end of token stream in file: {$sourceFile}."
         );
@@ -148,7 +148,7 @@ class ParserTest extends AbstractTest
      */
     public function testParserWithUnclosedFunctionFail()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\TokenStreamEndException',
             'Unexpected end of token stream in file: '
         );
@@ -164,7 +164,7 @@ class ParserTest extends AbstractTest
      */
     public function testParserWithInvalidFunction1Fail()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\RuntimeException',
             'Unexpected token: (, line: 3, col: 23, file: '
         );
@@ -180,7 +180,7 @@ class ParserTest extends AbstractTest
      */
     public function testParserWithInvalidFunction2Fail()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\RuntimeException',
             "Unexpected token: Bar, line: 3, col: 18, file: "
         );
@@ -1150,7 +1150,7 @@ class ParserTest extends AbstractTest
      */
     public function testParserThrowsUnexpectedTokenExceptionForBrokenParameterArrayDefaultValue()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: {, line: 2, col: 29, file: '
         );
@@ -1166,7 +1166,7 @@ class ParserTest extends AbstractTest
      */
     public function testParserThrowsUnexpectedTokenExceptionForInvalidTokenInParameterDefaultValue()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: &, line: 2, col: 27, file: '
         );
@@ -1182,7 +1182,7 @@ class ParserTest extends AbstractTest
      */
     public function testParserThrowsUnexpectedTokenExceptionForInvalidTokenInClassBody()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: ;, line: 4, col: 5, file: '
         );
@@ -1198,7 +1198,7 @@ class ParserTest extends AbstractTest
      */
     public function testParserThrowsUnexpectedTokenExceptionForInvalidTokenInMethodDeclaration()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: &, line: 4, col: 12, file: '
         );
diff --git a/src/test/php/PDepend/Report/Dependencies/XmlTest.php b/src/test/php/PDepend/Report/Dependencies/XmlTest.php
index 55bfc7b..fead881 100644
--- a/src/test/php/PDepend/Report/Dependencies/XmlTest.php
+++ b/src/test/php/PDepend/Report/Dependencies/XmlTest.php
@@ -118,7 +118,7 @@ class XmlTest extends AbstractTest
      */
     public function testThrowsExceptionForInvalidLogTarget()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Report\\NoLogOutputException',
             "The log target is not configured for 'PDepend\\Report\\Dependencies\\Xml'."
         );
diff --git a/src/test/php/PDepend/Report/Jdepend/XmlTest.php b/src/test/php/PDepend/Report/Jdepend/XmlTest.php
index bd9e5b3..71f9009 100644
--- a/src/test/php/PDepend/Report/Jdepend/XmlTest.php
+++ b/src/test/php/PDepend/Report/Jdepend/XmlTest.php
@@ -124,7 +124,7 @@ class XmlTest extends AbstractTest
      */
     public function testThrowsExceptionForInvalidLogTarget()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Report\\NoLogOutputException',
             "The log target is not configured for 'PDepend\\Report\\Jdepend\\Xml'."
         );
diff --git a/src/test/php/PDepend/Report/Overview/PyramidTest.php b/src/test/php/PDepend/Report/Overview/PyramidTest.php
index 9d1adf7..5fff42d 100644
--- a/src/test/php/PDepend/Report/Overview/PyramidTest.php
+++ b/src/test/php/PDepend/Report/Overview/PyramidTest.php
@@ -84,7 +84,7 @@ class PyramidTest extends AbstractTest
      */
     public function testThrowsExceptionForInvalidLogTarget()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Report\\NoLogOutputException',
             "The log target is not configured for 'PDepend\\Report\\Overview\\Pyramid'."
         );
@@ -111,7 +111,7 @@ class PyramidTest extends AbstractTest
      */
     public function testCloseThrowsAnExceptionIfNoCouplingAnalyzerWasSet()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\RuntimeException',
             'Missing Coupling analyzer.'
         );
@@ -132,7 +132,7 @@ class PyramidTest extends AbstractTest
      */
     public function testCloseThrowsAnExceptionIfNoCyclomaticComplexityAnalyzerWasSet()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\RuntimeException',
             'Missing Cyclomatic Complexity analyzer.'
         );
@@ -153,7 +153,7 @@ class PyramidTest extends AbstractTest
      */
     public function testCloseThrowsAnExceptionIfNoInheritanceAnalyzerWasSet()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\RuntimeException',
             'Missing Inheritance analyzer.'
         );
@@ -174,7 +174,7 @@ class PyramidTest extends AbstractTest
      */
     public function testCloseThrowsAnExceptionIfNoNodeCountAnalyzerWasSet()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\RuntimeException',
             'Missing Node Count analyzer.'
         );
@@ -195,7 +195,7 @@ class PyramidTest extends AbstractTest
      */
     public function testCloseThrowsAnExceptionIfNoNodeLOCAnalyzerWasSet()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\RuntimeException',
             'Missing Node LOC analyzer.'
         );
diff --git a/src/test/php/PDepend/Report/ReportGeneratorFactoryTest.php b/src/test/php/PDepend/Report/ReportGeneratorFactoryTest.php
index 62931bd..b53b3b4 100644
--- a/src/test/php/PDepend/Report/ReportGeneratorFactoryTest.php
+++ b/src/test/php/PDepend/Report/ReportGeneratorFactoryTest.php
@@ -97,7 +97,7 @@ class ReportGeneratorFactoryTest extends AbstractTest
      */
     public function testCreateGeneratorWithInvalidIdentifierFail()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\RuntimeException',
             'Unknown generator with identifier "foo-bar-xml".'
         );
diff --git a/src/test/php/PDepend/Report/Summary/XmlTest.php b/src/test/php/PDepend/Report/Summary/XmlTest.php
index 94f0dd9..f1cddf5 100644
--- a/src/test/php/PDepend/Report/Summary/XmlTest.php
+++ b/src/test/php/PDepend/Report/Summary/XmlTest.php
@@ -130,7 +130,7 @@ class XmlTest extends AbstractTest
      */
     public function testThrowsExceptionForInvalidLogTarget()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Report\\NoLogOutputException',
             "The log target is not configured for 'PDepend\\Report\\Summary\\Xml'."
         );
diff --git a/src/test/php/PDepend/Source/AST/ASTConstantDefinitionTest.php b/src/test/php/PDepend/Source/AST/ASTConstantDefinitionTest.php
index 483a3de..3598e2b 100644
--- a/src/test/php/PDepend/Source/AST/ASTConstantDefinitionTest.php
+++ b/src/test/php/PDepend/Source/AST/ASTConstantDefinitionTest.php
@@ -83,7 +83,7 @@ class ASTConstantDefinitionTest extends ASTNodeTest
     {
         $definition = new ASTConstantDefinition();
 
-        $this->setExpectedException(
+        $this->expectException(
             'InvalidArgumentException',
             'Invalid field modifiers given, allowed modifiers are ' .
             'IS_PUBLIC, IS_PROTECTED, IS_PRIVATE and IS_FINAL.'
diff --git a/src/test/php/PDepend/Source/AST/ASTFieldDeclarationTest.php b/src/test/php/PDepend/Source/AST/ASTFieldDeclarationTest.php
index 882fb82..362b1b2 100644
--- a/src/test/php/PDepend/Source/AST/ASTFieldDeclarationTest.php
+++ b/src/test/php/PDepend/Source/AST/ASTFieldDeclarationTest.php
@@ -149,7 +149,7 @@ class ASTFieldDeclarationTest extends ASTNodeTest
     {
         $declaration = new ASTFieldDeclaration();
 
-        $this->setExpectedException(
+        $this->expectException(
             'InvalidArgumentException',
             'Invalid field modifiers given, allowed modifiers are ' .
             'IS_PUBLIC, IS_PROTECTED, IS_PRIVATE and IS_STATIC.'
diff --git a/src/test/php/PDepend/Source/AST/ASTFormalParameterTest.php b/src/test/php/PDepend/Source/AST/ASTFormalParameterTest.php
index f64d86a..b1d510a 100644
--- a/src/test/php/PDepend/Source/AST/ASTFormalParameterTest.php
+++ b/src/test/php/PDepend/Source/AST/ASTFormalParameterTest.php
@@ -92,7 +92,7 @@ class ASTFormalParameterTest extends ASTNodeTest
         $parameter = new ASTFormalParameter();
         $parameter->addChild(new ASTVariableDeclarator());
 
-        $this->setExpectedException('\\OutOfBoundsException');
+        $this->expectException('\\OutOfBoundsException');
 
         $parameter->getType();
     }
diff --git a/src/test/php/PDepend/Source/AST/ASTListExpressionTest.php b/src/test/php/PDepend/Source/AST/ASTListExpressionTest.php
index a2c8085..4e37e0e 100644
--- a/src/test/php/PDepend/Source/AST/ASTListExpressionTest.php
+++ b/src/test/php/PDepend/Source/AST/ASTListExpressionTest.php
@@ -300,7 +300,7 @@ class ASTListExpressionTest extends ASTNodeTest
      */
     public function testListExpressionWithArrayAndEmptySlot()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: ,, line: 4, col: 18, file: '
         );
diff --git a/src/test/php/PDepend/Source/AST/ASTMethodTest.php b/src/test/php/PDepend/Source/AST/ASTMethodTest.php
index 774a91e..14e01e8 100644
--- a/src/test/php/PDepend/Source/AST/ASTMethodTest.php
+++ b/src/test/php/PDepend/Source/AST/ASTMethodTest.php
@@ -400,7 +400,7 @@ class ASTMethodTest extends AbstractASTArtifactTest
      */
     public function testSetInvalidModifierFail()
     {
-        $this->setExpectedException('InvalidArgumentException');
+        $this->expectException('InvalidArgumentException');
 
         $method = new ASTMethod('method');
         $method->setModifiers(-1);
diff --git a/src/test/php/PDepend/Source/AST/ASTStaticReferenceTest.php b/src/test/php/PDepend/Source/AST/ASTStaticReferenceTest.php
index f889891..0d90be4 100644
--- a/src/test/php/PDepend/Source/AST/ASTStaticReferenceTest.php
+++ b/src/test/php/PDepend/Source/AST/ASTStaticReferenceTest.php
@@ -105,7 +105,7 @@ class ASTStaticReferenceTest extends ASTNodeTest
      */
     public function testStaticReferenceAllocationOutsideOfClassScopeThrowsExpectedException()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\InvalidStateException',
             'The keyword "static" was used outside of a class/method scope.'
         );
@@ -120,7 +120,7 @@ class ASTStaticReferenceTest extends ASTNodeTest
      */
     public function testStaticReferenceMemberPrimaryPrefixOutsideOfClassScopeThrowsExpectedException()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\InvalidStateException',
             'The keyword "static" was used outside of a class/method scope.'
         );
diff --git a/src/test/php/PDepend/Source/Language/PHP/Features/PHP80/ConstructorPropertyPromotionTest.php b/src/test/php/PDepend/Source/Language/PHP/Features/PHP80/ConstructorPropertyPromotionTest.php
index a85e31e..a686509 100644
--- a/src/test/php/PDepend/Source/Language/PHP/Features/PHP80/ConstructorPropertyPromotionTest.php
+++ b/src/test/php/PDepend/Source/Language/PHP/Features/PHP80/ConstructorPropertyPromotionTest.php
@@ -133,11 +133,11 @@ class ConstructorPropertyPromotionTest extends PHPParserVersion80Test
 
     /**
      * @return void
-     * @expectedException \PDepend\Source\Parser\TokenException
-     * @expectedExceptionMessage Unexpected token: private, line: 5, col: 9
      */
     public function testPropertyPromotionOnRandomMethod()
     {
+        $this->expectException('\PDepend\Source\Parser\TokenException');
+        $this->expectExceptionMessage('Unexpected token: private, line: 5, col: 9');
         $this->parseCodeResourceForTest();
     }
 }
diff --git a/src/test/php/PDepend/Source/Language/PHP/Features/PHP80/MatchExpressionTest.php b/src/test/php/PDepend/Source/Language/PHP/Features/PHP80/MatchExpressionTest.php
index 5a54d5f..8f4f1ea 100644
--- a/src/test/php/PDepend/Source/Language/PHP/Features/PHP80/MatchExpressionTest.php
+++ b/src/test/php/PDepend/Source/Language/PHP/Features/PHP80/MatchExpressionTest.php
@@ -228,12 +228,12 @@ class MatchExpressionTest extends PHPParserVersion80Test
     }
 
     /**
-     * @expectedException \PDepend\Source\Parser\UnexpectedTokenException
-     * @expectedExceptionMessage Unexpected token: ,, line: 5, col: 25
      * @return void
      */
     public function testMatchExpressionWithTooManyArguments()
     {
+        $this->expectException('\PDepend\Source\Parser\UnexpectedTokenException');
+        $this->expectExceptionMessage('Unexpected token: ,, line: 5, col: 25');
         $this->parseCodeResourceForTest();
     }
 }
diff --git a/src/test/php/PDepend/Source/Language/PHP/Features/PHP81/ReadonlyClassTest.php b/src/test/php/PDepend/Source/Language/PHP/Features/PHP81/ReadonlyClassTest.php
index 5d37018..eb80fcc 100644
--- a/src/test/php/PDepend/Source/Language/PHP/Features/PHP81/ReadonlyClassTest.php
+++ b/src/test/php/PDepend/Source/Language/PHP/Features/PHP81/ReadonlyClassTest.php
@@ -54,7 +54,7 @@ class ReadonlyClassTest extends PHPParserVersion81Test
      */
     public function testReadonlyClass()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: readonly, line: 2, col: 1, file: '
         );
diff --git a/src/test/php/PDepend/Source/Language/PHP/PHPBuilderTest.php b/src/test/php/PDepend/Source/Language/PHP/PHPBuilderTest.php
index 2dc4728..e19fbee 100644
--- a/src/test/php/PDepend/Source/Language/PHP/PHPBuilderTest.php
+++ b/src/test/php/PDepend/Source/Language/PHP/PHPBuilderTest.php
@@ -657,7 +657,7 @@ class PHPBuilderTest extends AbstractTest
         // Freeze object
         $builder->getClass('Foo');
 
-        $this->setExpectedException(
+        $this->expectException(
             'BadMethodCallException',
             'Cannot create new nodes, when internal state is frozen.'
         );
@@ -679,7 +679,7 @@ class PHPBuilderTest extends AbstractTest
         // Freeze object
         $builder->getClass('Foo');
 
-        $this->setExpectedException(
+        $this->expectException(
             'BadMethodCallException',
             'Cannot create new nodes, when internal state is frozen.'
         );
@@ -701,7 +701,7 @@ class PHPBuilderTest extends AbstractTest
         // Freeze object
         $builder->getClass('Foo');
 
-        $this->setExpectedException(
+        $this->expectException(
             'BadMethodCallException',
             'Cannot create new nodes, when internal state is frozen.'
         );
@@ -723,7 +723,7 @@ class PHPBuilderTest extends AbstractTest
         // Freeze object
         $builder->getInterface('Inter');
 
-        $this->setExpectedException(
+        $this->expectException(
             'BadMethodCallException',
             'Cannot create new nodes, when internal state is frozen.'
         );
@@ -745,7 +745,7 @@ class PHPBuilderTest extends AbstractTest
         // Freeze object
         $builder->getInterface('Inter');
 
-        $this->setExpectedException(
+        $this->expectException(
             'BadMethodCallException',
             'Cannot create new nodes, when internal state is frozen.'
         );
@@ -767,7 +767,7 @@ class PHPBuilderTest extends AbstractTest
         // Freeze object
         $builder->getInterface('Inter');
 
-        $this->setExpectedException(
+        $this->expectException(
             'BadMethodCallException',
             'Cannot create new nodes, when internal state is frozen.'
         );
diff --git a/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion53Test.php b/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion53Test.php
index 6952b91..a87b779 100644
--- a/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion53Test.php
+++ b/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion53Test.php
@@ -133,7 +133,7 @@ class PHPParserVersion53Test extends AbstractTest
      */
     public function testParserThrowsUnexpectedTokenExceptionForInvalidTokenInPropertyDeclaration()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: const, line: 4, col: 13, file: '
         );
diff --git a/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion54Test.php b/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion54Test.php
index 3a9907a..81758a8 100644
--- a/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion54Test.php
+++ b/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion54Test.php
@@ -395,7 +395,7 @@ class PHPParserVersion54Test extends AbstractTest
      */
     public function testParserThrowsUnexpectedTokenExceptionForInvalidTokenInPropertyDeclaration()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: const, line: 4, col: 13, file: '
         );
diff --git a/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion55Test.php b/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion55Test.php
index 3879cf7..e711b1a 100644
--- a/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion55Test.php
+++ b/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion55Test.php
@@ -129,7 +129,7 @@ class PHPParserVersion55Test extends AbstractTest
      */
     public function testParserThrowsUnexpectedTokenExceptionForInvalidTokenInPropertyDeclaration()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: const, line: 4, col: 13, file: '
         );
diff --git a/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion56Test.php b/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion56Test.php
index fc52801..2e48ec4 100644
--- a/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion56Test.php
+++ b/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion56Test.php
@@ -195,7 +195,7 @@ class PHPParserVersion56Test extends AbstractTest
      */
     public function testParserThrowsUnexpectedTokenExceptionForInvalidTokenInPropertyDeclaration()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: const, line: 4, col: 13, file: '
         );
@@ -294,7 +294,7 @@ class PHPParserVersion56Test extends AbstractTest
      */
     public function testReservedKeyword()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: NEW, line: 5, col: 11, file: '
         );
diff --git a/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion70Test.php b/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion70Test.php
index a53b385..8ae93b3 100644
--- a/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion70Test.php
+++ b/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion70Test.php
@@ -545,7 +545,7 @@ class PHPParserVersion70Test extends AbstractTest
      */
     public function testParseListWithSquaredBrackets()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: [, line: 2, col: 26, file: '
         );
@@ -561,7 +561,7 @@ class PHPParserVersion70Test extends AbstractTest
      */
     public function testParserThrowsUnexpectedTokenExceptionForInvalidTokenInPropertyDeclaration()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: const, line: 4, col: 13, file: '
         );
@@ -576,7 +576,7 @@ class PHPParserVersion70Test extends AbstractTest
      */
     public function testVoidTypeHintReturn()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: void, line: 2, col: 23, file: '
         );
@@ -591,7 +591,7 @@ class PHPParserVersion70Test extends AbstractTest
      */
     public function testListExpressionWithSquaredBrackets()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: [, line: 4, col: 5, file: '
         );
@@ -606,7 +606,7 @@ class PHPParserVersion70Test extends AbstractTest
      */
     public function testListExpressionWithKeys()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: "a", line: 4, col: 10, file: '
         );
@@ -621,7 +621,7 @@ class PHPParserVersion70Test extends AbstractTest
      */
     public function testListExpressionWithKeysAndNestedList()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: \'a\', line: 4, col: 10, file: '
         );
@@ -675,7 +675,7 @@ class PHPParserVersion70Test extends AbstractTest
 
     public function testCallableKeywordAsClassName()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: callable, line: 3, col: 7, file: '
         );
@@ -685,7 +685,7 @@ class PHPParserVersion70Test extends AbstractTest
 
     public function testTraitKeywordAsClassName()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: trait, line: 3, col: 7, file: '
         );
@@ -695,7 +695,7 @@ class PHPParserVersion70Test extends AbstractTest
 
     public function testInsteadofKeywordAsClassName()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: insteadof, line: 3, col: 7, file: '
         );
@@ -705,7 +705,7 @@ class PHPParserVersion70Test extends AbstractTest
 
     public function testCallableKeywordAsInterfaceName()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: callable, line: 3, col: 11, file: '
         );
@@ -715,7 +715,7 @@ class PHPParserVersion70Test extends AbstractTest
 
     public function testTraitKeywordAsInterfaceName()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: trait, line: 3, col: 11, file: '
         );
@@ -725,7 +725,7 @@ class PHPParserVersion70Test extends AbstractTest
 
     public function testInsteadofKeywordAsInterfaceName()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: insteadof, line: 3, col: 11, file: '
         );
@@ -751,7 +751,7 @@ class PHPParserVersion70Test extends AbstractTest
      */
     public function testSymmetricArrayDestructuringEmptySlot()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\InvalidStateException',
             'The parser has reached an invalid state near line "4" in file'
         );
diff --git a/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion71Test.php b/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion71Test.php
index c7ac589..8e4719f 100644
--- a/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion71Test.php
+++ b/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion71Test.php
@@ -77,7 +77,7 @@ class PHPParserVersion71Test extends AbstractTest
      */
     public function testConstVisibilityInInterfaceProtected()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\InvalidStateException',
             'Constant can\'t be declared private or protected in interface "TestInterface".'
         );
@@ -90,7 +90,7 @@ class PHPParserVersion71Test extends AbstractTest
      */
     public function testConstVisibilityInInterfacePrivate()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\InvalidStateException',
             'Constant can\'t be declared private or protected in interface "TestInterface".'
         );
diff --git a/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion73Test.php b/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion73Test.php
index b776364..23e9e97 100644
--- a/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion73Test.php
+++ b/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion73Test.php
@@ -72,7 +72,7 @@ class PHPParserVersion73Test extends AbstractTest
             $this->markTestSkipped('This test requires PHP < 7.4');
         }
 
-        $this->setExpectedException(
+        $this->expectException(
             'PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: =>, line: 4, col: 34, file:'
         );
diff --git a/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion74Test.php b/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion74Test.php
index 729acb5..a2b155d 100644
--- a/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion74Test.php
+++ b/src/test/php/PDepend/Source/Language/PHP/PHPParserVersion74Test.php
@@ -160,7 +160,7 @@ class PHPParserVersion74Test extends AbstractTest
 
     public function testTypedPropertiesSyntaxError()
     {
-        $this->setExpectedException(
+        $this->expectException(
             'PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: string, line: 4, col: 16, file:'
         );
diff --git a/src/test/php/PDepend/Source/Parser/ASTAllocationExpressionParsingTest.php b/src/test/php/PDepend/Source/Parser/ASTAllocationExpressionParsingTest.php
index 8424fd9..ae63c06 100644
--- a/src/test/php/PDepend/Source/Parser/ASTAllocationExpressionParsingTest.php
+++ b/src/test/php/PDepend/Source/Parser/ASTAllocationExpressionParsingTest.php
@@ -273,7 +273,7 @@ class ASTAllocationExpressionParsingTest extends AbstractParserTest
      */
     public function testInvalidAllocationExpressionResultsInExpectedException()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\\PDepend\\Source\\Parser\\UnexpectedTokenException',
             'Unexpected token: ;, line: 4, col: 9, file: '
         );
diff --git a/src/test/php/PDepend/Source/Parser/SymbolTableTest.php b/src/test/php/PDepend/Source/Parser/SymbolTableTest.php
index 66128c3..ddac678 100644
--- a/src/test/php/PDepend/Source/Parser/SymbolTableTest.php
+++ b/src/test/php/PDepend/Source/Parser/SymbolTableTest.php
@@ -58,7 +58,7 @@ class SymbolTableTest extends AbstractTest
      */
     public function testCannotAddSymbolToASymbolTableWithoutActiveScope()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\PDepend\Source\Parser\NoActiveScopeException',
             'No active scope in symbol table.'
         );
@@ -73,7 +73,7 @@ class SymbolTableTest extends AbstractTest
      */
     public function testCannotPerformLookupOnASymbolTableWithoutActiveScope()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\PDepend\Source\Parser\NoActiveScopeException',
             'No active scope in symbol table.'
         );
@@ -88,7 +88,7 @@ class SymbolTableTest extends AbstractTest
      */
     public function testCannotResetWithoutActiveScope()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\PDepend\Source\Parser\NoActiveScopeException',
             'No active scope in symbol table.'
         );
@@ -103,7 +103,7 @@ class SymbolTableTest extends AbstractTest
      */
     public function testCannotDestroyWithoutActiveScope()
     {
-        $this->setExpectedException(
+        $this->expectException(
             '\PDepend\Source\Parser\NoActiveScopeException',
             'No active scope in symbol table.'
         );