public function testUnlock() { $this->_processFile = $this->getMock('Mage_Index_Model_Process_File', array('processUnlock')); $this->_processFile->expects($this->once())->method('processUnlock'); $this->_prepareIndexProcess(); $result = $this->_indexProcess->unlock(); $this->assertEquals($this->_indexProcess, $result); }
public function testUnlockNoLock() { $this->mutex->expects($this->never())->method('getConnection')->will($this->returnValue($this->pdo)); $this->pdo->expects($this->never())->method('prepare'); // The stm should not be executed $this->stmtReleaseLock->expects($this->never())->method('execute'); $result = $this->mutex->unlock(); $this->assertEquals(false, $result); }
public function testUnlock() { $streamLock = $this->getMockBuilder('Magento\\Framework\\Filesystem\\File\\Write')->setMethods(array('unlock'))->disableOriginalConstructor()->getMock(); $this->_processFile = $this->getMock('Magento\\Index\\Model\\Process\\File', array('processUnlock', '__wakeup'), array($streamLock)); $this->_processFile->expects($this->once())->method('processUnlock'); $this->_prepareIndexProcess(); $result = $this->_indexProcess->unlock(); $this->assertEquals($this->_indexProcess, $result); }