Exemple #1
0
 public function testGetMetadataAsObject()
 {
     $this->client->disableAssociativeArrays();
     $ds = new SodaDataset($this->client, $this->id);
     $md = $ds->getMetadata();
     $this->assertInstanceOf("stdClass", $md);
     $this->assertNotNull($md->createdAt);
 }
Exemple #2
0
 /**
  * Interact with an individual row. Either to retrieve it or to delete it; both actions use the same API endpoint
  * with the exception of what type of request is sent.
  *
  * @param  string $rowID  The 4x4 resource ID of the dataset to work with
  * @param  string $method Either `get` or `delete`
  *
  * @return mixed
  */
 private function individualRow($rowID, $method)
 {
     $headers = array();
     // For a single row, the format is the `resourceID/rowID.json`, so we'll use that as the "location" of the Api URL
     $apiEndPoint = $this->buildApiUrl("resource", $this->resourceId . "/" . $rowID);
     $urlQuery = new UrlQuery($apiEndPoint, $this->sodaClient->getToken(), $this->sodaClient->getEmail(), $this->sodaClient->getPassword());
     $urlQuery->setOAuth2Token($this->sodaClient->getOAuth2Token());
     $result = $this->sendIndividualRequest($urlQuery, $method, $this->sodaClient->associativeArrayEnabled(), $headers);
     $this->setApiVersion($headers);
     return $result;
 }
Exemple #3
0
 public function testPassword()
 {
     $password = "******";
     $sc = new SodaClient($this->domain, "", "", $password);
     $this->assertEquals($password, $sc->getPassword());
 }