File tree Expand file tree Collapse file tree 5 files changed +4
-72
lines changed
Expand file tree Collapse file tree 5 files changed +4
-72
lines changed Original file line number Diff line number Diff line change 3636 "ext-xmlwriter" : " *"
3737 },
3838 "require-dev" : {
39- "phpunit/phpunit" : " ^4.0 || ^5.0 || ^6.0 || ^7.0 || ^ 8.0 || ^9.3.4"
39+ "phpunit/phpunit" : " ^8.0 || ^9.3.4"
4040 },
4141 "bin" : [
4242 " bin/phpcbf" ,
Original file line number Diff line number Diff line change 1111
1212require_once 'Core/AllTests.php ' ;
1313require_once 'Standards/AllSniffs.php ' ;
14-
15- // PHPUnit 7 made the TestSuite run() method incompatible with
16- // older PHPUnit versions due to return type hints, so maintain
17- // two different suite objects.
18- $ phpunit7 = false ;
19- if (class_exists ('\PHPUnit\Runner\Version ' ) === true ) {
20- $ version = \PHPUnit \Runner \Version::id ();
21- if (version_compare ($ version , '7.0 ' , '>= ' ) === true ) {
22- $ phpunit7 = true ;
23- }
24- }
25-
26- if ($ phpunit7 === true ) {
27- include_once 'TestSuite7.php ' ;
28- } else {
29- include_once 'TestSuite.php ' ;
30- }
14+ require_once 'TestSuite.php ' ;
3115
3216class PHP_CodeSniffer_AllTests
3317{
Original file line number Diff line number Diff line change @@ -19,11 +19,11 @@ class TestSuite extends PHPUnit_TestSuite
1919 /**
2020 * Runs the tests and collects their result in a TestResult.
2121 *
22- * @param \PHPUnit\Framework\TestResult $result A test result.
22+ * @param \PHPUnit\Framework\TestResult|null $result A test result.
2323 *
2424 * @return \PHPUnit\Framework\TestResult
2525 */
26- public function run (TestResult $ result =null )
26+ public function run (? TestResult $ result =null ): TestResult
2727 {
2828 $ result = parent ::run ($ result );
2929 printPHPCodeSnifferTestOutput ();
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 4242
4343$ tokens = new \PHP_CodeSniffer \Util \Tokens ();
4444
45- // Compatibility for PHPUnit < 6 and PHPUnit 6+.
46- if (class_exists ('PHPUnit_Framework_TestSuite ' ) === true && class_exists ('PHPUnit\Framework\TestSuite ' ) === false ) {
47- class_alias ('PHPUnit_Framework_TestSuite ' , 'PHPUnit ' .'\Framework\TestSuite ' );
48- }
49-
50- if (class_exists ('PHPUnit_Framework_TestCase ' ) === true && class_exists ('PHPUnit\Framework\TestCase ' ) === false ) {
51- class_alias ('PHPUnit_Framework_TestCase ' , 'PHPUnit ' .'\Framework\TestCase ' );
52- }
53-
54- if (class_exists ('PHPUnit_TextUI_TestRunner ' ) === true && class_exists ('PHPUnit\TextUI\TestRunner ' ) === false ) {
55- class_alias ('PHPUnit_TextUI_TestRunner ' , 'PHPUnit ' .'\TextUI\TestRunner ' );
56- }
57-
58- if (class_exists ('PHPUnit_Framework_TestResult ' ) === true && class_exists ('PHPUnit\Framework\TestResult ' ) === false ) {
59- class_alias ('PHPUnit_Framework_TestResult ' , 'PHPUnit ' .'\Framework\TestResult ' );
60- }
61-
6245
6346/**
6447 * A global util function to help print unit test fixing data.
You can’t perform that action at this time.
0 commit comments