1414
1515class Extensions extends \PHPUnit \Framework \TestCase
1616 {
17+ private ?\PHPFUI \PHPUnitSyntaxCoverage \ClassFinder $ classFinder = null ;
18+
1719 private static \PhpParser \Parser $ parser ;
1820
1921 /**
@@ -30,8 +32,6 @@ class Extensions extends \PHPUnit\Framework\TestCase
3032
3133 private ?\PhpParser \NodeTraverser $ traverser = null ;
3234
33- private ?\PHPFUI \PHPUnitSyntaxCoverage \ClassFinder $ classFinder = null ;
34-
3535 public static function setUpBeforeClass () : void
3636 {
3737 $ factory = new \PhpParser \ParserFactory ();
@@ -50,6 +50,32 @@ protected function tearDown() : void
5050 $ this ->classFinder = null ;
5151 }
5252
53+ /**
54+ * Exclude any file with this $directory string in the path.
55+ *
56+ * Only a simple stripos is used to match anything in the file name.
57+ *
58+ * You can add multiple skips.
59+ */
60+ public function addSkipDirectory (string $ directory ) : self
61+ {
62+ $ this ->skipDirectories [] = $ directory ;
63+
64+ return $ this ;
65+ }
66+
67+ /**
68+ * Exclude namespace from namespace testing
69+ *
70+ * You can add multiple namespaces to skip.
71+ */
72+ public function addSkipNamespace (string $ namespace ) : self
73+ {
74+ $ this ->skipNamespaces [] = $ namespace ;
75+
76+ return $ this ;
77+ }
78+
5379 /**
5480 * Assert a string containing valid PHP will parse.
5581 *
@@ -87,42 +113,6 @@ public function assertValidPHP(string $code, string $message = '') : void
87113 }
88114 }
89115
90- /**
91- * Exclude any file with this $directory string in the path.
92- *
93- * Only a simple stripos is used to match anything in the file name.
94- *
95- * You can add multiple skips.
96- */
97- public function addSkipDirectory (string $ directory ) : self
98- {
99- $ this ->skipDirectories [] = $ directory ;
100-
101- return $ this ;
102- }
103-
104- /**
105- * Skip namespace testing
106- */
107- public function skipNamespaceTesting () : self
108- {
109- $ this ->skipNamespaceTest = true ;
110-
111- return $ this ;
112- }
113-
114- /**
115- * Exclude namespace from namespace testing
116- *
117- * You can add multiple namespaces to skip.
118- */
119- public function addSkipNamespace (string $ namespace ) : self
120- {
121- $ this ->skipNamespaces [] = $ namespace ;
122-
123- return $ this ;
124- }
125-
126116 /**
127117 * Validate all files in a directory. Recursive and only looks at .php files by default.
128118 *
@@ -200,4 +190,14 @@ public function assertValidPHPFile(string $fileName, string $message = '') : voi
200190 }
201191 }
202192 }
193+
194+ /**
195+ * Skip namespace testing
196+ */
197+ public function skipNamespaceTesting () : self
198+ {
199+ $ this ->skipNamespaceTest = true ;
200+
201+ return $ this ;
202+ }
203203 }
0 commit comments