1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 08:47:45 +02:00

[ticket/11413] Don't use the database for the convert test

Different databases seem to work slightly differently here and are causing
errors

PHPBB3-11413
This commit is contained in:
Nathaniel Guse
2013-04-30 21:38:40 -05:00
parent f2e618a05d
commit 2f2feaa4e8
2 changed files with 26 additions and 22 deletions

View File

@@ -100,7 +100,16 @@ class phpbb_db_migration_data_310_notifications2 extends phpbb_db_migration
public function convert_notifications()
{
$insert_table = $this->table_prefix . 'user_notifications';
$insert_buffer = new phpbb_db_sql_insert_buffer($this->db, $insert_table);
$this->perform_conversion($insert_buffer, $insert_table);
}
/**
* Perform the conversion (separate for testability)
*/
public function perform_conversion($insert_buffer, $insert_table)
{
$sql = 'DELETE FROM ' . $insert_table;
$this->db->sql_query($sql);
@@ -108,7 +117,6 @@ class phpbb_db_migration_data_310_notifications2 extends phpbb_db_migration
FROM ' . USERS_TABLE;
$result = $this->db->sql_query($sql);
$insert_buffer = new phpbb_db_sql_insert_buffer($this->db, $insert_table);
while ($row = $this->db->sql_fetchrow($result))
{
$notification_methods = array();
@@ -162,6 +170,7 @@ class phpbb_db_migration_data_310_notifications2 extends phpbb_db_migration
'item_type' => $item_type,
'item_id' => (int) $item_id,
'user_id' => (int) $user_id,
'notify' => 1
);
foreach ($methods as $method)