Skip to content

Commit 9200b6a

Browse files
authored
Merge pull request #8105 from magento-gl/Hammer_Release_Regression_Issues_29Jan22
Hammer release regression issues 29 jan22
2 parents 0c6a66f + ef95189 commit 9200b6a

File tree

14 files changed

+73
-47
lines changed

14 files changed

+73
-47
lines changed

app/code/Magento/Payment/Block/Transparent/Redirect.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function getPostParams(): array
6767
$params = [];
6868
foreach ($this->_request->getPostValue() as $name => $value) {
6969
if (!empty($value) && mb_detect_encoding($value, 'UTF-8', true) === false) {
70-
$value = utf8_encode($value);
70+
$value = mb_convert_encoding($value, 'UTF-8', 'ISO-8859-1');
7171
}
7272
$params[$name] = $value;
7373
}

app/code/Magento/Rule/Test/Unit/Model/Condition/Product/AbstractProductTest.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ public function testValidateEmptyEntityAttributeValuesWithResource()
174174
->method('getAttribute')
175175
->with('someAttribute')
176176
->willReturn($attribute);
177-
$newResource->_config = $this->createMock(Config::class);
178177
$product->expects($this->atLeastOnce())
179178
->method('getResource')
180179
->willReturn($newResource);
@@ -190,7 +189,6 @@ public function testValidateEmptyEntityAttributeValuesWithResource()
190189
->method('getAttribute')
191190
->with('someAttribute')
192191
->willReturn($attribute);
193-
$newResource->_config = $this->createMock(Config::class);
194192

195193
$product->setResource($newResource);
196194
$this->assertFalse($this->_condition->validate($product));
@@ -228,7 +226,6 @@ public function testValidateSetEntityAttributeValuesWithResource()
228226
->method('getAttribute')
229227
->with('someAttribute')
230228
->willReturn($attribute);
231-
$newResource->_config = $this->createMock(Config::class);
232229

233230
$product->expects($this->atLeastOnce())
234231
->method('getResource')
@@ -277,7 +274,6 @@ public function testValidateSetEntityAttributeValuesWithoutResource()
277274
->method('getAttribute')
278275
->with('someAttribute')
279276
->willReturn($attribute);
280-
$newResource->_config = $this->createMock(Config::class);
281277

282278
$product->expects($this->atLeastOnce())
283279
->method('getResource')
@@ -303,7 +299,6 @@ public function testValidateSetEntityAttributeValuesWithoutResource()
303299
->method('getAttribute')
304300
->with('someAttribute')
305301
->willReturn($attribute);
306-
$newResource->_config = $this->createMock(Config::class);
307302

308303
$product->setResource($newResource);
309304
$product->setId(1);

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"colinmollenhour/php-redis-session-abstract": "^1.5",
4040
"composer/composer": "^2.0, !=2.2.16",
4141
"elasticsearch/elasticsearch": "^7.17||^8.5",
42-
"ezyang/htmlpurifier": "^4.14",
42+
"ezyang/htmlpurifier": "^4.16",
4343
"guzzlehttp/guzzle": "^7.5",
4444
"laminas/laminas-captcha": "^2.12",
4545
"laminas/laminas-code": "^4.5",

composer.lock

Lines changed: 34 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev/tests/integration/testsuite/Magento/Framework/Filesystem/Driver/FileTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22
/**
3-
* Test for \Magento\Framework\Filesystem\Driver\File
4-
*
53
* Copyright © Magento, Inc. All rights reserved.
64
* See COPYING.txt for license details.
75
*/
@@ -13,6 +11,7 @@
1311
use PHPUnit\Framework\TestCase;
1412

1513
/**
14+
* Test for \Magento\Framework\Filesystem\Driver\File
1615
* Verify File class
1716
*/
1817
class FileTest extends TestCase
@@ -104,7 +103,7 @@ public function testReadDirectoryRecursively(): void
104103
'foo/bar/file_two.txt',
105104
'foo/file_three.txt',
106105
];
107-
$expected = array_map(['self', 'getTestPath'], $paths);
106+
$expected = array_map([self::class, 'getTestPath'], $paths);
108107
$actual = $this->driver->readDirectoryRecursively($this->getTestPath('foo'));
109108
sort($actual);
110109
$this->assertEquals($expected, $actual);

dev/tests/integration/testsuite/Magento/SalesRule/Model/Rule/Action/Discount/CartFixedTest.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@
4747
*/
4848
class CartFixedTest extends TestCase
4949
{
50+
/**
51+
* @var float
52+
*/
53+
private const EPSILON = 0.0000000001;
54+
5055
/**
5156
* @var GuestCartManagementInterface
5257
*/
@@ -521,11 +526,11 @@ public function testDiscountsWhenByPercentRuleAppliedFirstAndCartFixedRuleSecond
521526
$item = array_shift($items);
522527
$this->assertEquals('simple1', $item->getSku());
523528
$this->assertEquals(5.99, $item->getPrice());
524-
$this->assertEquals($expectedDiscounts[$item->getSku()], $item->getDiscountAmount());
529+
$this->assertEqualsWithDelta($expectedDiscounts[$item->getSku()], $item->getDiscountAmount(), self::EPSILON);
525530
$item = array_shift($items);
526531
$this->assertEquals('simple2', $item->getSku());
527532
$this->assertEquals(15.99, $item->getPrice());
528-
$this->assertEquals($expectedDiscounts[$item->getSku()], $item->getDiscountAmount());
533+
$this->assertEqualsWithDelta($expectedDiscounts[$item->getSku()], $item->getDiscountAmount(), self::EPSILON);
529534
}
530535

