| | 1 | <?php |
| | 2 | |
| | 3 | if ( class_exists( 'PHPUnit\Runner\Version' ) && version_compare( PHPUnit\Runner\Version::id(), '6.0', '>=' ) ) { |
| | 4 | class_alias( 'PHPUnit\Framework\TestCase', 'PHPUnit_Framework_TestCase' ); |
| | 5 | class_alias( 'PHPUnit\Framework\Exception', 'PHPUnit_Framework_Exception' ); |
| | 6 | class_alias( 'PHPUnit\Framework\ExpectationFailedException', 'PHPUnit_Framework_ExpectationFailedException' ); |
| | 7 | class_alias( 'PHPUnit\Framework\Error\Notice', 'PHPUnit_Framework_Error_Notice' ); |
| | 8 | class_alias( 'PHPUnit\Framework\Test', 'PHPUnit_Framework_Test' ); |
| | 9 | class_alias( 'PHPUnit\Framework\Warning', 'PHPUnit_Framework_Warning' ); |
| | 10 | class_alias( 'PHPUnit\Framework\AssertionFailedError', 'PHPUnit_Framework_AssertionFailedError' ); |
| | 11 | class_alias( 'PHPUnit\Framework\TestSuite', 'PHPUnit_Framework_TestSuite' ); |
| | 12 | class_alias( 'PHPUnit\Framework\TestListener', 'PHPUnit_Framework_TestListener' ); |
| | 13 | class_alias( 'PHPUnit\Util\GlobalState', 'PHPUnit_Util_GlobalState' ); |
| | 14 | class_alias( 'PHPUnit\Util\Getopt', 'PHPUnit_Util_Getopt' ); |
| | 15 | |
| | 16 | class PHPUnit_Util_Test extends PHPUnit\Util\Test { |
| | 17 | public static function getTickets( $className, $methodName ) { |
| | 18 | $annotations = self::parseTestMethodAnnotations( |
| | 19 | $className, $methodName |
| | 20 | ); |
| | 21 | |
| | 22 | $tickets = array(); |
| | 23 | |
| | 24 | if (isset($annotations['class']['ticket'])) { |
| | 25 | $tickets = $annotations['class']['ticket']; |
| | 26 | } |
| | 27 | |
| | 28 | if (isset($annotations['method']['ticket'])) { |
| | 29 | $tickets = array_merge($tickets, $annotations['method']['ticket']); |
| | 30 | } |
| | 31 | |
| | 32 | return array_unique($tickets); |
| | 33 | } |
| | 34 | } |
| | 35 | } |