コード例 #1
0
 /**
  * Method to test tell().
  *
  * @return void
  *
  * @covers \Windwalker\Http\Stream::tell
  */
 public function testTell()
 {
     $this->createTempFile();
     file_put_contents($this->tmpnam, 'FOO BAR');
     $resource = fopen($this->tmpnam, Stream::MODE_READ_WRITE_RESET);
     $stream = new Stream($resource);
     fseek($resource, 2);
     $this->assertEquals(2, $stream->tell());
     $stream->detach();
     $this->assertExpectedException(function () use($stream) {
         $stream->tell();
     }, new \RuntimeException());
 }