Ejemplo n.º 1
0
 public function testFireEventParameters()
 {
     $paramOne = 123;
     $paramTwo = 456;
     $this->_subscriberOne->expects($this->once())->method('testEvent')->with($paramOne, $paramTwo);
     $this->_subscriberTwo->expects($this->once())->method('testEvent')->with($paramOne, $paramTwo);
     $this->_eventManager->fireEvent('testEvent', array($paramOne, $paramTwo));
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function endTest(\PHPUnit_Framework_Test $test, $time)
 {
     if (!$test instanceof \PHPUnit_Framework_TestCase || $test instanceof \PHPUnit_Framework_Warning) {
         return;
     }
     $this->_eventManager->fireEvent('endTest', [$test], true);
 }
Ejemplo n.º 3
0
 /**
  * Rollback transaction and fire 'rollbackTransaction' event
  */
 protected function _rollbackTransaction()
 {
     if ($this->_isTransactionActive) {
         $this->_getAdapter()->rollbackTransparentTransaction();
         $this->_isTransactionActive = false;
         $this->_eventManager->fireEvent('rollbackTransaction');
     }
 }
Ejemplo n.º 4
0
 public function testInitStoreAfter()
 {
     $this->_eventManager->expects($this->once())->method('fireEvent')->with('initStoreAfter');
     $this->_object->execute($this->getMock('\\Magento\\Framework\\Event\\Observer'));
 }
 public function testEndTestSuiteDoNothing()
 {
     $this->_eventManager->expects($this->never())->method('fireEvent');
     $this->_adapter->expects($this->never())->method($this->anything());
     $this->_object->endTestSuite();
 }
Ejemplo n.º 6
0
 public function testInitStoreAfter()
 {
     $this->_eventManager->expects($this->once())->method('fireEvent')->with('initStoreAfter');
     $this->_object->initStoreAfter();
 }
Ejemplo n.º 7
0
 /**
  * Handler for 'core_app_init_current_store_after' event, that converts it into 'initStoreAfter'
  */
 public function initStoreAfter()
 {
     $this->_eventManager->fireEvent('initStoreAfter');
 }
Ejemplo n.º 8
0
 /**
  * Handler for 'core_app_init_current_store_after' event, that converts it into 'initStoreAfter'
  * @param \Magento\Framework\Event\Observer $observer
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function execute(\Magento\Framework\Event\Observer $observer)
 {
     $this->_eventManager->fireEvent('initStoreAfter');
 }
Ejemplo n.º 9
0
 public function testEndTestDoNotFireEvent()
 {
     $this->_eventManager->expects($this->never())->method('fireEvent');
     $this->_object->endTest(new \PHPUnit_Framework_Warning(), 0);
     $this->_object->endTest($this->getMock('PHPUnit_Framework_Test'), 0);
 }