Exemple #1
0
 /**
  * @dataProvider isLockedDataProvider
  * @param bool $needUnlock
  */
 public function testIsLocked($needUnlock)
 {
     $streamLock = $this->getMockBuilder('Magento\\Framework\\Filesystem\\File\\Write')->setMethods(array('unlock'))->disableOriginalConstructor()->getMock();
     $this->_processFile = $this->getMock('Magento\\Index\\Model\\Process\\File', array('isProcessLocked', '__wakeup'), array($streamLock));
     $this->_processFile->expects($this->once())->method('isProcessLocked')->with($needUnlock)->will($this->returnArgument(0));
     $this->_prepareIndexProcess();
     $this->assertEquals($needUnlock, $this->_indexProcess->isLocked($needUnlock));
 }