Skip to content

Commit 0c3e397

Browse files
author
Sergey Shvets
committed
MAGETWO-91771: Comma special character in cart price rule condition value results in incorrect rule
1 parent 11f3343 commit 0c3e397

File tree

3 files changed

+25
-13
lines changed

3 files changed

+25
-13
lines changed

app/code/Magento/ConfigurableProduct/Test/Unit/Block/Product/View/Type/ConfigurableTest.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ class ConfigurableTest extends \PHPUnit\Framework\TestCase
8484
*/
8585
private $variationPricesMock;
8686

87+
/**
88+
* {@inheritDoc}
89+
*/
8790
protected function setUp()
8891
{
8992
$this->mockContextObject();
@@ -346,13 +349,13 @@ public function testGetJsonConfig()
346349
/**
347350
* Retrieve array with expected parameters for method getJsonConfig()
348351
*
349-
* @param $productId
350-
* @param $amount
351-
* @param $priceQty
352-
* @param $percentage
352+
* @param int $productId
353+
* @param double $amount
354+
* @param int $priceQty
355+
* @param int $percentage
353356
* @return array
354357
*/
355-
private function getExpectedArray($productId, $amount, $priceQty, $percentage)
358+
private function getExpectedArray($productId, $amount, $priceQty, $percentage): array
356359
{
357360
$expectedArray = [
358361
'attributes' => [],

app/code/Magento/SalesRule/Test/Unit/Model/Rule/Condition/ProductTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,10 @@ public function testGetValueElementChooserUrl($attribute, $url, $jsObject = '')
207207
$this->assertEquals($url, $this->model->getValueElementChooserUrl());
208208
}
209209

210-
public function testValidateCategoriesIgnoresVisibility()
210+
/**
211+
* test ValidateCategoriesIgnoresVisibility
212+
*/
213+
public function testValidateCategoriesIgnoresVisibility(): void
211214
{
212215
/* @var \Magento\Catalog\Model\Product|\PHPUnit_Framework_MockObject_MockObject $product */
213216
$product = $this->getMockBuilder(\Magento\Catalog\Model\Product::class)

lib/internal/Magento/Framework/Locale/Test/Unit/FormatTest.php

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ class FormatTest extends \PHPUnit\Framework\TestCase
3333
*/
3434
protected $currency;
3535

36+
/**
37+
* {@inheritDoc}
38+
*/
3639
protected function setUp()
3740
{
3841
$this->currency = $this->getMockBuilder(\Magento\Directory\Model\Currency::class)
@@ -64,11 +67,11 @@ protected function setUp()
6467
}
6568

6669
/**
67-
* @param $localeCode
68-
* @param $expectedResult
70+
* @param string $localeCode
71+
* @param array $expectedResult
6972
* @dataProvider getPriceFormatDataProvider
7073
*/
71-
public function testGetPriceFormat($localeCode, $expectedResult)
74+
public function testGetPriceFormat($localeCode, array $expectedResult): void
7275
{
7376
$this->scope->expects($this->once())
7477
->method('getCurrentCurrency')
@@ -80,9 +83,10 @@ public function testGetPriceFormat($localeCode, $expectedResult)
8083
}
8184

8285
/**
86+
*
8387
* @return array
8488
*/
85-
public function getPriceFormatDataProvider()
89+
public function getPriceFormatDataProvider(): array
8690
{
8791
return [
8892
['en_US', ['decimalSymbol' => '.', 'groupSymbol' => ',']],
@@ -93,16 +97,18 @@ public function getPriceFormatDataProvider()
9397
}
9498

9599
/**
96-
* @param float | null $expected
97-
* @param string|float|int $value
100+
*
101+
* @param mixed $value
102+
* @param float $expected
98103
* @dataProvider provideNumbers
99104
*/
100-
public function testGetNumber($value, $expected)
105+
public function testGetNumber($value, $expected): void
101106
{
102107
$this->assertEquals($expected, $this->formatModel->getNumber($value));
103108
}
104109

105110
/**
111+
*
106112
* @return array
107113
*/
108114
public function provideNumbers(): array

0 commit comments

Comments
 (0)