public function testGetResource() { $stream = new Stream(false); $this->assertNull($stream->getResource()); // $resource = fopen('php://memory', 'w+b'); $stream->setResource($resource); $this->assertSame($resource, $stream->getResource()); }
public function testGetMetadataReturnsValueOfSpecifiedKey() { $stream = new Stream(); $resource = $stream->getResource(); $metadata = stream_get_meta_data($resource); $this->assertEquals($metadata['uri'], $stream->getMetadata('uri')); $this->assertEquals($metadata['mode'], $stream->getMetadata('mode')); $this->assertEquals($metadata['seekable'], $stream->getMetadata('seekable')); }