Added test: create a database
Dieser Commit ist enthalten in:
Ursprung
6c0a5a0a2a
Commit
cc1e1f30b6
3 geänderte Dateien mit 21 neuen und 8 gelöschten Zeilen
|
@ -219,7 +219,6 @@ class SqlController extends Zend_Controller_Action
|
|||
}
|
||||
$this->view->dbCreated = $dbCreated;
|
||||
$this->view->errorInfo = $errorInfo;
|
||||
|
||||
}
|
||||
$this->view->newDbInfo = $newDbInfo;
|
||||
}
|
||||
|
|
|
@ -51,4 +51,25 @@ class Msd_Application_Controller_SqlControllerTest
|
|||
$expected = 'Datensätze der Tabelle `mysql`.`columns_priv`';
|
||||
$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`');
|
||||
}
|
||||
|
||||
}
|
|
@ -61,11 +61,4 @@ class Msd_LogTest extends PHPUnit_Framework_TestCase
|
|||
}
|
||||
unset($logger);
|
||||
}
|
||||
|
||||
public function testCanWriteToLogFile()
|
||||
{
|
||||
$res = Msd_Log::write(Msd_Log::PHP, 'test message');
|
||||
|
||||
print_r($res);
|
||||
}
|
||||
}
|
Laden …
In neuem Issue referenzieren