File tree 4 files changed +58
-0
lines changed
4 files changed +58
-0
lines changed Original file line number Diff line number Diff line change @@ -33,13 +33,35 @@ class AcceptTest extends TestCase
33
33
protected static $ ruleset ;
34
34
35
35
36
+ /**
37
+ * Initialize the test.
38
+ *
39
+ * @return void
40
+ */
41
+ public function setUp ()
42
+ {
43
+ if ($ GLOBALS ['PHP_CODESNIFFER_PEAR ' ] === true ) {
44
+ // PEAR installs test and sniff files into different locations
45
+ // so these tests will not pass as they directly reference files
46
+ // by relative location.
47
+ $ this ->markTestSkipped ('Test cannot run from a PEAR install ' );
48
+ }
49
+
50
+ }//end setUp()
51
+
52
+
36
53
/**
37
54
* Initialize the config and ruleset objects based on the `AcceptTest.xml` ruleset file.
38
55
*
39
56
* @return void
40
57
*/
41
58
public static function setUpBeforeClass ()
42
59
{
60
+ if ($ GLOBALS ['PHP_CODESNIFFER_PEAR ' ] === true ) {
61
+ // This test will be skipped.
62
+ return ;
63
+ }
64
+
43
65
$ standard = __DIR__ .'/ ' .basename (__FILE__ , '.php ' ).'.xml ' ;
44
66
self ::$ config = new Config (["--standard= $ standard " , "--ignore=*/somethingelse/* " ]);
45
67
self ::$ ruleset = new Ruleset (self ::$ config );
Original file line number Diff line number Diff line change @@ -45,6 +45,13 @@ class RuleInclusionAbsoluteLinuxTest extends TestCase
45
45
*/
46
46
public function setUp ()
47
47
{
48
+ if ($ GLOBALS ['PHP_CODESNIFFER_PEAR ' ] === true ) {
49
+ // PEAR installs test and sniff files into different locations
50
+ // so these tests will not pass as they directly reference files
51
+ // by relative location.
52
+ $ this ->markTestSkipped ('Test cannot run from a PEAR install ' );
53
+ }
54
+
48
55
$ this ->standard = __DIR__ .'/ ' .basename (__FILE__ , '.php ' ).'.xml ' ;
49
56
$ repoRootDir = dirname (dirname (dirname (__DIR__ )));
50
57
Original file line number Diff line number Diff line change @@ -49,6 +49,13 @@ public function setUp()
49
49
$ this ->markTestSkipped ('Windows specific test ' );
50
50
}
51
51
52
+ if ($ GLOBALS ['PHP_CODESNIFFER_PEAR ' ] === true ) {
53
+ // PEAR installs test and sniff files into different locations
54
+ // so these tests will not pass as they directly reference files
55
+ // by relative location.
56
+ $ this ->markTestSkipped ('Test cannot run from a PEAR install ' );
57
+ }
58
+
52
59
$ this ->standard = __DIR__ .'/ ' .basename (__FILE__ , '.php ' ).'.xml ' ;
53
60
$ repoRootDir = dirname (dirname (dirname (__DIR__ )));
54
61
Original file line number Diff line number Diff line change @@ -24,13 +24,35 @@ class RuleInclusionTest extends TestCase
24
24
protected static $ ruleset ;
25
25
26
26
27
+ /**
28
+ * Initialize the test.
29
+ *
30
+ * @return void
31
+ */
32
+ public function setUp ()
33
+ {
34
+ if ($ GLOBALS ['PHP_CODESNIFFER_PEAR ' ] === true ) {
35
+ // PEAR installs test and sniff files into different locations
36
+ // so these tests will not pass as they directly reference files
37
+ // by relative location.
38
+ $ this ->markTestSkipped ('Test cannot run from a PEAR install ' );
39
+ }
40
+
41
+ }//end setUp()
42
+
43
+
27
44
/**
28
45
* Initialize the config and ruleset objects based on the `RuleInclusionTest.xml` ruleset file.
29
46
*
30
47
* @return void
31
48
*/
32
49
public static function setUpBeforeClass ()
33
50
{
51
+ if ($ GLOBALS ['PHP_CODESNIFFER_PEAR ' ] === true ) {
52
+ // This test will be skipped.
53
+ return ;
54
+ }
55
+
34
56
$ standard = __DIR__ .'/ ' .basename (__FILE__ , '.php ' ).'.xml ' ;
35
57
$ config = new Config (["--standard= $ standard " ]);
36
58
self ::$ ruleset = new Ruleset ($ config );
You can’t perform that action at this time.
0 commit comments