Пример #1
0
 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);
 }
Пример #2
0
 private function init()
 {
     if (!$this->isInitialized()) {
         $this->stream = Stream::fromPath($this->path);
     }
     return $this->stream;
 }