/**
  * Tests the building of a file
  */
 public function testBuildFile()
 {
     $data = json_decode($this->fileFixture, true);
     $file = ContentBuilder::buildFile($data);
     $this->assertInstanceOf('Ideneal\\OpenLoad\\Entity\\File', $file);
 }
Beispiel #2
0
 /**
  * Returns the files within a folder
  *
  * @param string|Folder $folder The folder id
  *
  * @return File[]
  */
 public function getFiles($folder = null)
 {
     $params = $this->getAuthParams();
     if ($folder) {
         $params['folder'] = (string) $folder;
     }
     $response = $this->processRequest('file/listfolder', $params);
     $results = $this->processResponse($response);
     $contents = [];
     foreach ($results['files'] as $result) {
         $contents[] = ContentBuilder::buildFile($result);
     }
     return $contents;
 }