From 148463d586fa2dd7675b3e387464e02f76a0ccf4 Mon Sep 17 00:00:00 2001 From: Nathaniel Guse Date: Wed, 26 Dec 2012 11:05:12 -0600 Subject: [PATCH] [ticket/11103] Remove global $db usage in test PHPBB3-11103 --- tests/notification/notification.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/notification/notification.php b/tests/notification/notification.php index e7fd8539ab..cd2080bb4d 100644 --- a/tests/notification/notification.php +++ b/tests/notification/notification.php @@ -20,7 +20,7 @@ class phpbb_notification_test extends phpbb_database_test_case { parent::setUp(); - global $phpbb_root_path, $db, $phpEx; + global $phpbb_root_path, $phpEx; if (!function_exists('set_var')) { @@ -29,7 +29,7 @@ class phpbb_notification_test extends phpbb_database_test_case include_once(__DIR__ . '/ext/test/notification/type/test.' . $phpEx); - $db = $this->db = $this->new_dbal(); + $this->db = $this->new_dbal(); $this->config = new phpbb_config(array( 'allow_privmsg' => true, 'allow_bookmarks' => true, @@ -125,10 +125,8 @@ class phpbb_notification_test extends phpbb_database_test_case public function test_notifications() { - global $db; - // Used to test post notifications later - $db->sql_query('INSERT INTO ' . TOPICS_WATCH_TABLE . ' ' . $db->sql_build_array('INSERT', array( + $this->db->sql_query('INSERT INTO ' . TOPICS_WATCH_TABLE . ' ' . $this->db->sql_build_array('INSERT', array( 'topic_id' => 2, 'notify_status' => NOTIFY_YES, 'user_id' => 0, @@ -171,7 +169,7 @@ class phpbb_notification_test extends phpbb_database_test_case 'forum_name' => 'Your first forum', )); - $db->sql_query('INSERT INTO ' . BOOKMARKS_TABLE . ' ' . $db->sql_build_array('INSERT', array( + $this->db->sql_query('INSERT INTO ' . BOOKMARKS_TABLE . ' ' . $this->db->sql_build_array('INSERT', array( 'topic_id' => 2, 'user_id' => 0, )));