From 28dcb4ececfacedb36d9a8f2d61333d1fbba71b5 Mon Sep 17 00:00:00 2001 From: DSB Date: Tue, 14 Jun 2011 20:20:22 +0000 Subject: [PATCH] Added test: drop database --- .../controllers/SqlControllerTest.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/functional/controllers/SqlControllerTest.php b/tests/functional/controllers/SqlControllerTest.php index 9bd02a4..a4323e9 100644 --- a/tests/functional/controllers/SqlControllerTest.php +++ b/tests/functional/controllers/SqlControllerTest.php @@ -80,4 +80,22 @@ class Msd_Application_Controller_SqlControllerTest $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'); + } } \ No newline at end of file