21 $this->objectManager = $this->createMock(\
Magento\Framework\ObjectManagerInterface::class);
22 $this->objectManagerHelper =
new ObjectManagerHelper($this);
27 $notifier1 = $this->objectManagerHelper->getObject(\
Magento\Framework\Notification\NotifierPool::class);
28 $notifier2 = $this->objectManagerHelper->getObject(\
Magento\Framework\Notification\NotifierPool::class);
29 $notifierList = $this->objectManagerHelper->getObject(
30 \
Magento\Framework\Notification\NotifierList::class,
32 'objectManager' => $this->objectManager,
33 'notifiers' => [$notifier1, $notifier2]
36 $this->expectException(
'InvalidArgumentException');
37 $result = $notifierList->asArray();
38 foreach (
$result as $notifier) {
39 $this->assertInstanceOf(\
Magento\Framework\Notification\NotifierInterface::class, $notifier);
45 $notifierCorrect = $this->objectManagerHelper->getObject(\
Magento\Framework\Notification\NotifierPool::class);
46 $notifierIncorrect = $this->objectManagerHelper->getObject(\
Magento\Framework\Notification\NotifierList::class);
47 $notifierList = $this->objectManagerHelper->getObject(
48 \
Magento\Framework\Notification\NotifierList::class,
50 'objectManager' => $this->objectManager,
51 'notifiers' => [$notifierCorrect, $notifierIncorrect]
54 $this->expectException(
'InvalidArgumentException');
55 $notifierList->asArray();