Skip to content

MQE-2076: [PHPUnit 9] assertEquals and assertNotEquals optional parameters removed #675

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 4 commits into from
Apr 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 8 additions & 2 deletions dev/tests/verification/Resources/AssertTest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class AssertTestCest
$I->assertStringNotContainsStringIgnoringCase("apple", "banana", "pass"); // stepKey: assertStringNotContainsStringIgnoringCase
$I->assertNotEmpty([1, 2], "pass"); // stepKey: assertNotEmpty1
$I->assertNotEmpty($text, "pass"); // stepKey: assertNotEmpty2
$I->assertNotEquals(2, 5, "pass", 0); // stepKey: assertNotEquals
$I->assertNotEquals(2, 5, "pass"); // stepKey: assertNotEquals
$I->assertNotNull("abc", "pass"); // stepKey: assertNotNull1
$I->assertNotNull($text, "pass"); // stepKey: assertNotNull2
$I->assertNotRegExp("/foo/", "bar", "pass"); // stepKey: assertNotRegExp
Expand Down Expand Up @@ -105,7 +105,7 @@ class AssertTestCest
$I->assertNotContains("bc", $text, "pass"); // stepKey: assertNotContains2BackwardCompatible
$I->assertNotEmpty([1, 2], "pass"); // stepKey: assertNotEmpty1BackwardCompatible
$I->assertNotEmpty($text, "pass"); // stepKey: assertNotEmpty2BackwardCompatible
$I->assertNotEquals(2, 5, "pass", 0); // stepKey: assertNotEqualsBackwardCompatible
$I->assertNotEquals(2, 5, "pass"); // stepKey: assertNotEqualsBackwardCompatible
$I->assertNotNull("abc", "pass"); // stepKey: assertNotNull1BackwardCompatible
$I->assertNotNull($text, "pass"); // stepKey: assertNotNull2BackwardCompatible
$I->assertNotRegExp("/foo/", "bar", "pass"); // stepKey: assertNotRegExpBackwardCompatible
Expand Down Expand Up @@ -155,5 +155,11 @@ class AssertTestCest
$I->assertElementContainsAttribute("#username", "value", $I->retrieveEntityField('createData1', 'firstname', 'test')); // stepKey: assertElementContainsAttribute8
$I->comment("assert entity resolution");
$I->assertEquals("John", "Doe", "pass"); // stepKey: assertEqualsEntity
$I->assertEqualsWithDelta(10.0000, 10.0000, 1, "pass"); // stepKey: a1
$I->assertNotEqualsWithDelta(10.0000, 12.0000, 1, "pass"); // stepKey: a2
$I->assertEqualsCanonicalizing(["4", "2", "1", "3"], ["1", "2", "3", "4"], "pass"); // stepKey: a3
$I->assertNotEqualsCanonicalizing(["5", "8", "7", "9"], ["1", "2", "3", "4"], "pass"); // stepKey: a4
$I->assertEqualsIgnoringCase("Cat", "cat", "pass"); // stepKey: a5
$I->assertNotEqualsIgnoringCase("Cat", "Dog", "pass"); // stepKey: a6
}
}
29 changes: 27 additions & 2 deletions dev/tests/verification/TestModule/Test/AssertTest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
<assertNotEmpty stepKey="assertNotEmpty2" message="pass">
<actualResult type="variable">text</actualResult>
</assertNotEmpty>
<assertNotEquals stepKey="assertNotEquals" message="pass" delta="">
<assertNotEquals stepKey="assertNotEquals" message="pass">
<expectedResult type="int">2</expectedResult>
<actualResult type="int">5</actualResult>
</assertNotEquals>
Expand Down Expand Up @@ -259,7 +259,7 @@
<assertNotEmpty stepKey="assertNotEmpty2BackwardCompatible" message="pass">
<actualResult type="variable">text</actualResult>
</assertNotEmpty>
<assertNotEquals stepKey="assertNotEqualsBackwardCompatible" message="pass" delta="">
<assertNotEquals stepKey="assertNotEqualsBackwardCompatible" message="pass">
<actualResult type="int">5</actualResult>
<expectedResult type="int">2</expectedResult>
</assertNotEquals>
Expand Down Expand Up @@ -415,5 +415,30 @@
<expectedResult type="string">{{simpleData.firstname}}</expectedResult>
<actualResult type="string">{{simpleData.lastname}}</actualResult>
</assertEquals>

