|
2 | 2 |
|
3 | 3 | if ( class_exists( 'PHPUnit\Runner\Version' ) && version_compare( PHPUnit\Runner\Version::id(), '6.0', '>=' ) ) { |
4 | 4 |
|
5 | | - class_alias( 'PHPUnit\Framework\TestCase', 'PHPUnit_Framework_TestCase' ); |
6 | | - class_alias( 'PHPUnit\Framework\Exception', 'PHPUnit_Framework_Exception' ); |
7 | | - class_alias( 'PHPUnit\Framework\ExpectationFailedException', 'PHPUnit_Framework_ExpectationFailedException' ); |
8 | | - class_alias( 'PHPUnit\Framework\Error\Deprecated', 'PHPUnit_Framework_Error_Deprecated' ); |
9 | | - class_alias( 'PHPUnit\Framework\Error\Notice', 'PHPUnit_Framework_Error_Notice' ); |
10 | | - class_alias( 'PHPUnit\Framework\Error\Warning', 'PHPUnit_Framework_Error_Warning' ); |
11 | | - class_alias( 'PHPUnit\Framework\Test', 'PHPUnit_Framework_Test' ); |
12 | | - class_alias( 'PHPUnit\Framework\Warning', 'PHPUnit_Framework_Warning' ); |
13 | | - class_alias( 'PHPUnit\Framework\AssertionFailedError', 'PHPUnit_Framework_AssertionFailedError' ); |
14 | | - class_alias( 'PHPUnit\Framework\TestSuite', 'PHPUnit_Framework_TestSuite' ); |
15 | | - class_alias( 'PHPUnit\Framework\TestListener', 'PHPUnit_Framework_TestListener' ); |
16 | | - class_alias( 'PHPUnit\Util\GlobalState', 'PHPUnit_Util_GlobalState' ); |
17 | | - if ( class_exists( 'PHPUnit\Util\Getopt' ) ) { |
18 | | - class_alias( 'PHPUnit\Util\Getopt', 'PHPUnit_Util_Getopt' ); |
| 5 | + $aliases = array( |
| 6 | + 'PHPUnit\Framework\TestCase' => 'PHPUnit_Framework_TestCase', |
| 7 | + 'PHPUnit\Framework\Exception' => 'PHPUnit_Framework_Exception', |
| 8 | + 'PHPUnit\Framework\ExpectationFailedException' => 'PHPUnit_Framework_ExpectationFailedException', |
| 9 | + 'PHPUnit\Framework\Error\Deprecated' => 'PHPUnit_Framework_Error_Deprecated', |
| 10 | + 'PHPUnit\Framework\Error\Notice' => 'PHPUnit_Framework_Error_Notice', |
| 11 | + 'PHPUnit\Framework\Error\Warning' => 'PHPUnit_Framework_Error_Warning', |
| 12 | + 'PHPUnit\Framework\Test' => 'PHPUnit_Framework_Test', |
| 13 | + 'PHPUnit\Framework\Warning' => 'PHPUnit_Framework_Warning', |
| 14 | + 'PHPUnit\Framework\AssertionFailedError' => 'PHPUnit_Framework_AssertionFailedError', |
| 15 | + 'PHPUnit\Framework\TestSuite' => 'PHPUnit_Framework_TestSuite', |
| 16 | + 'PHPUnit\Framework\TestListener' => 'PHPUnit_Framework_TestListener', |
| 17 | + 'PHPUnit\Util\GlobalState' => 'PHPUnit_Util_GlobalState', |
| 18 | + 'PHPUnit\Util\Getopt' => 'PHPUnit_Util_Getopt', |
| 19 | + ); |
| 20 | + |
| 21 | + foreach ( $aliases as $original => $alias ) { |
| 22 | + if ( class_exists( $original ) ) { |
| 23 | + class_alias( $original, $alias ); |
| 24 | + } |
19 | 25 | } |
20 | 26 |
|
21 | 27 | class PHPUnit_Util_Test { |
|
0 commit comments