Skip to content

MQE-2077: [PHPUnit 9] Remove assertArraySubset, assertInternalType, a… #677

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 2 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: 0 additions & 10 deletions dev/tests/verification/Resources/AssertTest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class AssertTestCest
$I->comment("asserts without variable replacement");
$I->assertArrayHasKey("apple", ['orange' => 2, 'apple' => 1], "pass"); // stepKey: assertArrayHasKey
$I->assertArrayNotHasKey("kiwi", ['orange' => 2, 'apple' => 1], "pass"); // stepKey: assertArrayNotHasKey
$I->assertArraySubset([1, 2], [1, 2, 3, 5], "pass"); // stepKey: assertArraySubset
$I->assertContains("ab", ['item1' => 'a', 'item2' => 'ab'], "pass"); // stepKey: assertContains
$I->assertStringContainsString("apple", "apple", "pass"); // stepKey: assertStringContainsString
$I->assertStringContainsStringIgnoringCase("Banana", "banana", "pass"); // stepKey: assertStringContainsStringIgnoringCase
Expand All @@ -58,9 +57,6 @@ class AssertTestCest
$I->assertGreaterOrEquals(2, 5, "pass"); // stepKey: assertGreaterOrEquals
$I->assertGreaterThan(2, 5, "pass"); // stepKey: assertGreaterthan
$I->assertGreaterThanOrEqual(2, 5, "pass"); // stepKey: assertGreaterThanOrEqual
$I->assertInternalType("string", "xyz", "pass"); // stepKey: assertInternalType1
$I->assertInternalType("int", 21, "pass"); // stepKey: assertInternalType2
$I->assertInternalType("string", $text, "pass"); // stepKey: assertInternalType3
$I->assertLessOrEquals(5, 2, "pass"); // stepKey: assertLessOrEquals
$I->assertLessThan(5, 2, "pass"); // stepKey: assertLessThan
$I->assertLessThanOrEqual(5, 2, "pass"); // stepKey: assertLessThanOrEquals
Expand All @@ -83,7 +79,6 @@ class AssertTestCest
$I->comment("asserts backward compatible");
$I->assertArrayHasKey("apple", ['orange' => 2, 'apple' => 1], "pass"); // stepKey: assertArrayHasKeyBackwardCompatible
$I->assertArrayNotHasKey("kiwi", ['orange' => 2, 'apple' => 1], "pass"); // stepKey: assertArrayNotHasKeyBackwardCompatible
$I->assertArraySubset([1, 2], [1, 2, 3, 5], "pass"); // stepKey: assertArraySubsetBackwardCompatible
$I->assertContains("ab", ['item1' => 'a', 'item2' => 'ab'], "pass"); // stepKey: assertContainsBackwardCompatible
$I->assertCount(2, ['a', 'b'], "pass"); // stepKey: assertCountBackwardCompatible
$I->assertEmpty([], "pass"); // stepKey: assertEmptyBackwardCompatible
Expand All @@ -95,9 +90,6 @@ class AssertTestCest
$I->assertGreaterOrEquals(2, 5, "pass"); // stepKey: assertGreaterOrEqualsBackwardCompatible
$I->assertGreaterThan(2, 5, "pass"); // stepKey: assertGreaterThanBackwardCompatible
$I->assertGreaterThanOrEqual(2, 5, "pass"); // stepKey: assertGreaterThanOrEqualBackwardCompatible
$I->assertInternalType("string", "xyz", "pass"); // stepKey: assertInternalType1BackwardCompatible
$I->assertInternalType("int", 21, "pass"); // stepKey: assertInternalType2BackwardCompatible
$I->assertInternalType("string", $text, "pass"); // stepKey: assertInternalType3BackwardCompatible
$I->assertLessOrEquals(5, 2, "pass"); // stepKey: assertLessOrEqualBackwardCompatibles
$I->assertLessThan(5, 2, "pass"); // stepKey: assertLessThanBackwardCompatible
$I->assertLessThanOrEqual(5, 2, "pass"); // stepKey: assertLessThanOrEqualBackwardCompatible
Expand Down Expand Up @@ -129,8 +121,6 @@ class AssertTestCest
$I->assertEquals($I->retrieveEntityField('createData1', 'lastname', 'test'), $I->retrieveEntityField('createData1', 'lastname', 'test'), "pass"); // stepKey: assert5
$I->comment("array type that use created data");
$I->comment("array type that use created data");
$I->assertArraySubset([$I->retrieveEntityField('createData1', 'lastname', 'test'), $I->retrieveEntityField('createData1', 'firstname', 'test')], [$I->retrieveEntityField('createData1', 'lastname', 'test'), $I->retrieveEntityField('createData1', 'firstname', 'test'), "1"], "pass"); // stepKey: assert9
$I->assertArraySubset([$I->retrieveEntityField('createData2', 'firstname', 'test'), $I->retrieveEntityField('createData2', 'lastname', 'test')], [$I->retrieveEntityField('createData2', 'firstname', 'test'), $I->retrieveEntityField('createData2', 'lastname', 'test'), "1"], "pass"); // stepKey: assert10
$I->assertArrayHasKey("lastname", ['lastname' => $I->retrieveEntityField('createData1', 'lastname', 'test'), 'firstname' => $I->retrieveEntityField('createData1', 'firstname', 'test')], "pass"); // stepKey: assert3
$I->assertArrayHasKey("lastname", ['lastname' => $I->retrieveEntityField('createData2', 'lastname', 'test'), 'firstname' => $I->retrieveEntityField('createData2', 'firstname', 'test')], "pass"); // stepKey: assert4
$I->comment("this section can only be generated and cannot run");
Expand Down
40 changes: 0 additions & 40 deletions dev/tests/verification/TestModule/Test/AssertTest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
<expectedResult type="string">kiwi</expectedResult>
<actualResult type="const">['orange' => 2, 'apple' => 1]</actualResult>
</assertArrayNotHasKey>
<assertArraySubset stepKey="assertArraySubset" message="pass">
<expectedResult type="const">[1, 2]</expectedResult>
<actualResult type="const">[1, 2, 3, 5]</actualResult>
</assertArraySubset>
<assertContains stepKey="assertContains" message="pass">
<expectedResult type="string">ab</expectedResult>
<actualResult type="const">['item1' => 'a', 'item2' => 'ab']</actualResult>
Expand Down Expand Up @@ -87,18 +83,6 @@
<expectedResult type="int">2</expectedResult>
<actualResult type="int">5</actualResult>
</assertGreaterThanOrEqual>
<assertInternalType stepKey="assertInternalType1" message="pass">
<expectedResult type="string">string</expectedResult>
<actualResult type="string">xyz</actualResult>
</assertInternalType>
<assertInternalType stepKey="assertInternalType2" message="pass">
<expectedResult type="string">int</expectedResult>
<actualResult type="int">21</actualResult>
</assertInternalType>
<assertInternalType stepKey="assertInternalType3" message="pass">
<expectedResult type="string">string</expectedResult>
<actualResult type="variable">text</actualResult>
</assertInternalType>
<assertLessOrEquals stepKey="assertLessOrEquals" message="pass">
<expectedResult type="int">5</expectedResult>
<actualResult type="int">2</actualResult>
Expand Down Expand Up @@ -177,10 +161,6 @@
<expectedResult type="string">kiwi</expectedResult>
<actualResult type="const">['orange' => 2, 'apple' => 1]</actualResult>
</assertArrayNotHasKey>
<assertArraySubset stepKey="assertArraySubsetBackwardCompatible" message="pass">
<actualResult type="const">[1, 2, 3, 5]</actualResult>
<expectedResult type="const">[1, 2]</expectedResult>
</assertArraySubset>
<assertContains stepKey="assertContainsBackwardCompatible" message="pass">
<expectedResult type="string">ab</expectedResult>
<actualResult type="const">['item1' => 'a', 'item2' => 'ab']</actualResult>
Expand Down Expand Up @@ -221,18 +201,6 @@
<actualResult type="int">5</actualResult>
<expectedResult type="int">2</expectedResult>
</assertGreaterThanOrEqual>
<assertInternalType stepKey="assertInternalType1BackwardCompatible" message="pass">
<actualResult type="string">xyz</actualResult>
<expectedResult type="string">string</expectedResult>
</assertInternalType>
<assertInternalType stepKey="assertInternalType2BackwardCompatible" message="pass">
<actualResult type="int">21</actualResult>
<expectedResult type="string">int</expectedResult>
</assertInternalType>
<assertInternalType stepKey="assertInternalType3BackwardCompatible" message="pass">
<actualResult type="variable">$text</actualResult>
<expectedResult type="string">string</expectedResult>
</assertInternalType>
<assertLessOrEquals stepKey="assertLessOrEqualBackwardCompatibles" message="pass">
<actualResult type="int">2</actualResult>
<expectedResult type="int">5</expectedResult>
Expand Down Expand Up @@ -338,14 +306,6 @@

