public function testStreamOpenRead() { $stream = new Stream(); $stream->context = stream_context_create(['gxsl' => ['transpiler' => new Transpiler(new TransformationContext(new DOMDocument('1.0', 'UTF-8'), new TransformerCollection(), new FunctionMap()))]]); $stream->stream_open('gxsl://#root'); $this->assertEquals('<?xml version="1.0" encoding="UTF-8"?>', trim($stream->stream_read(9999))); }
public function testStreamOpenWithoutContext() { $this->setExpectedException(StreamException::class); $stream = new Stream(); $stream->context = stream_context_create(); $stream->stream_open(Stream::PROTOCOL . Stream::HOST . Stream::ROOT); $this->assertEquals('<?xml version="1.0" encoding="UTF-8"?>', trim($stream->stream_read(9999))); }