1
0
Fork 0

Added test: drop database

Dieser Commit ist enthalten in:
DSB 2011-06-14 20:20:22 +00:00
Ursprung ab712faeff
Commit 28dcb4ecec

Datei anzeigen

@ -80,4 +80,22 @@ class Msd_Application_Controller_SqlControllerTest
$db->query('DROP DATABASE IF EXISTS `testDb`'); $db->query('DROP DATABASE IF EXISTS `testDb`');
} }
public function testCanDropADatabase()
{
$this->loginUser();
//create our testDb if it exists
$db = Msd_Db::getAdapter();
$sql = 'CREATE DATABASE `testDb` DEFAULT CHARSET utf8 DEFAULT COLLATE utf8_general_ci';
$db->query($sql);
// now let's see if we can drop it
$this->request->setMethod('POST');
$this->request->setPost('dbNames', array(base64_encode('testDb')));
$this->dispatch('sql/drop.database');
// check action output
$this->assertQueryContentContains('h4', 'Aktion - Datenbank löschen:');
$this->assertQueryContentContains('td', 'testDb');
$this->assertQueryContentContains('td', 'DROP DATABASE `testDb`;');
// look for the "ok" icon
$this->assertQueryContentContains('td', '/css/msd/icons/16x16/Apply.png');
}
} }