531536
public function discountByPercentDataProvider()

dev/tests/integration/testsuite/Magento/Setup/Fixtures/FixturesAsserts/SimpleProductsAssert.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* Class performs assertion that generated simple products are valid
1414
* after running setup:performance:generate-fixtures command
1515
*/
16+
#[\AllowDynamicProperties]
1617
class SimpleProductsAssert
1718
{
1819
/**

dev/tests/integration/testsuite/Magento/Tax/Model/Sales/Total/Quote/TaxTest.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
*/
2424
class TaxTest extends \Magento\TestFramework\Indexer\TestCase
2525
{
26+
/**
27+
* @var float
28+
*/
29+
private const EPSILON = 0.0000000001;
30+
2631
/**
2732
* Utility object for setting up tax rates, tax classes and tax rules
2833
*
@@ -176,7 +181,7 @@ public function testFullDiscountWithDeltaRoundingFix()
176181
protected function verifyItem($item, $expectedItemData)
177182
{
178183
foreach ($expectedItemData as $key => $value) {
179-
$this->assertEquals($value, $item->getData($key), 'item ' . $key . ' is incorrect');
184+
$this->assertEqualsWithDelta($value, $item->getData($key), self::EPSILON, 'item ' . $key . ' is incorrect');
180185
}
181186

182187
return $this;
@@ -247,7 +252,12 @@ protected function verifyQuoteAddress($quoteAddress, $expectedAddressData)
247252
if ($key == 'applied_taxes') {
248253
$this->verifyAppliedTaxes($quoteAddress->getAppliedTaxes(), $value);
249254
} else {
250-
$this->assertEquals($value, $quoteAddress->getData($key), 'Quote address ' . $key . ' is incorrect');
255+
$this->assertEqualsWithDelta(
256+
$value,
257+
$quoteAddress->getData($key),
258+
self::EPSILON,
259+
'Quote address ' . $key . ' is incorrect'
260+
);
251261
}
252262
}
253263

dev/tests/integration/testsuite/Magento/Tax/Model/TaxCalculationTest.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@
1616
class TaxCalculationTest extends \PHPUnit\Framework\TestCase
1717
{
1818
/**
19-
* Object Manager
20-
*
19+
* @var float
20+
*/
21+
private const EPSILON = 0.0000000001;
22+
23+
/**
2124
* @var \Magento\Framework\ObjectManagerInterface
2225
*/
2326
private $objectManager;
2427

2528
/**
26-
* Tax calculation service
27-
*
2829
* @var \Magento\Tax\Api\TaxCalculationInterface
2930
*/
3031
private $taxCalculationService;
@@ -108,7 +109,7 @@ public function testCalculateTaxUnitBased($quoteDetailsData, $expected)
108109
);
109110

110111
$taxDetails = $this->taxCalculationService->calculateTax($quoteDetails, 1);
111-
$this->assertEquals($expected, $this->convertObjectToArray($taxDetails));
112+
$this->assertEqualsWithDelta($expected, $this->convertObjectToArray($taxDetails), self::EPSILON);
112113
}
113114

114115
/**
@@ -1286,7 +1287,7 @@ public function testCalculateTaxRowBased($quoteDetailsData, $expectedTaxDetails)
12861287

12871288
$taxDetails = $this->taxCalculationService->calculateTax($quoteDetails);
12881289

1289-
$this->assertEquals($expectedTaxDetails, $this->convertObjectToArray($taxDetails));
1290+
$this->assertEqualsWithDelta($expectedTaxDetails, $this->convertObjectToArray($taxDetails), self::EPSILON);
12901291
}
12911292

12921293
/**
@@ -2387,7 +2388,7 @@ public function testMultiRulesRowBased($quoteDetailsData, $expectedTaxDetails)
23872388

23882389
$taxDetails = $this->taxCalculationService->calculateTax($quoteDetails);
23892390

2390-
$this->assertEquals($expectedTaxDetails, $this->convertObjectToArray($taxDetails));
2391+
$this->assertEqualsWithDelta($expectedTaxDetails, $this->convertObjectToArray($taxDetails), self::EPSILON);
23912392
}
23922393

23932394
/**
@@ -2424,7 +2425,7 @@ public function testMultiRulesTotalBased($quoteDetailsData, $expectedTaxDetails)
24242425

24252426
$taxDetails = $this->taxCalculationService->calculateTax($quoteDetails);
24262427

2427-
$this->assertEquals($expectedTaxDetails, $this->convertObjectToArray($taxDetails));
2428+
$this->assertEqualsWithDelta($expectedTaxDetails, $this->convertObjectToArray($taxDetails), self::EPSILON);
24282429
}
24292430

24302431
/**
@@ -2471,7 +2472,7 @@ public function testMultiRulesUnitBased($quoteDetailsData, $expectedTaxDetails)
24712472

24722473
$taxDetails = $this->taxCalculationService->calculateTax($quoteDetails);
24732474

2474-
$this->assertEquals($expectedTaxDetails, $this->convertObjectToArray($taxDetails));
2475+
$this->assertEqualsWithDelta($expectedTaxDetails, $this->convertObjectToArray($taxDetails), self::EPSILON);
24752476
}
24762477

24772478
/**

lib/internal/Magento/Framework/App/Response/Http.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
* @api
2222
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
2323
*/
24+
#[\AllowDynamicProperties]
2425
class Http extends \Magento\Framework\HTTP\PhpEnvironment\Response
2526
{
2627
/** Cookie to store page vary string */

0 commit comments

Comments
 (0)