Neos\Flow\ResourceManagement\Streams\StreamWrapperAdapter::stream_seek PHP Метод

stream_seek() публичный Метод

This method is called in response to fseek(). The read/write position of the stream should be updated according to the offset and whence . $whence can one of: SEEK_SET - Set position equal to offset bytes. SEEK_CUR - Set position to current location plus offset. SEEK_END - Set position to end-of-file plus offset.
public stream_seek ( integer $offset, integer $whence = SEEK_SET ) : boolean
$offset integer The stream offset to seek to.
$whence integer
Результат boolean TRUE on success or FALSE on failure.
    public function stream_seek($offset, $whence = SEEK_SET)
    {
        return $this->streamWrapper->seek($offset, $whence);
    }

Usage Example

 /**
  * @test
  */
 public function stream_seekTest2()
 {
     $offset = 123;
     $whence = SEEK_END;
     $this->mockStreamWrapper->expects($this->once())->method('seek')->with($offset, $whence)->will($this->returnValue(true));
     $this->assertTrue($this->streamWrapperAdapter->stream_seek($offset, $whence));
 }