示例#1
0
 public function testWriting()
 {
     $str = new StringStream('foobar');
     $this->assertTrue($str->isWritable());
     $str->seek(3);
     $this->assertEquals(4, $str->write('bazz'));
     $this->assertEquals('', $str->getContents());
     $this->assertEquals('foobazz', $str);
     $this->assertEquals(7, $str->getSize());
 }
示例#2
0
 /**
  * Test creating Stream
  */
 public function testStream()
 {
     $stream = new StringStream('test');
     $this->assertEquals('test', $stream->getContents());
     $this->assertEquals('test', (string) $stream);
 }