public function testFromPath() { file_put_contents($path = tempnam(sys_get_temp_dir(), 'whatever'), 'foo'); $stream = Stream::fromPath($path); $this->assertInstanceOf(Stream::class, $stream); $this->assertSame('foo', (string) $stream); }
private function init() { if (!$this->isInitialized()) { $this->stream = Stream::fromPath($this->path); } return $this->stream; }