Beispiel #1
0
 /**
  * Get signatures informations
  * 
  * @param RestoUser $_user
  * @return array
  */
 private function getSignatures($_user)
 {
     $_collections = new RestoCollections($this->context, $_user, array('autoload' => true));
     $_collectionsList = $_collections->getCollections();
     $signatures = array();
     foreach ($_collectionsList as $collection) {
         $signatures[$collection->name] = array('isApplicableToUser' => $collection->license->isApplicableToUser($_user), 'hasToBeSignedByUser' => $collection->license->hasToBeSignedByUser($_user));
     }
     return $signatures;
 }
Beispiel #2
0
 /**
  * @depends testInsertResource
  * 
  */
 public function testGetCollections()
 {
     $this->initContext();
     $collections = new RestoCollections($this->context, $this->admin, array('autoload' => true));
     $this->assertEquals('Example', $collections->getCollection('Example')->name);
     $colls = $collections->getCollections();
     $this->assertEquals('Example', $colls['Example']->name);
     $stats = $collections->getStatistics();
     $json = json_decode($collections->toJSON(false));
     $this->assertEquals('*', $json->synthesis->name);
     /*
      * TODO :   check for toXML function
      */
     $xml = $collections->toXML();
     /*
      * TODO :  chek feature collection
      */
     $featureCollection = $collections->search();
     $data = file_get_contents(dirname(__FILE__) . "/../data/Land.json");
     $data = json_decode($data, true);
     $this->assertEquals(true, $collections->create($data));
     $collections->remove('Land');
 }