* @throws StorageAuthException
*/
public function getCachedTokenId() {
- if ( !isset($this->params['cachedToken']) ) {
+ if (!isset($this->params['cachedToken'])) {
throw new StorageAuthException('Unauthenticated ObjectStore connection');
}
// Is it V2 token?
- if ( isset($this->params['cachedToken']['token']) ) {
+ if (isset($this->params['cachedToken']['token'])) {
return $this->params['cachedToken']['token']['id'];
}
}
public function getDirectoryContent($directory): \Traversable {
- return $this->getWrapperStorage()->getDirectoryContent($this->getJailedPath($directory));
+ return $this->getWrapperStorage()->getDirectoryContent($this->getUnjailedPath($directory));
}
}
}
$this->assertEquals([$directory], $content);
+ $content = iterator_to_array($this->instance->getDirectoryContent('/'));
+
+ $this->assertCount(1, $content);
+ $dirEntry = $content[0];
+ unset($dirEntry['scan_permissions']);
+ unset($dirEntry['etag']);
+ $this->assertEquals([
+ 'name' => $directory,
+ 'mimetype' => $this->instance->getMimeType($directory),
+ 'mtime' => $this->instance->filemtime($directory),
+ 'size' => -1,
+ 'storage_mtime' => $this->instance->filemtime($directory),
+ 'permissions' => $this->instance->getPermissions($directory),
+ ], $dirEntry);
+
$this->assertFalse($this->instance->mkdir('/' . $directory)); //can't create existing folders
$this->assertTrue($this->instance->rmdir('/' . $directory));