Skip to content

Commit cbd1e2a

Browse files
committed
Merge branch 'MAGETWO-38563' of github.corp.ebay.com:magento-south/magento2ce into MAGETWO-38563
2 parents c5128e7 + baae27b commit cbd1e2a

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

app/code/Magento/Customer/Test/Unit/Ui/Component/Listing/Column/AttributeColumnTest.php

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class AttributeColumnTest extends \PHPUnit_Framework_TestCase
1919
/** @var \Magento\Framework\View\Element\UiComponentFactory|\PHPUnit_Framework_MockObject_MockObject */
2020
protected $uiComponentFactory;
2121

22-
/** @var CustomerMetadataInterface|\PHPUnit_Framework_MockObject_MockObject */
23-
protected $customerMetadata;
22+
/** @var \Magento\Customer\Ui\Component\Listing\AttributeRepository|\PHPUnit_Framework_MockObject_MockObject */
23+
protected $attributeRepository;
2424

2525
/** @var \Magento\Customer\Api\Data\AttributeMetadataInterface|\PHPUnit_Framework_MockObject_MockObject */
2626
protected $attributeMetadata;
@@ -43,14 +43,15 @@ public function setup()
4343
'',
4444
false
4545
);
46-
$this->customerMetadata = $this->getMockForAbstractClass(
47-
'Magento\Customer\Api\CustomerMetadataInterface',
46+
$this->attributeRepository = $this->getMock(
47+
'Magento\Customer\Ui\Component\Listing\AttributeRepository',
48+
[],
4849
[],
4950
'',
5051
false
5152
);
5253
$this->attributeMetadata = $this->getMockForAbstractClass(
53-
'Magento\Customer\Api\Data\AttributeMetadataInterface',
54+
'\Magento\Customer\Api\Data\AttributeMetadataInterface',
5455
[],
5556
'',
5657
false
@@ -65,7 +66,7 @@ public function setup()
6566
$this->component = new AttributeColumn(
6667
$this->context,
6768
$this->uiComponentFactory,
68-
$this->customerMetadata
69+
$this->attributeRepository
6970
);
7071
$this->component->setData('name', 'gender');
7172
}
@@ -77,9 +78,8 @@ public function testPrepareDataSourceWithoutItems()
7778

7879
]
7980
];
80-
$this->customerMetadata->expects($this->never())
81-
->method('getAttributeMetadata')
82-
->with('gender');
81+
$this->attributeRepository->expects($this->never())
82+
->method('getMetadataByCode');
8383

8484
$this->component->prepareDataSource($dataSource);
8585
}
@@ -114,12 +114,11 @@ public function testPrepareDataSource()
114114
]
115115
];
116116

117-
118-
$this->customerMetadata->expects($this->once())
119-
->method('getAttributeMetadata')
117+
$this->attributeRepository->expects($this->once())
118+
->method('getMetadataByCode')
120119
->with('gender')
121120
->willReturn($this->attributeMetadata);
122-
$this->attributeMetadata->expects($this->once())
121+
$this->attributeMetadata->expects($this->atLeastOnce())
123122
->method('getOptions')
124123
->willReturn([$this->genderOption]);
125124
$this->genderOption->expects($this->once())

0 commit comments

Comments
 (0)