Skip to content

Commit 40df280

Browse files
committed
Merge branch 'AC-1194' into AC-106
2 parents 406aeda + 34effb0 commit 40df280

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

app/code/Magento/MediaGalleryUi/view/adminhtml/web/template/image/image-details.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h3 translate="'Details'"></h3>
3333
<each args="{ data: value, as: 'item'}">
3434
<div class="value">
3535
<a attr="href: $parents[1].getFilterUrl(item.link)"
36-
text="$parents[1].getUsedInText(item)"></a></br>
36+
text="$parents[1].getUsedInText(item)"></a><br/>
3737
</div>
3838
</each>
3939
</if>

dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CodeSniffer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ public function run(array $whiteList)
9999
$settings['standards'] = [$this->rulesetDir];
100100
$settings['extensions'] = $this->extensions;
101101
$settings['reports']['full'] = $this->reportFile;
102+
$settings['reportWidth'] = 120;
102103
$this->wrapper->setSettings($settings);
103104

104105
// phpcs:ignore Magento2.Functions.DiscouragedFunction

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

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace Magento\Test\Html;
88

9+
use Magento\Framework\App\Utility\Files;
910
use Magento\TestFramework\CodingStandard\Tool\CodeSniffer;
1011
use Magento\Test\Php\LiveCodeTest as PHPCodeTest;
1112
use Magento\TestFramework\CodingStandard\Tool\CodeSniffer\Wrapper;
@@ -46,12 +47,33 @@ public function testCodeStyle(): void
4647
$reportFile = self::$reportDir . '/html_report.txt';
4748
$codeSniffer = new CodeSniffer('Magento', $reportFile, new Wrapper());
4849
$codeSniffer->setExtensions([self::FILE_EXTENSION]);
49-
$result = $codeSniffer->run(PHPCodeTest::getWhitelist([self::FILE_EXTENSION], __DIR__, __DIR__));
50+
$fileList = $this->isFullScan() ? array_column(Files::init()->getStaticHtmlFiles(), '0')
51+
: PHPCodeTest::getWhitelist([self::FILE_EXTENSION], __DIR__, __DIR__);
52+
$result = $codeSniffer->run($fileList);
5053
$report = file_exists($reportFile) ? file_get_contents($reportFile) : '';
5154
$this->assertEquals(
5255
0,
5356
$result,
5457
"PHP Code Sniffer detected {$result} violation(s): " . PHP_EOL . $report
5558
);
5659
}
60+
61+
/**
62+
* Returns whether a full scan was requested.
63+
*
64+
* This can be set in the `phpunit.xml` used to run these test cases, by setting the constant
65+
* `TESTCODESTYLE_IS_FULL_SCAN` to `1`, e.g.:
66+
* ```xml
67+
* <php>
68+
* <!-- TESTCODESTYLE_IS_FULL_SCAN - specify if full scan should be performed for test code style test -->
69+
* <const name="TESTCODESTYLE_IS_FULL_SCAN" value="0"/>
70+
* </php>
71+
* ```
72+
*
73+
* @return bool
74+
*/
75+
private function isFullScan(): bool
76+
{
77+
return defined('TESTCODESTYLE_IS_FULL_SCAN') && TESTCODESTYLE_IS_FULL_SCAN === '1';
78+
}
5779
}

0 commit comments

Comments
 (0)