Exemplo n.º 1
0
 public function setUp()
 {
     $data = ['name' => 'ObserverName', 'block' => 'testBlockName'];
     $this->event = new Event($data);
     $this->observers = new Collection();
     $this->observer = new Observer($data);
     $this->observers->addObserver($this->observer);
 }
 public function testDispatch()
 {
     $eventMock = $this->getMock('Magento\\Framework\\Event', [], [], '', false);
     $observer1 = $this->getObserverMock('test_observer1', $eventMock);
     $observer2 = $this->getObserverMock('test_observer2', $eventMock);
     $this->observerCollection->addObserver($observer1);
     $this->observerCollection->addObserver($observer2);
     $this->observerCollection->dispatch($eventMock);
 }