/** * @expectedException Exception */ public function testDatabaseDeleteWithNoDatabaseOption() { $couchdb = new CouchDB(); $couchdb->delete_database(); }
* * http://www.apache.org/licenses/LICENSE-2.0 * * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the License for the specific language governing permissions and * limitations under the License. * * Author: Adam Venturella - aventurella@gmail.com * * @package Sample * @author Adam Venturella <*****@*****.**> * @copyright Copyright (C) 2009 Adam Venturella * @license http://www.apache.org/licenses/LICENSE-2.0 Apache 2.0 * **/ /** * Sample */ require 'couchdb/CouchDB.php'; $newdb = 'newdb'; $options = array('database' => $newdb); $db = new CouchDB($options); // before we can delete be sure we have one creaed $db->create_database($newdb); // now delete it $db->delete_database($newdb); // OR if the 'database' key was specified in the options, // and you wish to delete that database, you can call delete_database // with no arguments. //$db->create_database();