public stream_lock ( integer $operation ) : boolean | ||
$operation | integer | One of the LOCK_* constants |
return | boolean | TRUE on success or FALSE on failure. |
public function stream_lock($operation)
{
if ($operation === LOCK_UN) {
return $this->streamWrapper->unlock();
} else {
return $this->streamWrapper->lock($operation);
}
}
/** * @test */ public function stream_unlockTest() { $operation = LOCK_UN; $this->mockStreamWrapper->expects($this->once())->method('unlock')->will($this->returnValue(true)); $this->assertTrue($this->streamWrapperAdapter->stream_lock($operation)); }