admin tweaks
This commit is contained in:
parent
358f191be2
commit
47bb844acc
@ -139,7 +139,7 @@ class AdminPage extends Extension {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function dump_database() {
|
private function database_dump() {
|
||||||
global $page;
|
global $page;
|
||||||
|
|
||||||
$matches = array();
|
$matches = array();
|
||||||
@ -150,11 +150,17 @@ class AdminPage extends Extension {
|
|||||||
$hostname = $matches['host'];
|
$hostname = $matches['host'];
|
||||||
$database = $matches['dbname'];
|
$database = $matches['dbname'];
|
||||||
|
|
||||||
// TODO: Support more than just MySQL..
|
|
||||||
switch($software) {
|
switch($software) {
|
||||||
case 'mysql':
|
case 'mysql':
|
||||||
$cmd = "mysqldump -h$hostname -u$username -p$password $database";
|
$cmd = "mysqldump -h$hostname -u$username -p$password $database";
|
||||||
break;
|
break;
|
||||||
|
case 'pgsql':
|
||||||
|
putenv("PGPASSWORD=$password");
|
||||||
|
$cmd = "pg_dump -h $hostname -U $username $database";
|
||||||
|
break;
|
||||||
|
case 'sqlite':
|
||||||
|
$cmd = "sqlite3 $database .dump";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$page->set_mode("data");
|
$page->set_mode("data");
|
||||||
|
@ -54,6 +54,27 @@ class AdminPageTest extends ShimmieWebTestCase {
|
|||||||
$this->get_page('admin');
|
$this->get_page('admin');
|
||||||
$this->assert_title("Admin Tools");
|
$this->assert_title("Admin Tools");
|
||||||
$this->click("Download database contents");
|
$this->click("Download database contents");
|
||||||
|
$this->assert_response(200);
|
||||||
|
$this->log_out();
|
||||||
|
}
|
||||||
|
|
||||||
|
function testDBQ() {
|
||||||
|
$this->log_in_as_user();
|
||||||
|
$image_id_1 = $this->post_image("ext/simpletest/data/pbx_screenshot.jpg", "test");
|
||||||
|
$image_id_2 = $this->post_image("ext/simpletest/data/bedroom_workshop.jpg", "test2");
|
||||||
|
$image_id_3 = $this->post_image("ext/simpletest/data/favicon.png", "test");
|
||||||
|
|
||||||
|
$this->get_page("post/list/test/1");
|
||||||
|
$this->click("Delete All These Images");
|
||||||
|
|
||||||
|
$this->get_page("post/view/$image_id_1");
|
||||||
|
$this->assert_response(404);
|
||||||
|
$this->get_page("post/view/$image_id_2");
|
||||||
|
$this->assert_response(200);
|
||||||
|
$this->get_page("post/view/$image_id_3");
|
||||||
|
$this->assert_response(404);
|
||||||
|
|
||||||
|
$this->delete_image($image_id_2);
|
||||||
$this->log_out();
|
$this->log_out();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user