Skip to content

Commit eb07f07

Browse files
author
Oleksii Korshenko
authored
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - #11362: PHP Livecodetest testCodeStyle() method does not use whitelist files (by @adrian-martinez-interactiv4)
2 parents 221e2a4 + 6d96cda commit eb07f07

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

dev/tests/integration/testsuite/Magento/SalesRule/Model/Rule/Condition/ProductTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@ protected function setUp()
2828
* @magentoAppIsolation enabled
2929
* @param int $categoryId
3030
* @param bool $expectedResult
31-
* @magentoDataFixture Magento/ConfigurableProduct/_files/quote_with_configurable_product.php
32-
* @magentoDataFixture Magento/SalesRule/_files/rules_category.php
3331
* @dataProvider validateProductConditionDataProvider
3432
*/
3533
public function testValidateCategorySalesRuleIncludesChildren($categoryId, $expectedResult)
3634
{
35+
//* @magentoDataFixture Magento/ConfigurableProduct/_files/quote_with_configurable_product.php
36+
//* @magentoDataFixture Magento/SalesRule/_files/rules_category.php
37+
$this->markTestSkipped('MAGETWO-87436');
38+
3739
// Load the quote that contains a child of a configurable product
3840
/** @var \Magento\Quote\Model\Quote $quote */
3941
$quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class)

dev/tests/static/phpunit-all.xml.dist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,7 @@
2020
</testsuites>
2121
<php>
2222
<ini name="date.timezone" value="America/Los_Angeles"/>
23+
<!-- TESTCODESTYLE_IS_FULL_SCAN - specify if full scan should be performed for test code style test -->
24+
<const name="TESTCODESTYLE_IS_FULL_SCAN" value="1"/>
2325
</php>
2426
</phpunit>

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+
<!-- TESTCODESTYLE_IS_FULL_SCAN - specify if full scan should be performed for test code style test -->
3334
<const name="TESTCODESTYLE_IS_FULL_SCAN" value="1"/>
3435
<!-- TESTS_COMPOSER_PATH - specify the path to composer binary, if a relative reference cannot be resolved -->
3536
<!--<const name="TESTS_COMPOSER_PATH" value="/usr/local/bin/composer"/>-->

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,11 @@ private function getFullWhitelist()
199199

200200
public function testCodeStyle()
201201
{
202-
$whiteList = defined('TESTCODESTYLE_IS_FULL_SCAN') && TESTCODESTYLE_IS_FULL_SCAN === '1'
203-
? $this->getFullWhitelist() : self::getWhitelist(['php', 'phtml']);
204-
202+
$isFullScan = defined('TESTCODESTYLE_IS_FULL_SCAN') && TESTCODESTYLE_IS_FULL_SCAN === '1';
205203
$reportFile = self::$reportDir . '/phpcs_report.txt';
206204
$codeSniffer = new CodeSniffer('Magento', $reportFile, new Wrapper());
207-
$result = $codeSniffer->run($whiteList);
208-
$report = file_exists($reportFile) ? file_get_contents($reportFile) : '';
205+
$result = $codeSniffer->run($isFullScan ? $this->getFullWhitelist() : self::getWhitelist(['php', 'phtml']));
206+
$report = file_get_contents($reportFile);
209207
$this->assertEquals(
210208
0,
211209
$result,

0 commit comments

Comments
 (0)