diff --git a/src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php b/src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php index 5c7df9a470..d587d79669 100644 --- a/src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php +++ b/src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php @@ -106,10 +106,6 @@ class ScopeIndentSniff implements Sniff */ public function register() { - if (defined('PHP_CODESNIFFER_IN_TESTS') === true) { - $this->debug = false; - } - return [T_OPEN_TAG]; }//end register() diff --git a/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php b/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php index fc9f9a8b92..02bb4cd996 100644 --- a/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php +++ b/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php @@ -30,6 +30,8 @@ final class ScopeIndentUnitTest extends AbstractSniffUnitTest */ public function setCliValues($testFile, $config) { + $config->setConfigData('scope_indent_debug', false, true); + // Tab width setting is only needed for the tabbed file. if ($testFile === 'ScopeIndentUnitTest.2.inc') { $config->tabWidth = 4; diff --git a/src/Standards/PEAR/Tests/WhiteSpace/ScopeIndentUnitTest.php b/src/Standards/PEAR/Tests/WhiteSpace/ScopeIndentUnitTest.php index 3c6fd4a5e5..b6a791e28c 100644 --- a/src/Standards/PEAR/Tests/WhiteSpace/ScopeIndentUnitTest.php +++ b/src/Standards/PEAR/Tests/WhiteSpace/ScopeIndentUnitTest.php @@ -20,6 +20,21 @@ final class ScopeIndentUnitTest extends AbstractSniffUnitTest { + /** + * Get a list of CLI values to set before the file is tested. + * + * @param string $testFile The name of the file being tested. + * @param \PHP_CodeSniffer\Config $config The config data for the test run. + * + * @return void + */ + public function setCliValues($testFile, $config) + { + $config->setConfigData('scope_indent_debug', false, true); + + }//end setCliValues() + + /** * Returns the lines where errors should occur. *