Skip to content

Commit 2f97020

Browse files
author
Sergii Kovalenko
committed
MAGETWO-69521: Customer attribute with "Show on Storefront" set to No does not appear in backend
1 parent d752b1b commit 2f97020

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

app/code/Magento/Customer/Test/Unit/Model/Customer/DataProviderTest.php

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -425,11 +425,7 @@ protected function getAttributeMock($type = 'customer', $options = [])
425425

426426
$attributeMock->expects($this->any())
427427
->method('getDataUsingMethod')
428-
->willReturnCallback(
429-
function ($origName) {
430-
return $origName;
431-
}
432-
);
428+
->willReturnCallback($this->attributeGetUsingMethodCallback());
433429

434430
$attributeMock->expects($this->any())
435431
->method('usesSource')
@@ -460,11 +456,7 @@ function ($origName) {
460456
->willReturn('boolean');
461457
$attributeBooleanMock->expects($this->any())
462458
->method('getDataUsingMethod')
463-
->willReturnCallback(
464-
function ($origName) {
465-
return $origName;
466-
}
467-
);
459+
->willReturnCallback($this->attributeGetUsingMethodCallback());
468460

469461
$attributeBooleanMock->expects($this->once())
470462
->method('usesSource')
@@ -492,6 +484,18 @@ function ($origName) {
492484
return $mocks;
493485
}
494486

487+
/**
488+
* Callback for ::getDataUsingMethod
489+
*
490+
* @return \Closure
491+
*/
492+
private function attributeGetUsingMethodCallback()
493+
{
494+
return function ($origName) {
495+
return $origName;
496+
};
497+
}
498+
495499
private function getCountryAttrMock()
496500
{
497501
$countryByWebsiteMock = $this->getMockBuilder(CountryWithWebsites::class)

0 commit comments

Comments
 (0)