Skip to content

Commit 0b38bcb

Browse files
author
Alexander Paliarush
committed
MAGETWO-31937: Exclude Extended Attributes from Custom Attributes List
- Fixed integration tests
1 parent 1205cca commit 0b38bcb

File tree

2 files changed

+4
-26
lines changed

2 files changed

+4
-26
lines changed

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

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,7 @@ protected function setUp()
3131
public function testGetCustomAttributesMetadata()
3232
{
3333
$customAttributesMetadata = $this->_service->getCustomAttributesMetadata();
34-
$this->assertCount(2, $customAttributesMetadata, "Invalid number of attributes returned.");
35-
$configAttributeCode = 'address_attribute_1';
36-
$configAttributeFound = false;
37-
foreach ($customAttributesMetadata as $attribute) {
38-
if ($attribute->getAttributeCode() == $configAttributeCode) {
39-
$configAttributeFound = true;
40-
break;
41-
}
42-
}
43-
if (!$configAttributeFound) {
44-
$this->fail("Custom attribute declared in the config not found.");
45-
}
34+
$this->assertCount(0, $customAttributesMetadata, "Invalid number of attributes returned.");
4635
}
4736

4837
/**
@@ -69,7 +58,7 @@ public function testGetCustomAttributesMetadataWithAttributeNamedCustomAttribute
6958
if (!$customAttributesFound) {
7059
$this->fail("Custom attributes declared in the config not found.");
7160
}
72-
$this->assertCount(4, $customAttributesMetadata, "Invalid number of attributes returned.");
61+
$this->assertCount(2, $customAttributesMetadata, "Invalid number of attributes returned.");
7362
}
7463

7564
public function testGetAddressAttributeMetadata()

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

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,7 @@ protected function setUp()
4747
public function testGetCustomAttributesMetadata()
4848
{
4949
$customAttributesMetadata = $this->_service->getCustomAttributesMetadata();
50-
$this->assertCount(3, $customAttributesMetadata, "Invalid number of attributes returned.");
51-
$configAttributeCode = 'customer_attribute_1';
52-
$configAttributeFound = false;
53-
foreach ($customAttributesMetadata as $attribute) {
54-
if ($attribute->getAttributeCode() == $configAttributeCode) {
55-
$configAttributeFound = true;
56-
break;
57-
}
58-
}
59-
if (!$configAttributeFound) {
60-
$this->fail("Custom attribute declared in the config not found.");
61-
}
50+
$this->assertCount(1, $customAttributesMetadata, "Invalid number of attributes returned.");
6251
}
6352

6453
public function testGetNestedOptionsCustomAttributesMetadata()
@@ -104,7 +93,7 @@ public function testGetCustomAttributesMetadataWithAttributeNamedCustomAttribute
10493
if (!$customAttributesFound) {
10594
$this->fail("Custom attributes declared in the config not found.");
10695
}
107-
$this->assertCount(5, $customAttributesMetadata, "Invalid number of attributes returned.");
96+
$this->assertCount(3, $customAttributesMetadata, "Invalid number of attributes returned.");
10897
}
10998

11099
/**

0 commit comments

Comments
 (0)