Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dev/tests/static/phpunit-all.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@
</testsuites>
<php>
<ini name="date.timezone" value="America/Los_Angeles"/>
<!-- TESTCODESTYLE_IS_FULL_SCAN - specify if full scan should be performed for test code style test -->
<const name="TESTCODESTYLE_IS_FULL_SCAN" value="1"/>
</php>
</phpunit>
2 changes: 2 additions & 0 deletions dev/tests/static/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
</testsuites>
<php>
<ini name="date.timezone" value="America/Los_Angeles"/>
<!-- TESTCODESTYLE_IS_FULL_SCAN - specify if full scan should be performed for test code style test -->
<const name="TESTCODESTYLE_IS_FULL_SCAN" value="1"/>
<!-- TESTS_COMPOSER_PATH - specify the path to composer binary, if a relative reference cannot be resolved -->
<!--<const name="TESTS_COMPOSER_PATH" value="/usr/local/bin/composer"/>-->
</php>
Expand Down
5 changes: 4 additions & 1 deletion dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,14 @@ private function getFullWhitelist()

public function testCodeStyle()
{
$whiteList = defined('TESTCODESTYLE_IS_FULL_SCAN') && TESTCODESTYLE_IS_FULL_SCAN === '1'
? $this->getFullWhitelist() : self::getWhitelist(['php', 'phtml']);

$reportFile = self::$reportDir . '/phpcs_report.txt';
$codeSniffer = new CodeSniffer('Magento', $reportFile, new Wrapper());
$this->assertEquals(
0,
$result = $codeSniffer->run($this->getFullWhitelist()),
$result = $codeSniffer->run($whiteList),
"PHP Code Sniffer detected {$result} violation(s): " . PHP_EOL . file_get_contents($reportFile)
);
}
Expand Down