@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | // Support PHPUnit 6.0 |
| 46 | 46 | if (! class_exists('PHPUnit_Util_Configuration')) { |
| 47 | - class_alias('PHPUnit\Util\Configuration', 'PHPUnit_Util_Configuration'); |
|
| 47 | + class_alias('PHPUnit\Util\Configuration', 'PHPUnit_Util_Configuration'); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
@@ -57,71 +57,71 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | final class TestSuiteProvider |
| 59 | 59 | { |
| 60 | - /** |
|
| 61 | - * phpunit configuration file |
|
| 62 | - * |
|
| 63 | - * @var string |
|
| 64 | - */ |
|
| 65 | - private static $file; |
|
| 60 | + /** |
|
| 61 | + * phpunit configuration file |
|
| 62 | + * |
|
| 63 | + * @var string |
|
| 64 | + */ |
|
| 65 | + private static $file; |
|
| 66 | 66 | |
| 67 | - /** |
|
| 68 | - * constructor |
|
| 69 | - */ |
|
| 70 | - private function __construct() {} |
|
| 67 | + /** |
|
| 68 | + * constructor |
|
| 69 | + */ |
|
| 70 | + private function __construct() {} |
|
| 71 | 71 | |
| 72 | - /** |
|
| 73 | - * set the phpunit configuration file |
|
| 74 | - * |
|
| 75 | - * @param string $file the path or filename of the phunit configuration file |
|
| 76 | - */ |
|
| 77 | - public static function setConfigurationFile($file) |
|
| 78 | - { |
|
| 79 | - static::$file = $file; |
|
| 80 | - } |
|
| 72 | + /** |
|
| 73 | + * set the phpunit configuration file |
|
| 74 | + * |
|
| 75 | + * @param string $file the path or filename of the phunit configuration file |
|
| 76 | + */ |
|
| 77 | + public static function setConfigurationFile($file) |
|
| 78 | + { |
|
| 79 | + static::$file = $file; |
|
| 80 | + } |
|
| 81 | 81 | |
| 82 | - /** |
|
| 83 | - * get the phpunit test suite instance |
|
| 84 | - * |
|
| 85 | - * @return PHPUnit_Framework_TestSuite returns the phpunit test suite instance |
|
| 86 | - * @throws FileNotFoundException if the file is not found |
|
| 87 | - */ |
|
| 88 | - public static function suite() |
|
| 89 | - { |
|
| 90 | - $file = static::checkConfigurationFile( |
|
| 91 | - static::getConfigurationFile() |
|
| 92 | - ); |
|
| 82 | + /** |
|
| 83 | + * get the phpunit test suite instance |
|
| 84 | + * |
|
| 85 | + * @return PHPUnit_Framework_TestSuite returns the phpunit test suite instance |
|
| 86 | + * @throws FileNotFoundException if the file is not found |
|
| 87 | + */ |
|
| 88 | + public static function suite() |
|
| 89 | + { |
|
| 90 | + $file = static::checkConfigurationFile( |
|
| 91 | + static::getConfigurationFile() |
|
| 92 | + ); |
|
| 93 | 93 | |
| 94 | - return PHPUnit_Util_Configuration::getInstance($file) |
|
| 95 | - ->getTestSuiteConfiguration(); |
|
| 96 | - } |
|
| 94 | + return PHPUnit_Util_Configuration::getInstance($file) |
|
| 95 | + ->getTestSuiteConfiguration(); |
|
| 96 | + } |
|
| 97 | 97 | |
| 98 | - /** |
|
| 99 | - * get the phpunit configuration file |
|
| 100 | - * |
|
| 101 | - * @return string |
|
| 102 | - */ |
|
| 103 | - private static function getConfigurationFile() |
|
| 104 | - { |
|
| 105 | - static::$file = isset(static::$file) |
|
| 106 | - ? static::$file |
|
| 107 | - : TESTPATH.'phpunit.xml'; |
|
| 98 | + /** |
|
| 99 | + * get the phpunit configuration file |
|
| 100 | + * |
|
| 101 | + * @return string |
|
| 102 | + */ |
|
| 103 | + private static function getConfigurationFile() |
|
| 104 | + { |
|
| 105 | + static::$file = isset(static::$file) |
|
| 106 | + ? static::$file |
|
| 107 | + : TESTPATH.'phpunit.xml'; |
|
| 108 | 108 | |
| 109 | - return static::$file; |
|
| 110 | - } |
|
| 109 | + return static::$file; |
|
| 110 | + } |
|
| 111 | 111 | |
| 112 | - /** |
|
| 113 | - * check the given file |
|
| 114 | - * |
|
| 115 | - * @param string $file file to check |
|
| 116 | - * @return string returns the file if it is valid |
|
| 117 | - * @throws FileNotFoundException if the file is not found |
|
| 118 | - */ |
|
| 119 | - private static function checkConfigurationFile($file) |
|
| 120 | - { |
|
| 121 | - if (!file_exists($file)) { |
|
| 122 | - throw new \RuntimeException("The requested phpunit configuration was not found at $file"); |
|
| 123 | - } |
|
| 112 | + /** |
|
| 113 | + * check the given file |
|
| 114 | + * |
|
| 115 | + * @param string $file file to check |
|
| 116 | + * @return string returns the file if it is valid |
|
| 117 | + * @throws FileNotFoundException if the file is not found |
|
| 118 | + */ |
|
| 119 | + private static function checkConfigurationFile($file) |
|
| 120 | + { |
|
| 121 | + if (!file_exists($file)) { |
|
| 122 | + throw new \RuntimeException("The requested phpunit configuration was not found at $file"); |
|
| 123 | + } |
|
| 124 | 124 | |
| 125 | - return $file; |
|
| 126 | - } |
|
| 125 | + return $file; |
|
| 126 | + } |
|
| 127 | 127 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | use PHPUnit_Util_Configuration; |
| 44 | 44 | |
| 45 | 45 | // Support PHPUnit 6.0 |
| 46 | -if (! class_exists('PHPUnit_Util_Configuration')) { |
|
| 46 | +if ( ! class_exists('PHPUnit_Util_Configuration')) { |
|
| 47 | 47 | class_alias('PHPUnit\Util\Configuration', 'PHPUnit_Util_Configuration'); |
| 48 | 48 | } |
| 49 | 49 | |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | */ |
| 119 | 119 | private static function checkConfigurationFile($file) |
| 120 | 120 | { |
| 121 | - if (!file_exists($file)) { |
|
| 121 | + if ( ! file_exists($file)) { |
|
| 122 | 122 | throw new \RuntimeException("The requested phpunit configuration was not found at $file"); |
| 123 | 123 | } |
| 124 | 124 | |