/** * Tests Sopha_Http_Request::get() */ public function testGet() { // TODO Auto-generated Sopha_Http_RequestTest::testGet() $this->markTestIncomplete("get test not implemented"); Sopha_Http_Request::get(); }
/** * Get list of all databases on a host * * @param string $host * @param integer $port * @return array */ public static function getAllDbs($host = 'localhost', $port = self::COUCH_PORT) { $url = self::makeUrl($host, $port, '_all_dbs'); $response = Sopha_Http_Request::get($url); if (!$response->isSuccess()) { require_once 'Sopha/Db/Exception.php'; throw new Sopha_Db_Exception("Unexpected response from server: {$response->getStatus()}", $response->getStatus()); } return $response->getDocument(); }
/** * Test that we can properly delete a */ public function testDeleteDb() { if (!$this->_url) { $this->markTestSkipped("Test requires a CouchDb server set up - see TestConfiguration.php"); } list($host, $port, $dbname) = $this->_getUrlParts(); $dbname = trim($dbname, '/'); $res = Sopha_Db::deleteDb($dbname, $host, $port); $this->assertTrue($res); // Make sure the DB no longer exists $response = Sopha_Http_Request::get($this->_url); $this->assertEquals(404, $response->getStatus()); }