1
0
Fork 0

Added test: create a database

Dieser Commit ist enthalten in:
DSB 2011-06-14 20:02:42 +00:00
Ursprung 6c0a5a0a2a
Commit cc1e1f30b6
3 geänderte Dateien mit 21 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -219,7 +219,6 @@ class SqlController extends Zend_Controller_Action
} }
$this->view->dbCreated = $dbCreated; $this->view->dbCreated = $dbCreated;
$this->view->errorInfo = $errorInfo; $this->view->errorInfo = $errorInfo;
} }
$this->view->newDbInfo = $newDbInfo; $this->view->newDbInfo = $newDbInfo;
} }

Datei anzeigen

@ -51,4 +51,25 @@ class Msd_Application_Controller_SqlControllerTest
$expected = 'Datensätze der Tabelle `mysql`.`columns_priv`'; $expected = 'Datensätze der Tabelle `mysql`.`columns_priv`';
$this->assertQueryContentContains('h2', $expected); $this->assertQueryContentContains('h2', $expected);
} }
public function testCanCreateADatabase()
{
$this->loginUser();
//drop our testDb if it exists
$db = Msd_Db::getAdapter();
$db->query('DROP DATABASE IF EXISTS `testDb`');
$this->request->setMethod('POST');
$newDbInfo = array(
'dbName' => 'testDb',
'dbCharset' => 'utf8',
'dbCollation' => 'utf8_general_ci'
);
$this->request->setPost('newDbInfo', $newDbInfo);
$this->dispatch('sql/create.database');
$expected = 'Die Datenbank \'testDb\' wurde erfolgreich erstellt.';
$this->assertQueryContentContains('div', $expected);
// clean up
$db->query('DROP DATABASE IF EXISTS `testDb`');
}
} }

Datei anzeigen

@ -61,11 +61,4 @@ class Msd_LogTest extends PHPUnit_Framework_TestCase
} }
unset($logger); unset($logger);
} }
public function testCanWriteToLogFile()
{
$res = Msd_Log::write(Msd_Log::PHP, 'test message');
print_r($res);
}
} }