protected function setUp() { $this->_eventManager = $this->getMock('Magento\\TestFramework\\EventManager', ['fireEvent'], [[]]); $this->_adapter = $this->getMock('\\Magento\\TestFramework\\Db\\Adapter\\Mysql', ['beginTransaction', 'rollBack'], [], '', false); $this->_object = $this->getMock('Magento\\TestFramework\\Event\\Transaction', ['_getConnection'], [$this->_eventManager]); $this->_object->expects($this->any())->method('_getConnection')->will($this->returnValue($this->_adapter)); }
protected function setUp() { $this->_eventManager = $this->getMock('Magento\\TestFramework\\EventManager', ['fireEvent'], [[]]); $this->_adapter = $this->getMock('Magento\\TestFramework\\Db\\Adapter\\TransactionInterface', ['beginTransparentTransaction', 'commitTransparentTransaction', 'rollbackTransparentTransaction']); $this->_object = $this->getMock('Magento\\TestFramework\\Event\\Transaction', ['_getAdapter'], [$this->_eventManager]); $this->_object->expects($this->any())->method('_getAdapter')->will($this->returnValue($this->_adapter)); }