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()); }
/** * Test creating Stream */ public function testStream() { $stream = new StringStream('test'); $this->assertEquals('test', $stream->getContents()); $this->assertEquals('test', (string) $stream); }