diff options
| author | Joas Schilling <nickvergessen@gmx.de> | 2010-04-13 20:12:54 +0200 |
|---|---|---|
| committer | Andreas Fischer <bantu@phpbb.com> | 2010-06-17 16:06:10 +0200 |
| commit | c4b0814c62c592c85a4b960f1b62891e640f9a66 (patch) | |
| tree | 4bfdf1ad18d154f114e3648d2cf239aab42afd52 /tests | |
| parent | 539ae0ffafb7981e5d1918183044487f8a6c3a9e (diff) | |
| download | forums-c4b0814c62c592c85a4b960f1b62891e640f9a66.tar forums-c4b0814c62c592c85a4b960f1b62891e640f9a66.tar.gz forums-c4b0814c62c592c85a4b960f1b62891e640f9a66.tar.bz2 forums-c4b0814c62c592c85a4b960f1b62891e640f9a66.tar.xz forums-c4b0814c62c592c85a4b960f1b62891e640f9a66.zip | |
[feature/dbal-tests] Delete data
PHPBB3-9625
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/dbal/dbal.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/dbal/dbal.php b/tests/dbal/dbal.php index 98f31d9398..2ca352e2c6 100644 --- a/tests/dbal/dbal.php +++ b/tests/dbal/dbal.php @@ -350,5 +350,35 @@ class phpbb_dbal_test extends phpbb_database_test_case $db->sql_freeresult($result); } + + public static function delete_data() + { + return array( + array("WHERE config_name = 'test_version'", array(array( + 'config_name' => 'second config', + 'config_value' => '10', + 'is_dynamic' => 0, + ))), + array('', array()), + ); + } + + /** + * @dataProvider delete_data + */ + public function test_delete($where, $expected) + { + $db = $this->new_dbal(); + + $result = $db->sql_query('DELETE FROM phpbb_config + ' . $where); + + $result = $db->sql_query('SELECT * + FROM phpbb_config'); + + $this->assertEquals($expected, $db->sql_fetchrowset($result)); + + $db->sql_freeresult($result); + } } |
