Skip to content

Commit 8b33258

Browse files
authored
Merge pull request magento#600 from magento/MQE-1997
Mqe 1997: Type float is wrongly treated as integer in assert actions
2 parents d632ab3 + ba72b5a commit 8b33258

File tree

6 files changed

+14
-3
lines changed

6 files changed

+14
-3
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Magento Functional Testing Framework Changelog
22
================================================
33

4+
2.6.2
5+
-----
6+
7+
### Fixes
8+
* Fixed float conversion error in test generation
9+
410
2.6.1
511
-----
612

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/magento2-functional-testing-framework",
33
"description": "Magento2 Functional Testing Framework",
44
"type": "library",
5-
"version": "2.6.1",
5+
"version": "2.6.2",
66
"license": "AGPL-3.0",
77
"keywords": ["magento", "automation", "functional", "testing"],
88
"config": {

composer.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev/tests/verification/Resources/AssertTest.txt

+1
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

+4
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

+1-1
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)