예제 #1
0
 public function testGetProcessFile()
 {
     $this->_processFile = $this->getMock('Mage_Index_Model_Process_File');
     $this->_prepareIndexProcess();
     // assert that process file is stored in process entity instance and isn't changed after several invocations
     // lock method is used as invocation of _getProcessFile
     for ($i = 1; $i <= 2; $i++) {
         $this->_indexProcess->lock();
         $this->assertAttributeEquals($this->_processFile, '_processFile', $this->_indexProcess);
     }
 }
예제 #2
0
 /**
  * Lock process without blocking.
  * This method allow protect multiple process runing and fast lock validation.
  *
  * @return Mage_Index_Model_Process
  */
 public function lock()
 {
     if (false === $this->getLockInstance()) {
         return parent::lock();
     }
     $this->getLockInstance()->lock();
     return $this;
 }