added some tiny tests

This commit is contained in:
César D. Rodas
2013-11-12 14:33:37 -03:00
parent a953393d15
commit 5f96d8bc48
4 changed files with 59 additions and 2 deletions
+2 -2
View File
@@ -70,7 +70,7 @@ class BaseHTTP
//$type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
curl_close($ch);
if ($status[0] != 2) {
throw new \Exception($response);
throw new \RuntimeException($response);
}
return $json ? json_decode($response, true) : $response;
}
@@ -85,7 +85,7 @@ class BaseHTTP
return $this->execCurl($ch);
}
protected function get($url, Array $args)
protected function get($url, Array $args = [])
{
$ch = $this->getCurl($url, $args);
return $this->execCurl($ch, true);
+10
View File
@@ -50,6 +50,16 @@ class DB extends BaseHTTP
$this->base = "db/$name/";
}
public function getName()
{
return $this->name;
}
public function drop()
{
return $this->client->deleteDatabase($this->name);
}
public function insert($name, Array $data)
{
$points = [];