Skip to content

Commit fb69c1a

Browse files
committed
MQE-1997: type float is wrongly treated as integer in assert actions
1 parent d632ab3 commit fb69c1a

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

dev/tests/verification/Resources/AssertTest.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class AssertTestCest
4949
$I->assertEmpty([], "pass"); // stepKey: assertEmpty
5050
$I->assertEquals($text, "Copyright © 2013-2017 Magento, Inc. All rights reserved.", "pass"); // stepKey: assertEquals1
5151
$I->assertEquals("Copyright © 2013-2017 Magento, Inc. All rights reserved.", $text, "pass"); // stepKey: assertEquals2
52+
$I->assertEquals(1.5, $text, "pass"); // stepKey: assertFloatTypeIsCorrect
5253
$I->assertFalse(false, "pass"); // stepKey: assertFalse1
5354
$I->assertFileNotExists("/out.txt", "pass"); // stepKey: assertFileNotExists1
5455
$I->assertFileNotExists($text, "pass"); // stepKey: assertFileNotExists2

dev/tests/verification/TestModule/Test/AssertTest.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
<expectedResult type="string">Copyright © 2013-2017 Magento, Inc. All rights reserved.</expectedResult>
5555
<actualResult type="variable">text</actualResult>
5656
</assertEquals>
57+
<assertEquals stepKey="assertFloatTypeIsCorrect" message="pass">
58+
<expectedResult type="float">1.5</expectedResult>
59+
<actualResult type="variable">text</actualResult>
60+
</assertEquals>
5761
<assertFalse stepKey="assertFalse1" message="pass">
5862
<actualResult type="bool">0</actualResult>
5963
</assertFalse>

src/Magento/FunctionalTestingFramework/Util/TestGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2194,6 +2194,6 @@ private function wrapParameterArray(string $value): string
21942194
*/
21952195
private function hasDecimalPoint(string $outStr)
21962196
{
2197-
return strpos($outStr, localeconv()['decimal_point']) === false;
2197+
return strpos($outStr, localeconv()['decimal_point']) !== false;
21982198
}
21992199
}

0 commit comments

Comments
 (0)