-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #217 from PHPCSStandards/universal/disallowinlinet…
…abs-add-extra-tests Universal/DisallowInlineTabs: add extra tests + remove redundancy
- Loading branch information
Showing
4 changed files
with
68 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 14 additions & 14 deletions
28
Universal/Tests/WhiteSpace/DisallowInlineTabsUnitTest.5.inc.fixed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
<?php | ||
/* *** TESTING WITHOUT A TAB WIDTH SET *** */ | ||
/** | ||
* @param int $var Description - Bad: alignment using tabs. | ||
* @param int $var Description - Bad: alignment using tabs. | ||
* @param string $string Another description. | ||
*/ | ||
|
||
$expected = ( $column - 1 ); | ||
$found = ( $this->tokens[ $closer ]['column'] - 1 ); // Bad. | ||
$error = 'Array closer not aligned correctly; expected %s space(s) but found %s'; // Bad. | ||
$data = array( // Bad. | ||
$found = ( $this->tokens[ $closer ]['column'] - 1 ); // Bad. | ||
$error = 'Array closer not aligned correctly; expected %s space(s) but found %s'; // Bad. | ||
$data = array( // Bad. | ||
$expected_value => 'data', | ||
$found => 'more_data', // Bad. | ||
$found => 'more_data', // Bad. | ||
); | ||
|
||
/* | ||
* Test that the tab replacements do not negatively influence existing mid-line alignments. | ||
*/ | ||
$a = true; | ||
$aa = true; | ||
$aaa = true; | ||
$aaaa = true; | ||
$aaaaa = true; | ||
$a = true; | ||
$aa = true; | ||
$aaa = true; | ||
$aaaa = true; | ||
$aaaaa = true; | ||
$aaaaaa = true; | ||
$aaaaaaa = true; | ||
$aaaaaaaa = true; | ||
|
||
// Test tab replacement in inline comments. | ||
// Test tab replacement in inline comments. | ||
|
||
/* | ||
* Tab indented and inline tabs. | ||
* Tab indented and inline tabs. | ||
*/ | ||
|
||
// Tab indented and inline tabs. | ||
// Tab indented and inline tabs. | ||
// Tab indented and inline tabs. | ||
// Tab indented and inline tabs. |
43 changes: 43 additions & 0 deletions
43
Universal/Tests/WhiteSpace/DisallowInlineTabsUnitTest.6.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
/* *** SPACE BASED FILE - NO ERRORS OR WARNINGS EXPECTED AT ALL *** */ | ||
|
||
/** | ||
* @param int $var Description. | ||
* @param string $string Another description. | ||
*/ | ||
|
||
$expected = ( $column - 1 ); | ||
$found = ( $this->tokens[ $closer ]['column'] - 1 ); | ||
$error = 'Array closer not aligned correctly; expected %s space(s) but found %s'; | ||
$data = array( | ||
$expected_value => 'data', | ||
$found => 'more_data', | ||
); | ||
|
||
/** | ||
* @param int $var Description | ||
* @param string $string Another description. | ||
*/ | ||
|
||
$expected = ( $column - 1 ); | ||
$found = ( $this->tokens[ $closer ]['column'] - 1 ); | ||
$error = 'Array closer not aligned correctly; expected %s space(s) but found %s'; | ||
$data = array( | ||
$expected_value => 'data', | ||
$found => 'more_data', | ||
); | ||
|
||
$a = true; | ||
$aa = true; | ||
$aaa = true; | ||
$aaaa = true; | ||
$aaaaa = true; | ||
$aaaaaa = true; | ||
$aaaaaaa = true; | ||
$aaaaaaaa = true; | ||
|
||
/** | ||
* @param int $var Description. | ||
* @param string $string Another description. | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters