Skip to content

Commit

Permalink
TASK: Test editorconfig with root = true in subdir
Browse files Browse the repository at this point in the history
  • Loading branch information
s2b committed Jul 10, 2017
1 parent 5b7d722 commit 71faa1b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Build/TestFiles/Editorconfig/SubRoot/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
root = true

[*.php]
indent_style = tab
16 changes: 16 additions & 0 deletions tests/Editorconfig/EditorconfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,21 @@ public function testGetRulesForFile()
/* test if files with non leading ./ return the same result */
$rules = $editorconfig->getRulesForFile('ComposedRules/myFile.php', $rootDir);
$this->assertEquals($expectedRules, $rules);


$expectedRules = [
'root' => 1,
'indent_style' => 'tab'
];

$rules = $editorconfig->getRulesForFile('SubRoot/myFile.php', $rootDir);
$this->assertEquals($expectedRules, $rules);

$expectedRules = [
'root' => 1
];

$rules = $editorconfig->getRulesForFile('SubRoot/myFile.json', $rootDir);
$this->assertEquals($expectedRules, $rules);
}
}

0 comments on commit 71faa1b

Please sign in to comment.