<assertEqualsWithDelta stepKey="a1" message="pass" delta="1">
<expectedResult type="const">10.0000</expectedResult>
<actualResult type="const">10.0000</actualResult>
</assertEqualsWithDelta>
<assertNotEqualsWithDelta stepKey="a2" message="pass" delta="1">
<expectedResult type="const">10.0000</expectedResult>
<actualResult type="const">12.0000</actualResult>
</assertNotEqualsWithDelta>
<assertEqualsCanonicalizing stepKey="a3" message="pass">
<expectedResult type="array">[4, 2, 1, 3]</expectedResult>
<actualResult type="array">[1, 2, 3, 4]</actualResult>
</assertEqualsCanonicalizing>
<assertNotEqualsCanonicalizing stepKey="a4" message="pass">
<expectedResult type="array">[5, 8, 7, 9]</expectedResult>
<actualResult type="array">[1, 2, 3, 4]</actualResult>
</assertNotEqualsCanonicalizing>
<assertEqualsIgnoringCase stepKey="a5" message="pass">
<expectedResult type="string">Cat</expectedResult>
<actualResult type="string">cat</actualResult>
</assertEqualsIgnoringCase>
<assertNotEqualsIgnoringCase stepKey="a6" message="pass">
<expectedResult type="string">Cat</expectedResult>
<actualResult type="string">Dog</actualResult>
</assertNotEqualsIgnoringCase>
</test>
</tests>
66 changes: 66 additions & 0 deletions docs/test/assertions.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,17 @@ Attribute|Type|Use|Description

See [assertEquals docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertEquals).

Attribute|Type|Use|Description
---|---|---|---
`message`|string|optional|Text of informational message about a cause of failure.
`stepKey`|string|required| A unique identifier of the text step.
`before`|string|optional| `stepKey` of action that must be executed next.
`after`|string|optional| `stepKey` of the preceding action.

### assertEqualsWithDelta

See [assertEqualsWithDelta docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertEqualsWithDelta).

Attribute|Type|Use|Description
---|---|---|---
`delta`|string|optional|
Expand All @@ -187,6 +198,28 @@ Attribute|Type|Use|Description
`before`|string|optional| `stepKey` of action that must be executed next.
`after`|string|optional| `stepKey` of the preceding action.

### assertEqualsCanonicalizing

See [assertEqualsCanonicalizing docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertEqualsCanonicalizing).

Attribute|Type|Use|Description
---|---|---|---
`message`|string|optional|Text of informational message about a cause of failure.
`stepKey`|string|required| A unique identifier of the text step.
`before`|string|optional| `stepKey` of action that must be executed next.
`after`|string|optional| `stepKey` of the preceding action.

### assertEqualsIgnoringCase

See [assertEqualsIgnoringCase docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertEqualsIgnoringCase).

Attribute|Type|Use|Description
---|---|---|---
`message`|string|optional|Text of informational message about a cause of failure.
`stepKey`|string|required| A unique identifier of the text step.
`before`|string|optional| `stepKey` of action that must be executed next.
`after`|string|optional| `stepKey` of the preceding action.

### assertFalse

See [assertFalse docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertFalse).
Expand Down Expand Up @@ -367,6 +400,17 @@ Attribute|Type|Use|Description

See [assertNotEquals docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertNotEquals).

Attribute|Type|Use|Description
---|---|---|---
`message`|string|optional|Text of informational message about a cause of failure.
`stepKey`|string|required| A unique identifier of the text step.
`before`|string|optional| `stepKey` of action that must be executed next.
`after`|string|optional| `stepKey` of the preceding action.

### assertNotEqualsWithDelta

See [assertNotEqualsWithDelta docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertNotEqualsWithDelta).

Attribute|Type|Use|Description
---|---|---|---
`delta`|string|optional|
Expand All @@ -375,6 +419,28 @@ Attribute|Type|Use|Description
`before`|string|optional| `stepKey` of action that must be executed next.
`after`|string|optional| `stepKey` of the preceding action.

