Skip to content

Commit 4f155b2

Browse files
authored
Merge pull request microsoft#93 from mousetraps/api
remove dependence on index while iterating through test cases
2 parents bb9805d + 143c44a commit 4f155b2

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

tests/LexicalGrammarTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,15 @@ public function testOutputTokenClassificationAndLength($testCaseFile, $expectedT
4545

4646
public function lexicalProvider() {
4747
$testCases = glob(__dir__ . "/cases/lexical/*.php");
48-
$tokensExpected = glob(__dir__ . "/cases/lexical/*.php.tokens");
4948

5049
$skipped = json_decode(file_get_contents(__DIR__ . "/skipped.json"));
5150

5251
$testProviderArray = array();
53-
foreach ($testCases as $index=>$testCase) {
52+
foreach ($testCases as $testCase) {
5453
if (in_array(basename($testCase), $skipped)) {
5554
continue;
5655
}
57-
$testProviderArray[basename($testCase)] = [$testCase, $tokensExpected[$index]];
56+
$testProviderArray[basename($testCase)] = [$testCase, $testCase . ".tokens"];
5857
}
5958

6059
return $testProviderArray;

tests/ParserGrammarTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,14 @@ public function testOutputTreeClassificationAndLength($testCaseFile, $expectedTo
5151

5252
public function treeProvider() {
5353
$testCases = glob(self::FILE_PATTERN . ".php");
54-
$tokensExpected = glob(self::FILE_PATTERN . ".php.tree");
5554
$skipped = json_decode(file_get_contents(__DIR__ . "/skipped.json"));
5655

5756
$testProviderArray = array();
58-
foreach ($testCases as $index=>$testCase) {
57+
foreach ($testCases as $testCase) {
5958
if (in_array(basename($testCase), $skipped)) {
6059
continue;
6160
}
62-
$testProviderArray[basename($testCase)] = [$testCase, $tokensExpected[$index]];
61+
$testProviderArray[basename($testCase)] = [$testCase, $testCase . ".tree"];
6362
}
6463

6564
return $testProviderArray;

0 commit comments

Comments
 (0)