public function lockSiteOrExit() { touch($this->lockFlagPathAndFilename); $this->lockResource = fopen($this->lockPathAndFilename, 'w+'); if (!flock($this->lockResource, LOCK_EX | LOCK_NB)) { fclose($this->lockResource); $this->doExit(); } }
/** * @test */ public function lockSiteOrExitDoesNotExitIfSiteIsNotLocked() { $this->lockManager->expects($this->never())->method('doExit'); $this->lockManager->lockSiteOrExit(); }