9 use PHPUnit_Framework_MockObject_MockObject as MockObject;
20 private $objectManagerHelper;
25 private $collectionMock;
30 private $urlBuilderMock;
44 $this->collectionMock = $this->getMockBuilder(Collection::class)
45 ->disableOriginalConstructor()
47 $this->urlBuilderMock = $this->getMockBuilder(UrlInterface::class)
48 ->getMockForAbstractClass();
51 $this->collectionMock,
63 $this->collectionMock->expects($this->once())
64 ->method(
'setWithoutAssignedCategoryFilter')
66 $this->collectionMock->expects($this->once())
69 $this->assertEquals($expected, $this->model->isDisplayed());
74 $this->assertEquals($this->model->getIdentity(),
'empty_assigned_group_category');
79 $groupMock1 = $this->getGroupMock(1,
'groupName1');
80 $groupMock2 = $this->getGroupMock(2,
'groupName2');
82 $this->collectionMock->expects($this->once())
83 ->method(
'setWithoutAssignedCategoryFilter')
85 $this->collectionMock->expects($this->once())
87 ->willReturn([$groupMock1, $groupMock2]);
88 $this->urlBuilderMock->expects($this->exactly(2))
91 [
'adminhtml/system_store/editGroup', [
'group_id' => 1]],
92 [
'adminhtml/system_store/editGroup', [
'group_id' => 2]]
94 ->willReturnOnConsecutiveCalls(
100 'The following stores are not associated with a root category: <a href="http://url1.com">groupName1</a>, ' 101 .
'<a href="http://url2.com">groupName2</a>. For the store to be displayed in the storefront, ' 102 .
'it must be associated with a root category.',
103 $this->model->getText()->getText()
114 private function getGroupMock(
$id,
$name)
116 $groupMock = $this->getMockBuilder(Group::class)
117 ->disableOriginalConstructor()
119 $groupMock->expects($this->once())
122 $groupMock->expects($this->once())
131 $this->assertEquals($this->model->getSeverity(), 2);
isDisplayedDataProvider()
testIsDisplayed($expected, array $items)
if(!isset($_GET['name'])) $name