### assertNotEqualsCanonicalizing

See [assertNotEqualsCanonicalizing docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertNotEqualsCanonicalizing).

Attribute|Type|Use|Description
---|---|---|---
`message`|string|optional|Text of informational message about a cause of failure.
`stepKey`|string|required| A unique identifier of the text step.
`before`|string|optional| `stepKey` of action that must be executed next.
`after`|string|optional| `stepKey` of the preceding action.

### assertNotEqualsIgnoringCase

See [assertNotEqualsIgnoringCase docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertNotEqualsIgnoringCase).

Attribute|Type|Use|Description
---|---|---|---
`message`|string|optional|Text of informational message about a cause of failure.
`stepKey`|string|required| A unique identifier of the text step.
`before`|string|optional| `stepKey` of action that must be executed next.
`after`|string|optional| `stepKey` of the preceding action.

### assertNotInstanceOf

See [assertNotInstanceOf docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertNotInstanceOf).
Expand Down
2 changes: 1 addition & 1 deletion etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<!-- Entity value gets replaced in Dom.php before reading $xml -->
<!DOCTYPE config [
<!ENTITY commonTestActions "acceptPopup|actionGroup|amOnPage|amOnUrl|amOnSubdomain|appendField|assertArrayIsSortasserted|assertArraySubset|assertElementContainsAttribute|attachFile|cancelPopup|checkOption|clearField|click|clickWithLeftButton|clickWithRightButton|closeAdminNotification|closeTab|comment|conditionalClick|createData|deleteData|updateData|getData|dontSee|dontSeeJsError|dontSeeCheckboxIsChecked|dontSeeCookie|dontSeeCurrentUrlEquals|dontSeeCurrentUrlMatches|dontSeeElement|dontSeeElementInDOM|dontSeeInCurrentUrl|dontSeeInField|dontSeeInFormFields|dontSeeInPageSource|dontSeeInSource|dontSeeInTitle|dontSeeLink|dontSeeOptionIsSelected|doubleClick|dragAndDrop|entity|executeJS|fillField|formatMoney|generateDate|grabAttributeFrom|grabCookie|grabFromCurrentUrl|grabMultiple|grabPageSource|grabTextFrom|grabValueFrom|loadSessionSnapshot|loginAsAdmin|magentoCLI|magentoCron|makeScreenshot|maximizeWindow|moveBack|moveForward|moveMouseOver|mSetLocale|mResetLocale|openNewTab|pause|parseFloat|pressKey|reloadPage|resetCookie|submitForm|resizeWindow|saveSessionSnapshot|scrollTo|scrollToTopOfPage|searchAndMultiSelectOption|see|seeCheckboxIsChecked|seeCookie|seeCurrentUrlEquals|seeCurrentUrlMatches|seeElement|seeElementInDOM|seeInCurrentUrl|seeInField|seeInFormFields|seeInPageSource|seeInPopup|seeInSource|seeInTitle|seeLink|seeNumberOfElements|seeOptionIsSelected|selectOption|setCookie|submitForm|switchToIFrame|switchToNextTab|switchToPreviousTab|switchToWindow|typeInPopup|uncheckOption|unselectOption|wait|waitForAjaxLoad|waitForElement|waitForElementChange|waitForElementNotVisible|waitForElementVisible|waitForPwaElementNotVisible|waitForPwaElementVisible|waitForJS|waitForLoadingMaskToDisappear|waitForPageLoad|waitForText|assertArrayHasKey|assertArrayNotHasKey|assertArraySubset|assertContains|assertStringContainsString|assertStringContainsStringIgnoringCase|assertCount|assertEmpty|assertEquals|assertFalse|assertFileExists|assertFileNotExists|assertGreaterOrEquals|assertGreaterThan|assertGreaterThanOrEqual|assertInstanceOf|assertInternalType|assertIsEmpty|assertLessOrEquals|assertLessThan|assertLessThanOrEqual|assertNotContains|assertStringNotContainsString|assertStringNotContainsStringIgnoringCase|assertNotEmpty|assertNotEquals|assertNotInstanceOf|assertNotNull|assertNotRegExp|assertNotSame|assertNull|assertRegExp|assertSame|assertStringStartsNotWith|assertStringStartsWith|assertTrue|expectException|fail|dontSeeFullUrlEquals|dontSee|dontSeeFullUrlMatches|dontSeeInFullUrl|seeFullUrlEquals|seeFullUrlMatches|seeInFullUrl|grabFromFullUrl|helper">
<!ENTITY commonTestActions "acceptPopup|actionGroup|amOnPage|amOnUrl|amOnSubdomain|appendField|assertArrayIsSortasserted|assertArraySubset|assertElementContainsAttribute|attachFile|cancelPopup|checkOption|clearField|click|clickWithLeftButton|clickWithRightButton|closeAdminNotification|closeTab|comment|conditionalClick|createData|deleteData|updateData|getData|dontSee|dontSeeJsError|dontSeeCheckboxIsChecked|dontSeeCookie|dontSeeCurrentUrlEquals|dontSeeCurrentUrlMatches|dontSeeElement|dontSeeElementInDOM|dontSeeInCurrentUrl|dontSeeInField|dontSeeInFormFields|dontSeeInPageSource|dontSeeInSource|dontSeeInTitle|dontSeeLink|dontSeeOptionIsSelected|doubleClick|dragAndDrop|entity|executeJS|fillField|formatMoney|generateDate|grabAttributeFrom|grabCookie|grabFromCurrentUrl|grabMultiple|grabPageSource|grabTextFrom|grabValueFrom|loadSessionSnapshot|loginAsAdmin|magentoCLI|magentoCron|makeScreenshot|maximizeWindow|moveBack|moveForward|moveMouseOver|mSetLocale|mResetLocale|openNewTab|pause|parseFloat|pressKey|reloadPage|resetCookie|submitForm|resizeWindow|saveSessionSnapshot|scrollTo|scrollToTopOfPage|searchAndMultiSelectOption|see|seeCheckboxIsChecked|seeCookie|seeCurrentUrlEquals|seeCurrentUrlMatches|seeElement|seeElementInDOM|seeInCurrentUrl|seeInField|seeInFormFields|seeInPageSource|seeInPopup|seeInSource|seeInTitle|seeLink|seeNumberOfElements|seeOptionIsSelected|selectOption|setCookie|submitForm|switchToIFrame|switchToNextTab|switchToPreviousTab|switchToWindow|typeInPopup|uncheckOption|unselectOption|wait|waitForAjaxLoad|waitForElement|waitForElementChange|waitForElementNotVisible|waitForElementVisible|waitForPwaElementNotVisible|waitForPwaElementVisible|waitForJS|waitForLoadingMaskToDisappear|waitForPageLoad|waitForText|assertArrayHasKey|assertArrayNotHasKey|assertArraySubset|assertContains|assertStringContainsString|assertStringContainsStringIgnoringCase|assertCount|assertEmpty|assertEquals|assertFalse|assertFileExists|assertFileNotExists|assertGreaterOrEquals|assertGreaterThan|assertGreaterThanOrEqual|assertInstanceOf|assertInternalType|assertIsEmpty|assertLessOrEquals|assertLessThan|assertLessThanOrEqual|assertNotContains|assertStringNotContainsString|assertStringNotContainsStringIgnoringCase|assertNotEmpty|assertNotEquals|assertNotInstanceOf|assertNotNull|assertNotRegExp|assertNotSame|assertNull|assertRegExp|assertSame|assertStringStartsNotWith|assertStringStartsWith|assertTrue|expectException|fail|dontSeeFullUrlEquals|dontSee|dontSeeFullUrlMatches|dontSeeInFullUrl|seeFullUrlEquals|seeFullUrlMatches|seeInFullUrl|grabFromFullUrl|helper|assertEqualsWithDelta|assertEqualsCanonicalizing|assertEqualsIgnoringCase|assertNotEqualsWithDelta|assertNotEqualsCanonicalizing|assertNotEqualsIgnoringCase">
]>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../src/Magento/FunctionalTestingFramework/ObjectManager/etc/config.xsd">
Expand Down
Loading