File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
VariableAnalysis/Tests/CodeAnalysis Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 77use PHP_CodeSniffer \Config ;
88
99class VariableAnalysisUnitTest extends TestCase {
10- public function testEverything () {
10+ public function testAllErrors () {
11+ $ fixtureFile = __DIR__ . '/VariableAnalysisUnitTestFixture.php ' ;
12+ $ sniffFiles = [__DIR__ . '/../../../VariableAnalysis/Sniffs/CodeAnalysis/VariableAnalysisSniff.php ' ];
13+ $ config = new Config ();
14+ $ ruleset = new Ruleset ($ config );
15+ $ ruleset ->registerSniffs ($ sniffFiles , [], []);
16+ $ ruleset ->populateTokenListeners ();
17+ $ phpcsFile = new LocalFile ($ fixtureFile , $ ruleset , $ config );
18+ $ phpcsFile ->process ();
19+ $ foundErrors = $ phpcsFile ->getErrors ();
20+ $ lines = array_keys ($ foundErrors );
21+ $ expectedErrors = [
22+ 185 ,
23+ 189 ,
24+ 306 ,
25+ ];
26+ $ this ->assertEquals ($ expectedErrors , $ lines );
27+ }
28+
29+ public function testAllWarnings () {
1130 $ fixtureFile = __DIR__ . '/VariableAnalysisUnitTestFixture.php ' ;
1231 $ sniffFiles = [__DIR__ . '/../../../VariableAnalysis/Sniffs/CodeAnalysis/VariableAnalysisSniff.php ' ];
1332 $ config = new Config ();
You can’t perform that action at this time.
0 commit comments