Skip to content

Mqe 1997: Type float is wrongly treated as integer in assert actions #600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dev/tests/verification/Resources/AssertTest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class AssertTestCest
$I->assertEmpty([], "pass"); // stepKey: assertEmpty
$I->assertEquals($text, "Copyright © 2013-2017 Magento, Inc. All rights reserved.", "pass"); // stepKey: assertEquals1
$I->assertEquals("Copyright © 2013-2017 Magento, Inc. All rights reserved.", $text, "pass"); // stepKey: assertEquals2
$I->assertEquals(1.5, $text, "pass"); // stepKey: assertFloatTypeIsCorrect
$I->assertFalse(false, "pass"); // stepKey: assertFalse1
$I->assertFileNotExists("/out.txt", "pass"); // stepKey: assertFileNotExists1
$I->assertFileNotExists($text, "pass"); // stepKey: assertFileNotExists2
Expand Down
4 changes: 4 additions & 0 deletions dev/tests/verification/TestModule/Test/AssertTest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
<expectedResult type="string">Copyright © 2013-2017 Magento, Inc. All rights reserved.</expectedResult>
<actualResult type="variable">text</actualResult>
</assertEquals>
<assertEquals stepKey="assertFloatTypeIsCorrect" message="pass">
<expectedResult type="float">1.5</expectedResult>
<actualResult type="variable">text</actualResult>
</assertEquals>
<assertFalse stepKey="assertFalse1" message="pass">
<actualResult type="bool">0</actualResult>
</assertFalse>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2194,6 +2194,6 @@ private function wrapParameterArray(string $value): string
*/
private function hasDecimalPoint(string $outStr)
{
return strpos($outStr, localeconv()['decimal_point']) === false;
return strpos($outStr, localeconv()['decimal_point']) !== false;
}
}