9
9
10
10
namespace PHP_CodeSniffer \Tests \Standards ;
11
11
12
- use PHP_CodeSniffer \Util \Tokens ;
13
12
use PHP_CodeSniffer \Util \Standards ;
14
13
use PHP_CodeSniffer \Autoload ;
15
14
use PHP_CodeSniffer \Tests \Standards \AbstractSniffUnitTest ;
16
-
17
- if (defined ('PHP_CODESNIFFER_IN_TESTS ' ) === false ) {
18
- define ('PHP_CODESNIFFER_IN_TESTS ' , true );
19
- }
20
-
21
- if (defined ('PHP_CODESNIFFER_CBF ' ) === false ) {
22
- define ('PHP_CODESNIFFER_CBF ' , false );
23
- }
24
-
25
- if (defined ('PHP_CODESNIFFER_VERBOSITY ' ) === false ) {
26
- define ('PHP_CODESNIFFER_VERBOSITY ' , 0 );
27
- }
28
-
29
- if (is_file (__DIR__ .'/../../autoload.php ' ) === true ) {
30
- include_once __DIR__ .'/../../autoload.php ' ;
31
- } else {
32
- include_once 'PHP/CodeSniffer/autoload.php ' ;
33
- }
34
-
35
- $ tokens = new Tokens ();
15
+ use PHPUnit \TextUI \TestRunner ;
16
+ use PHPUnit \Framework \TestSuite ;
36
17
37
18
class AllSniffs
38
19
{
@@ -45,7 +26,7 @@ class AllSniffs
45
26
*/
46
27
public static function main ()
47
28
{
48
- \PHPUnit_TextUI_TestRunner ::run (self ::suite ());
29
+ TestRunner ::run (self ::suite ());
49
30
50
31
}//end main()
51
32
@@ -56,14 +37,14 @@ public static function main()
56
37
* Sniff unit tests are found by recursing through the 'Tests' directory
57
38
* of each installed coding standard.
58
39
*
59
- * @return \PHPUnit_Framework_TestSuite
40
+ * @return \PHPUnit\Framework\TestSuite
60
41
*/
61
42
public static function suite ()
62
43
{
63
44
$ GLOBALS ['PHP_CODESNIFFER_SNIFF_CODES ' ] = array ();
64
45
$ GLOBALS ['PHP_CODESNIFFER_FIXABLE_CODES ' ] = array ();
65
46
66
- $ suite = new \ PHPUnit_Framework_TestSuite ('PHP CodeSniffer Standards ' );
47
+ $ suite = new TestSuite ('PHP CodeSniffer Standards ' );
67
48
68
49
$ isInstalled = !is_file (__DIR__ .'/../../autoload.php ' );
69
50
0 commit comments