Skip to content

Commit

Permalink
Merge pull request #3016 from magento-obsessive-owls/MAGETWO-94083-im…
Browse files Browse the repository at this point in the history
…possible-get-information

Impossible get information about static errors on PR
  • Loading branch information
Igor Melnikov authored Aug 11, 2018
2 parents 6116023 + a119df4 commit 1cb9235
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dev/tests/static/phpunit-all.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<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"/>
<const name="TESTCODESTYLE_IS_FULL_SCAN" value="0"/>
</php>
</phpunit>
2 changes: 1 addition & 1 deletion dev/tests/static/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<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"/>
<const name="TESTCODESTYLE_IS_FULL_SCAN" value="0"/>
<!-- 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
12 changes: 12 additions & 0 deletions dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,16 @@ private function getFullWhitelist()
}
}

/**
* Test code quality using phpcs
*/
public function testCodeStyle()
{
$isFullScan = defined('TESTCODESTYLE_IS_FULL_SCAN') && TESTCODESTYLE_IS_FULL_SCAN === '1';
$reportFile = self::$reportDir . '/phpcs_report.txt';
if (!file_exists($reportFile)) {
touch($reportFile);
}
$codeSniffer = new CodeSniffer('Magento', $reportFile, new Wrapper());
$result = $codeSniffer->run($isFullScan ? $this->getFullWhitelist() : self::getWhitelist(['php', 'phtml']));
$report = file_get_contents($reportFile);
Expand All @@ -270,6 +276,9 @@ public function testCodeStyle()
);
}

/**
* Test code quality using phpmd
*/
public function testCodeMess()
{
$reportFile = self::$reportDir . '/phpmd_report.txt';
Expand Down Expand Up @@ -298,6 +307,9 @@ public function testCodeMess()
}
}

/**
* Test code quality using phpcpd
*/
public function testCopyPaste()
{
$reportFile = self::$reportDir . '/phpcpd_report.xml';
Expand Down

0 comments on commit 1cb9235

Please sign in to comment.