From e8ec7b106ffb4ddcb14e4aaabed1b5fd1928c4c1 Mon Sep 17 00:00:00 2001
From: Igor Melnikov <imelnikov@ebay.com>
Date: Wed, 13 Jul 2016 13:53:16 -0500
Subject: [PATCH] MAGETWO-54652: Replace usages of deprecated escaper functions

Fixing integration tests
---
 app/code/Magento/Ui/Component/Control/Button.php          | 2 +-
 .../Authorizenet/Controller/Directpost/PaymentTest.php    | 8 ++++----
 .../Magento/Catalog/Helper/Product/CompareTest.php        | 2 +-
 .../testsuite/Magento/Customer/Controller/AccountTest.php | 4 ++--
 .../Magento/Paypal/Adminhtml/Paypal/ReportsTest.php       | 2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/app/code/Magento/Ui/Component/Control/Button.php b/app/code/Magento/Ui/Component/Control/Button.php
index 785e28fb011..5e407d93e39 100644
--- a/app/code/Magento/Ui/Component/Control/Button.php
+++ b/app/code/Magento/Ui/Component/Control/Button.php
@@ -134,7 +134,7 @@ class Button extends Template implements ControlInterface
             if ($attributeValue === null || $attributeValue == '') {
                 continue;
             }
-            $html .= $attributeKey . '="' . $this->escapeHtml($attributeValue) . '" ';
+            $html .= $attributeKey . '="' . htmlspecialchars($attributeValue, ENT_COMPAT, 'UTF-8', false) . '" ';
         }
 
         return $html;
diff --git a/dev/tests/integration/testsuite/Magento/Authorizenet/Controller/Directpost/PaymentTest.php b/dev/tests/integration/testsuite/Magento/Authorizenet/Controller/Directpost/PaymentTest.php
index 828f663b358..3ec174d5b55 100644
--- a/dev/tests/integration/testsuite/Magento/Authorizenet/Controller/Directpost/PaymentTest.php
+++ b/dev/tests/integration/testsuite/Magento/Authorizenet/Controller/Directpost/PaymentTest.php
@@ -16,8 +16,8 @@ class PaymentTest extends \Magento\TestFramework\TestCase\AbstractController
         $this->dispatch('authorizenet/directpost_payment/response');
         // @codingStandardsIgnoreStart
         $this->assertContains(
-            'authorizenet/directpost_payment/redirect/success/0/error_msg/The transaction was'
-            . ' declined because the response hash validation failed.',
+            'authorizenet/directpost_payment/redirect/success/0/error_msg/The%20transaction%20was'
+                . '%20declined%20because%20the%20response%20hash%20validation%20failed.',
             // @codingStandardsIgnoreEnd
             $this->getResponse()->getBody()
         );
@@ -40,8 +40,8 @@ class PaymentTest extends \Magento\TestFramework\TestCase\AbstractController
         $this->dispatch('authorizenet/directpost_payment/backendresponse');
         // @codingStandardsIgnoreStart
         $this->assertContains(
-            'authorizenet_directpost_payment/redirect/success/0/error_msg/The transaction was declined'
-            . ' because the response hash validation failed./controller_action_name/action_name/',
+            'authorizenet_directpost_payment/redirect/success/0/error_msg/The%20transaction%20was%20declined'
+                . '%20because%20the%20response%20hash%20validation%20failed./controller_action_name/action_name/',
             // @codingStandardsIgnoreEnd
             $this->getResponse()->getBody()
         );
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/CompareTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/CompareTest.php
index cdf199fde11..0b7c872bad8 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/CompareTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/CompareTest.php
@@ -37,7 +37,7 @@ class CompareTest extends \PHPUnit_Framework_TestCase
         $id1 = $productRepository->get('simple1')->getId();
         $id2 = $productRepository->get('simple2')->getId();
         $this->assertRegExp(
-            '#/catalog/product_compare/index/items/(?:' . $id1 . ',' . $id2 . '|' . $id2 . ',' . $id1. ')/#',
+            '#/catalog/product_compare/index/items/(?:' . $id1 . '%2C' . $id2 . '|' . $id2 . '%2C' . $id1. ')/#',
             $this->_helper->getListUrl()
         );
     }
diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/AccountTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/AccountTest.php
index d305206a571..bc1c4466f62 100644
--- a/dev/tests/integration/testsuite/Magento/Customer/Controller/AccountTest.php
+++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/AccountTest.php
@@ -272,8 +272,8 @@ class AccountTest extends \Magento\TestFramework\TestCase\AbstractController
         $this->assertSessionMessages(
             $this->equalTo([
                 'You must confirm your account. Please check your email for the confirmation link or '
-                . '<a href="http://localhost/index.php/customer/account/confirmation/email/'
-                . $email . '/">click here</a> for a new link.'
+                    . '<a href="http://localhost/index.php/customer/account/confirmation/email/'
+                    . rawurlencode($email) . '/">click here</a> for a new link.'
             ]),
             MessageInterface::TYPE_SUCCESS
         );
diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Adminhtml/Paypal/ReportsTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Adminhtml/Paypal/ReportsTest.php
index c18880325bb..72e35c299f7 100644
--- a/dev/tests/integration/testsuite/Magento/Paypal/Adminhtml/Paypal/ReportsTest.php
+++ b/dev/tests/integration/testsuite/Magento/Paypal/Adminhtml/Paypal/ReportsTest.php
@@ -23,7 +23,7 @@ class ReportsTest extends \Magento\TestFramework\TestCase\AbstractBackendControl
     {
         $this->dispatch('backend/paypal/paypal_reports/fetch');
         $this->assertSessionMessages(
-            $this->equalTo(['We can\'t fetch reports from &quot;login@127.0.0.1.&quot;']),
+            $this->equalTo(['We can&#039;t fetch reports from &quot;login@127.0.0.1.&quot;']),
             \Magento\Framework\Message\MessageInterface::TYPE_ERROR
         );
     }
-- 
GitLab