From 86a9bcc7f2e672a33d856466a2f1db86c37c44af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Mart=C3=ADnez?= Date: Fri, 13 Oct 2017 04:37:07 +0200 Subject: [PATCH 1/3] Ability to use whitelist for testing code style, based on const defined in phpunit xml config file --- dev/tests/static/phpunit-all.xml.dist | 2 ++ dev/tests/static/phpunit.xml.dist | 2 ++ dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php | 5 ++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/dev/tests/static/phpunit-all.xml.dist b/dev/tests/static/phpunit-all.xml.dist index a77f536980c59..131cfa6a5ff60 100644 --- a/dev/tests/static/phpunit-all.xml.dist +++ b/dev/tests/static/phpunit-all.xml.dist @@ -19,5 +19,7 @@ + + diff --git a/dev/tests/static/phpunit.xml.dist b/dev/tests/static/phpunit.xml.dist index 6ccb9603000a0..1ae9342598e4b 100644 --- a/dev/tests/static/phpunit.xml.dist +++ b/dev/tests/static/phpunit.xml.dist @@ -29,6 +29,8 @@ + + diff --git a/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php b/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php index f3dc7841d2df8..5058ef402cbd2 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php @@ -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) ); } From 156b0f33b9e469ed6fde82b2399f0e43e3366cdd Mon Sep 17 00:00:00 2001 From: Pieter Hoste Date: Mon, 4 Sep 2017 20:14:20 +0200 Subject: [PATCH 2/3] Backport of PR-10748 for Magento 2.2: Always use https for Vimeo video's. (cherry picked from commit c4da890ed291ba5333a3871a4098d04ea58d255c) --- .../view/adminhtml/web/js/get-video-information.js | 4 ++-- .../Magento/ProductVideo/view/frontend/web/js/load-player.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/ProductVideo/view/adminhtml/web/js/get-video-information.js b/app/code/Magento/ProductVideo/view/adminhtml/web/js/get-video-information.js index ca920e8740978..13b0e43a84d81 100644 --- a/app/code/Magento/ProductVideo/view/adminhtml/web/js/get-video-information.js +++ b/app/code/Magento/ProductVideo/view/adminhtml/web/js/get-video-information.js @@ -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 + @@ -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' diff --git a/app/code/Magento/ProductVideo/view/frontend/web/js/load-player.js b/app/code/Magento/ProductVideo/view/frontend/web/js/load-player.js index 5a9f6a3eca941..3519d538e523a 100644 --- a/app/code/Magento/ProductVideo/view/frontend/web/js/load-player.js +++ b/app/code/Magento/ProductVideo/view/frontend/web/js/load-player.js @@ -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 + From 0de80d779010f993deccc41f9abb6607963693ae Mon Sep 17 00:00:00 2001 From: Alexander Shkurko Date: Fri, 9 Mar 2018 13:55:49 +0100 Subject: [PATCH 3/3] [FIX] small refacroting and removing not using variable from templates --- .../view/base/templates/product/price/default.phtml | 2 -- .../view/base/templates/product/price/final_price.phtml | 2 -- .../Sales/view/adminhtml/templates/order/view/info.phtml | 8 +++++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/Catalog/view/base/templates/product/price/default.phtml b/app/code/Magento/Catalog/view/base/templates/product/price/default.phtml index 065472c686129..b414f02a3d6fb 100644 --- a/app/code/Magento/Catalog/view/base/templates/product/price/default.phtml +++ b/app/code/Magento/Catalog/view/base/templates/product/price/default.phtml @@ -11,8 +11,6 @@ getSaleableItem()->getId(); - /** ex: \Magento\Catalog\Pricing\Price\RegularPrice */ /** @var \Magento\Framework\Pricing\Price\PriceInterface $priceModel */ $priceModel = $block->getPriceType('regular_price'); diff --git a/app/code/Magento/Catalog/view/base/templates/product/price/final_price.phtml b/app/code/Magento/Catalog/view/base/templates/product/price/final_price.phtml index 72d9124173898..6e281bdef7afb 100644 --- a/app/code/Magento/Catalog/view/base/templates/product/price/final_price.phtml +++ b/app/code/Magento/Catalog/view/base/templates/product/price/final_price.phtml @@ -11,8 +11,6 @@ getSaleableItem()->getId(); - /** ex: \Magento\Catalog\Pricing\Price\RegularPrice */ /** @var \Magento\Framework\Pricing\Price\PriceInterface $priceModel */ $priceModel = $block->getPriceType('regular_price'); diff --git a/app/code/Magento/Sales/view/adminhtml/templates/order/view/info.phtml b/app/code/Magento/Sales/view/adminhtml/templates/order/view/info.phtml index 56c1a99e66ade..5384a00dc894d 100644 --- a/app/code/Magento/Sales/view/adminhtml/templates/order/view/info.phtml +++ b/app/code/Magento/Sales/view/adminhtml/templates/order/view/info.phtml @@ -24,6 +24,8 @@ $orderStoreDate = $block->formatDate( true, $block->getTimezoneForStore($order->getStore()) ); + +$customerUrl = $block->getCustomerViewUrl(); ?>