Skip to content

Commit 1229916

Browse files
authored
Merge pull request #1036 from PHPCSStandards/feature/966-generic-scopeindent-remove-phpcs-in-tests
Generic/ScopeIndent: remove check for test constant from src code
2 parents 84fccb4 + b1205ec commit 1229916

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,6 @@ class ScopeIndentSniff implements Sniff
106106
*/
107107
public function register()
108108
{
109-
if (defined('PHP_CODESNIFFER_IN_TESTS') === true) {
110-
$this->debug = false;
111-
}
112-
113109
return [T_OPEN_TAG];
114110

115111
}//end register()

src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ final class ScopeIndentUnitTest extends AbstractSniffUnitTest
3030
*/
3131
public function setCliValues($testFile, $config)
3232
{
33+
$config->setConfigData('scope_indent_debug', false, true);
34+
3335
// Tab width setting is only needed for the tabbed file.
3436
if ($testFile === 'ScopeIndentUnitTest.2.inc') {
3537
$config->tabWidth = 4;

src/Standards/PEAR/Tests/WhiteSpace/ScopeIndentUnitTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,21 @@ final class ScopeIndentUnitTest extends AbstractSniffUnitTest
2020
{
2121

2222

23+
/**
24+
* Get a list of CLI values to set before the file is tested.
25+
*
26+
* @param string $testFile The name of the file being tested.
27+
* @param \PHP_CodeSniffer\Config $config The config data for the test run.
28+
*
29+
* @return void
30+
*/
31+
public function setCliValues($testFile, $config)
32+
{
33+
$config->setConfigData('scope_indent_debug', false, true);
34+
35+
}//end setCliValues()
36+
37+
2338
/**
2439
* Returns the lines where errors should occur.
2540
*

0 commit comments

Comments
 (0)