<!-- array type that use created data -->
<comment stepKey="c3" userInput="array type that use created data"/>
<assertArraySubset stepKey="assert9" message="pass">
<expectedResult type="array">[$$createData1.lastname$$, $$createData1.firstname$$]</expectedResult>
<actualResult type="array">[$$createData1.lastname$$, $$createData1.firstname$$, 1]</actualResult>
</assertArraySubset>
<assertArraySubset stepKey="assert10" message="pass">
<expectedResult type="array">[$createData2.firstname$, $createData2.lastname$]</expectedResult>
<actualResult type="array">[$createData2.firstname$, $createData2.lastname$, 1]</actualResult>
</assertArraySubset>
<assertArrayHasKey stepKey="assert3" message="pass">
<expectedResult type="string">lastname</expectedResult>
<actualResult type="array">['lastname' => $$createData1.lastname$$, 'firstname' => $$createData1.firstname$$]</actualResult>
Expand Down
23 changes: 0 additions & 23 deletions docs/test/assertions.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,6 @@ Attribute|Type|Use|Description
`before`|string|optional| `stepKey` of action that must be executed next.
`after`|string|optional| `stepKey` of the preceding action.

### assertArraySubset

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

Attribute|Type|Use|Description
---|---|---|---
`strict`|boolean|optional|
`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.

### assertContains

See [assertContains docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertContains).
Expand Down Expand Up @@ -297,17 +285,6 @@ Attribute|Type|Use|Description
`before`|string|optional| `stepKey` of action that must be executed next.
`after`|string|optional| `stepKey` of the preceding action.

### assertInternalType

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

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.

### assertIsEmpty

See [assertIsEmpty docs on codeception.com](http://codeception.com/docs/modules/Asserts#assertIsEmpty).
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|assertEqualsWithDelta|assertEqualsCanonicalizing|assertEqualsIgnoringCase|assertNotEqualsWithDelta|assertNotEqualsCanonicalizing|assertNotEqualsIgnoringCase">
<!ENTITY commonTestActions "acceptPopup|actionGroup|amOnPage|amOnUrl|amOnSubdomain|appendField|assertArrayIsSortasserted|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|assertContains|assertStringContainsString|assertStringContainsStringIgnoringCase|assertCount|assertEmpty|assertEquals|assertFalse|assertFileExists|assertFileNotExists|assertGreaterOrEquals|assertGreaterThan|assertGreaterThanOrEqual|assertInstanceOf|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
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<xs:element type="assertElementContainsAttributeType" name="assertElementContainsAttribute" minOccurs="0" maxOccurs="unbounded"/>
<xs:element type="assertArrayHasKeyType" name="assertArrayHasKey" minOccurs="0" maxOccurs="unbounded"/>
<xs:element type="assertArrayNotHasKeyType" name="assertArrayNotHasKey" minOccurs="0" maxOccurs="unbounded"/>
<xs:element type="assertArraySubsetType" name="assertArraySubset" minOccurs="0" maxOccurs="unbounded"/>
<xs:element type="assertContainsType" name="assertContains" minOccurs="0" maxOccurs="unbounded"/>
<xs:element type="assertStringContainsStringType" name="assertStringContainsString" minOccurs="0" maxOccurs="unbounded"/>
<xs:element type="assertStringContainsStringIgnoringCaseType" name="assertStringContainsStringIgnoringCase" minOccurs="0" maxOccurs="unbounded"/>
Expand All @@ -31,7 +30,6 @@
<xs:element type="assertGreaterThanType" name="assertGreaterThan" minOccurs="0" maxOccurs="unbounded"/>
<xs:element type="assertGreaterThanOrEqualType" name="assertGreaterThanOrEqual" minOccurs="0" maxOccurs="unbounded"/>
<xs:element type="assertInstanceOfType" name="assertInstanceOf" minOccurs="0" maxOccurs="unbounded"/>
<xs:element type="assertInternalTypeType" name="assertInternalType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element type="assertIsEmptyType" name="assertIsEmpty" minOccurs="0" maxOccurs="unbounded"/>
<xs:element type="assertLessOrEqualsType" name="assertLessOrEquals" minOccurs="0" maxOccurs="unbounded"/>
<xs:element type="assertLessThanType" name="assertLessThan" minOccurs="0" maxOccurs="unbounded"/>
Expand Down
11 changes: 0 additions & 11 deletions src/Magento/FunctionalTestingFramework/Util/TestGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,6 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato
case "assertGreaterOrEquals":
case "assertGreaterThan":
case "assertGreaterThanOrEqual":
case "assertInternalType":
case "assertLessOrEquals":
case "assertLessThan":
case "assertLessThanOrEqual":
Expand Down Expand Up @@ -1361,16 +1360,6 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato
$assertMessage
);
break;
case "assertArraySubset":
$testSteps .= $this->wrapFunctionCall(
$actor,
$actionObject,
$assertExpected,
$assertActual,
$assertIsStrict,
$assertMessage
);
break;
case "fail":
$testSteps .= $this->wrapFunctionCall(
$actor,
Expand Down