コード例 #1
0
ファイル: ProcessTest.php プロジェクト: nickimproove/magento2
 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);
 }
コード例 #2
0
ファイル: MySQLTest.php プロジェクト: phlib/mutex
 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);
 }
コード例 #3
0
 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);
 }