/** * @covers Imbo\Storage\Filesystem::getImage */ public function testGetImage() { vfsStream::setup('basedir'); $driver = new Filesystem(['dataDir' => vfsStream::url('basedir')]); $root = vfsStreamWrapper::getRoot(); $last = $root; $parts = [$this->user[0], $this->user[1], $this->user[2], $this->user, $this->imageIdentifier[0], $this->imageIdentifier[1], $this->imageIdentifier[2]]; foreach ($parts as $part) { $d = vfsStream::newDirectory($part); $last->addChild($d); $last = $d; } $content = 'some binary content'; $file = vfsStream::newFile($this->imageIdentifier); $file->setContent($content); $last->addChild($file); $this->assertSame($content, $driver->getImage($this->user, $this->imageIdentifier)); }