mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[feature/dbal-tests] Delete data
PHPBB3-9625
This commit is contained in:
parent
539ae0ffaf
commit
c4b0814c62
1 changed files with 30 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue