22 $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
24 $notificationList = $this->createPartialMock(
26 [
'getSize',
'setCurPage',
'setPageSize']
28 $notificationList->expects($this->any())->method(
'getSize')->will($this->returnValue($unreadNotifications));
30 $block = $objectManagerHelper->getObject(
31 \
Magento\AdminNotification\Block\ToolbarEntry::class,
32 [
'notificationList' => $notificationList]
40 $notificationsCount = 100;
42 $this->assertEquals($notificationsCount,
$block->getUnreadNotificationCount());
45 public function testGetLatestUnreadNotifications()
47 $helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
50 $notificationList = $this->getMockBuilder(
53 ->disableOriginalConstructor()
58 \
Magento\AdminNotification\Block\ToolbarEntry::class,
59 [
'notificationList' => $notificationList]
63 $notificationList->expects($this->atLeastOnce())
64 ->method(
'setPageSize')
65 ->with(\
Magento\AdminNotification\Block\ToolbarEntry::NOTIFICATIONS_NUMBER)
66 ->will($this->returnSelf());
72 $this->assertEquals($notificationList,
$result);
testGetUnreadNotificationCount()
_getBlockInstance($unreadNotifications)