diff options
author | Andy Staudacher <andy.st@gmail.com> | 2009-11-15 19:44:47 -0800 |
---|---|---|
committer | Andy Staudacher <andy.st@gmail.com> | 2009-11-15 19:44:47 -0800 |
commit | 0733dc37fda27a5ba35f9020edf3c66aa41a95a0 (patch) | |
tree | 6877946232f1b01b1c8709054c689f6658cef34f /modules/gallery/tests/Database_Test.php | |
parent | 218493c50be9362d4abed6900a816308fee5d978 (diff) | |
parent | 9379308f91a476f790fb8d444536719535c584e4 (diff) |
Merge commit 'upstream/master'
Conflicts:
modules/gallery/tests/xss_data.txt
Diffstat (limited to 'modules/gallery/tests/Database_Test.php')
-rw-r--r-- | modules/gallery/tests/Database_Test.php | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/modules/gallery/tests/Database_Test.php b/modules/gallery/tests/Database_Test.php index d83212ad..ad2bbba1 100644 --- a/modules/gallery/tests/Database_Test.php +++ b/modules/gallery/tests/Database_Test.php @@ -99,7 +99,7 @@ class Database_Test extends Unit_Test_Case { UNIQUE KEY(`name`)) ENGINE=InnoDB DEFAULT CHARSET=utf8"; $this->assert_same($expected, $converted); - + $sql = "UPDATE {test_tables} SET `name` = '{test string}' " . "WHERE `item_id` IN " . " (SELECT `id` FROM {items} " . @@ -116,12 +116,16 @@ class Database_Test extends Unit_Test_Case { $this->assert_same($expected, $sql); } - public function setup() { - } + function prefix_no_replacement_test() { + $update = Database_For_Test::instance()->from("test_tables") + ->where("1 = 1") + ->set(array("name" => "Test Name")) + ->update(); - public function teardown() { - } + $expected = "UPDATE `g3test_test_tables` SET `name` = 'Test Name' WHERE 1 = 1"; + $this->assert_same($expected, $update); + } } class Database_For_Test extends Database { @@ -131,4 +135,12 @@ class Database_For_Test extends Database { $db->config["table_prefix"] = "g3test_"; return $db; } + + public function query($sql = '') { + if (!empty($sql)) { + print " query($sql)\n"; + $sql = $this->add_table_prefixes($sql); + } + return $sql; + } } |