Skip to content
This repository was archived by the owner on Dec 19, 2019. It is now read-only.

Commit bf50355

Browse files
authored
MAGETWO-81646: PHP Livecodetest testCodeStyle() method does not use whitelist files #11362
2 parents 45d1d93 + 11d81b3 commit bf50355

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

dev/tests/static/phpunit.xml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
</testsuites>
3131
<php>
3232
<ini name="date.timezone" value="America/Los_Angeles"/>
33+
<const name="TESTCODESTYLE_IS_FULL_SCAN" value="1"/>
3334
<!-- TESTS_COMPOSER_PATH - specify the path to composer binary, if a relative reference cannot be resolved -->
3435
<!--<const name="TESTS_COMPOSER_PATH" value="/usr/local/bin/composer"/>-->
3536
</php>

dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,14 @@ private function getFullWhitelist()
201201

202202
public function testCodeStyle()
203203
{
204+
$whiteList = defined('TESTCODESTYLE_IS_FULL_SCAN') && TESTCODESTYLE_IS_FULL_SCAN === '1'
205+
? $this->getFullWhitelist() : self::getWhitelist(['php', 'phtml']);
206+
204207
$reportFile = self::$reportDir . '/phpcs_report.txt';
205208
$codeSniffer = new CodeSniffer('Magento', $reportFile, new Wrapper());
206209
$this->assertEquals(
207210
0,
208-
$result = $codeSniffer->run($this->getFullWhitelist()),
211+
$result = $codeSniffer->run($whiteList),
209212
"PHP Code Sniffer detected {$result} violation(s): " . PHP_EOL . file_get_contents($reportFile)
210213
);
211214
}

0 commit comments

Comments
 (0)