Skip to content

Commit

Permalink
🔃 [EngCom] Public Pull Requests - 2.2-develop
Browse files Browse the repository at this point in the history
Accepted Public Pull Requests:
 - #14028: [FIX] small refactoring and removing not using variable from templates (by @coderimus)
 - #13977: Backport of PR-10748 for Magento 2.2: Always use https for Vimeo vide� (by @hostep)
 - #11376: [Backport 2.2-develop] PHP Livecodetest testCodeStyle() method does not use whitelist files (by @adrian-martinez-interactiv4)
  • Loading branch information
magento-engcom-team authored Mar 11, 2018
2 parents 3f053dd + 4597893 commit e314678
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
<?php
/** @var \Magento\Catalog\Pricing\Render\FinalPriceBox $block */

$productId = $block->getSaleableItem()->getId();

/** ex: \Magento\Catalog\Pricing\Price\RegularPrice */
/** @var \Magento\Framework\Pricing\Price\PriceInterface $priceModel */
$priceModel = $block->getPriceType('regular_price');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
<?php
/** @var \Magento\Catalog\Pricing\Render\FinalPriceBox $block */

$productId = $block->getSaleableItem()->getId();

/** ex: \Magento\Catalog\Pricing\Price\RegularPrice */
/** @var \Magento\Framework\Pricing\Price\PriceInterface $priceModel */
$priceModel = $block->getPriceType('regular_price');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ define([
additionalParams += '&autoplay=1';
}

src = window.location.protocol + '//player.vimeo.com/video/' +
src = 'https://player.vimeo.com/video/' +
this._code + '?api=1&player_id=vimeo' +
this._code +
timestamp +
Expand Down Expand Up @@ -525,7 +525,7 @@ define([
);
} else if (type === 'vimeo') {
$.ajax({
url: window.location.protocol + '//www.vimeo.com/api/v2/video/' + id + '.json',
url: 'https://www.vimeo.com/api/v2/video/' + id + '.json',
dataType: 'jsonp',
data: {
format: 'json'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ define(['jquery', 'jquery/ui'], function ($) {
if (this._loop) {
additionalParams += '&loop=1';
}
src = window.location.protocol + '//player.vimeo.com/video/' +
src = 'https://player.vimeo.com/video/' +
this._code + '?api=1&player_id=vimeo' +
this._code +
timestamp +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ $orderStoreDate = $block->formatDate(
true,
$block->getTimezoneForStore($order->getStore())
);

$customerUrl = $block->getCustomerViewUrl();
?>

<section class="admin__page-section order-view-account-information">
Expand Down Expand Up @@ -114,8 +116,8 @@ $orderStoreDate = $block->formatDate(
<div class="admin__page-section-item-title">
<span class="title"><?= $block->escapeHtml(__('Account Information')) ?></span>
<div class="actions">
<?php if ($customerUrl = $block->getCustomerViewUrl()) : ?>
<a href="<?= /* @noEscape */ $block->getCustomerViewUrl() ?>" target="_blank">
<?php if ($customerUrl) : ?>
<a href="<?= /* @noEscape */ $customerUrl ?>" target="_blank">
<?= $block->escapeHtml(__('Edit Customer')) ?>
</a>
<?php endif; ?>
Expand All @@ -126,7 +128,7 @@ $orderStoreDate = $block->formatDate(
<tr>
<th><?= $block->escapeHtml(__('Customer Name')) ?></th>
<td>
<?php if ($customerUrl = $block->getCustomerViewUrl()): ?>
<?php if ($customerUrl): ?>
<a href="<?= $block->escapeUrl($customerUrl) ?>" target="_blank">
<span><?= $block->escapeHtml($order->getCustomerName()) ?></span>
</a>
Expand Down
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

0 comments on commit e314678

Please sign in to comment.