From 3794a89f54f2215928fcec26dcd44004d29ab92e Mon Sep 17 00:00:00 2001 From: DSB Date: Tue, 14 Jun 2011 20:06:41 +0000 Subject: [PATCH] Added fail test: create a database --- tests/functional/controllers/SqlControllerTest.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/functional/controllers/SqlControllerTest.php b/tests/functional/controllers/SqlControllerTest.php index 924722c..9bd02a4 100644 --- a/tests/functional/controllers/SqlControllerTest.php +++ b/tests/functional/controllers/SqlControllerTest.php @@ -68,6 +68,14 @@ class Msd_Application_Controller_SqlControllerTest $this->dispatch('sql/create.database'); $expected = 'Die Datenbank \'testDb\' wurde erfolgreich erstellt.'; $this->assertQueryContentContains('div', $expected); + + // retry to create the same database - should fail ;) + $this->request->setPost('newDbInfo', $newDbInfo); + $this->dispatch('sql/create.database'); + $expected = 'Die Datenbank wurde nicht erstellt.'; + $this->assertQueryContentContains('div', $expected); + + // clean up $db->query('DROP DATABASE IF EXISTS `testDb`'); }