Skip to content

Commit

Permalink
Merge branch 'MAGETWO-38563' of github.corp.ebay.com:magento-south/ma…
Browse files Browse the repository at this point in the history
…gento2ce into MAGETWO-38563
  • Loading branch information
slavvka committed Aug 5, 2015
2 parents c5128e7 + baae27b commit cbd1e2a
Showing 1 changed file with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class AttributeColumnTest extends \PHPUnit_Framework_TestCase
/** @var \Magento\Framework\View\Element\UiComponentFactory|\PHPUnit_Framework_MockObject_MockObject */
protected $uiComponentFactory;

/** @var CustomerMetadataInterface|\PHPUnit_Framework_MockObject_MockObject */
protected $customerMetadata;
/** @var \Magento\Customer\Ui\Component\Listing\AttributeRepository|\PHPUnit_Framework_MockObject_MockObject */
protected $attributeRepository;

/** @var \Magento\Customer\Api\Data\AttributeMetadataInterface|\PHPUnit_Framework_MockObject_MockObject */
protected $attributeMetadata;
Expand All @@ -43,14 +43,15 @@ public function setup()
'',
false
);
$this->customerMetadata = $this->getMockForAbstractClass(
'Magento\Customer\Api\CustomerMetadataInterface',
$this->attributeRepository = $this->getMock(
'Magento\Customer\Ui\Component\Listing\AttributeRepository',
[],
[],
'',
false
);
$this->attributeMetadata = $this->getMockForAbstractClass(
'Magento\Customer\Api\Data\AttributeMetadataInterface',
'\Magento\Customer\Api\Data\AttributeMetadataInterface',
[],
'',
false
Expand All @@ -65,7 +66,7 @@ public function setup()
$this->component = new AttributeColumn(
$this->context,
$this->uiComponentFactory,
$this->customerMetadata
$this->attributeRepository
);
$this->component->setData('name', 'gender');
}
Expand All @@ -77,9 +78,8 @@ public function testPrepareDataSourceWithoutItems()

]
];
$this->customerMetadata->expects($this->never())
->method('getAttributeMetadata')
->with('gender');
$this->attributeRepository->expects($this->never())
->method('getMetadataByCode');

$this->component->prepareDataSource($dataSource);
}
Expand Down Expand Up @@ -114,12 +114,11 @@ public function testPrepareDataSource()
]
];


$this->customerMetadata->expects($this->once())
->method('getAttributeMetadata')
$this->attributeRepository->expects($this->once())
->method('getMetadataByCode')
->with('gender')
->willReturn($this->attributeMetadata);
$this->attributeMetadata->expects($this->once())
$this->attributeMetadata->expects($this->atLeastOnce())
->method('getOptions')
->willReturn([$this->genderOption]);
$this->genderOption->expects($this->once())
Expand Down

0 comments on commit cbd1e2a

Please sign in to comment.