Skip to content

Commit a706a46

Browse files
committed
MAGETWO-37464: Merge and Fix Builds
- Update integration test assertion since common fixture was updated
1 parent c1557e0 commit a706a46

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

dev/tests/integration/testsuite/Magento/Customer/Model/CustomerMetadataTest.php

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -75,25 +75,16 @@ public function testGetNestedOptionsCustomAttributesMetadata()
7575
public function testGetCustomAttributesMetadataWithAttributeNamedCustomAttribute()
7676
{
7777
$customAttributesMetadata = $this->_service->getCustomAttributesMetadata();
78-
$customAttributeCodeOne = 'custom_attribute1';
79-
$customAttributeFound = false;
80-
$customAttributeCodeTwo = 'custom_attribute2';
81-
$customAttributesFound = false;
78+
$expectedCustomAttributeCodeArray = ['custom_attribute1', 'custom_attribute2', 'customer_image'];
79+
$actual = [];
8280
foreach ($customAttributesMetadata as $attribute) {
83-
if ($attribute->getAttributeCode() == $customAttributeCodeOne) {
84-
$customAttributeFound = true;
85-
}
86-
if ($attribute->getAttributeCode() == $customAttributeCodeTwo) {
87-
$customAttributesFound = true;
88-
}
89-
}
90-
if (!$customAttributeFound) {
91-
$this->fail("Custom attribute declared in the config not found.");
81+
$actual[] = $attribute->getAttributeCode();
9282
}
93-
if (!$customAttributesFound) {
94-
$this->fail("Custom attributes declared in the config not found.");
95-
}
96-
$this->assertCount(3, $customAttributesMetadata, "Invalid number of attributes returned.");
83+
$this->assertEquals(
84+
$expectedCustomAttributeCodeArray,
85+
array_intersect($expectedCustomAttributeCodeArray, $actual),
86+
"Expected attributes not returned from the service."
87+
);
9788
}
9889

9990
/**

0 commit comments

Comments
 (0)