Ejemplo n.º 1
0
 /**
  * @param \Magento\Framework\Event\ObserverInterface $object
  * @param Observer $observer
  * @return $this
  * @throws \LogicException
  */
 protected function _callObserverMethod($object, $observer)
 {
     if ($object instanceof \Magento\Framework\Event\ObserverInterface) {
         $object->execute($observer);
     } elseif ($this->_appState->getMode() == \Magento\Framework\App\State::MODE_DEVELOPER) {
         throw new \LogicException(sprintf('Observer "%s" must implement interface "%s"', get_class($object), 'Magento\\Framework\\Event\\ObserverInterface'));
     }
     return $this;
 }
 public function testGridsReindex()
 {
     $this->eventObserverMock->expects($this->once())->method('getOrderId')->willReturn(100500);
     $this->gridPoolMock->expects($this->once())->method('refreshByOrderId')->with(100500);
     $this->assertNull($this->observer->execute($this->eventObserverMock));
 }