Пример #1
0
 public function testIsProcessLockedFalseWithoutUnlock()
 {
     $this->_openFile();
     $this->assertFalse($this->_model->isProcessLocked(false));
     $this->assertFalse($this->_tryGetSharedLock(), 'File must be locked');
     $this->assertAttributeSame(true, '_streamLocked', $this->_model);
     $this->_model->processUnlock();
 }
Пример #2
0
 /**
  * @param array $eventData
  * @param bool $needLock
  *
  * @dataProvider safeProcessEventDataProvider
  */
 public function testSafeProcessEvent(array $eventData, $needLock = false)
 {
     if ($needLock) {
         $this->_processFile->processLock();
     }
     $event = $this->_objectManager->create('Magento\\Index\\Model\\Event', array('data' => $eventData));
     $this->assertEquals($this->_model, $this->_model->safeProcessEvent($event));
     if ($needLock) {
         $this->_processFile->processUnlock();
     }
     $this->assertFalse($this->_processFile->isProcessLocked(true));
 }