Merge pull request #2194 from bantu/ticket/12317

[ticket/12317] Fix notification tests for DBMS drivers using int for integers ;-)
This commit is contained in:
Nils Adermann 2014-03-28 22:24:57 -04:00
commit 6d0b7bba3f
8 changed files with 9 additions and 14 deletions

View file

@ -75,7 +75,7 @@ class bookmark extends \phpbb\notification\type\post
$result = $this->db->sql_query($sql); $result = $this->db->sql_query($sql);
while ($row = $this->db->sql_fetchrow($result)) while ($row = $this->db->sql_fetchrow($result))
{ {
$users[] = $row['user_id']; $users[] = (int) $row['user_id'];
} }
$this->db->sql_freeresult($result); $this->db->sql_freeresult($result);

View file

@ -103,7 +103,7 @@ class post extends \phpbb\notification\type\base
$result = $this->db->sql_query($sql); $result = $this->db->sql_query($sql);
while ($row = $this->db->sql_fetchrow($result)) while ($row = $this->db->sql_fetchrow($result))
{ {
$users[] = $row['user_id']; $users[] = (int) $row['user_id'];
} }
$this->db->sql_freeresult($result); $this->db->sql_freeresult($result);
@ -115,7 +115,7 @@ class post extends \phpbb\notification\type\base
$result = $this->db->sql_query($sql); $result = $this->db->sql_query($sql);
while ($row = $this->db->sql_fetchrow($result)) while ($row = $this->db->sql_fetchrow($result))
{ {
$users[] = $row['user_id']; $users[] = (int) $row['user_id'];
} }
$this->db->sql_freeresult($result); $this->db->sql_freeresult($result);

View file

@ -94,7 +94,7 @@ class quote extends \phpbb\notification\type\post
$result = $this->db->sql_query($sql); $result = $this->db->sql_query($sql);
while ($row = $this->db->sql_fetchrow($result)) while ($row = $this->db->sql_fetchrow($result))
{ {
$users[] = $row['user_id']; $users[] = (int) $row['user_id'];
} }
$this->db->sql_freeresult($result); $this->db->sql_freeresult($result);

View file

@ -103,7 +103,7 @@ class topic extends \phpbb\notification\type\base
$result = $this->db->sql_query($sql); $result = $this->db->sql_query($sql);
while ($row = $this->db->sql_fetchrow($result)) while ($row = $this->db->sql_fetchrow($result))
{ {
$users[] = $row['user_id']; $users[] = (int) $row['user_id'];
} }
$this->db->sql_freeresult($result); $this->db->sql_freeresult($result);

View file

@ -133,7 +133,7 @@ abstract class phpbb_notification_submit_post_base extends phpbb_database_test_c
FROM ' . NOTIFICATIONS_TABLE . ' n, ' . NOTIFICATION_TYPES_TABLE . " nt FROM ' . NOTIFICATIONS_TABLE . ' n, ' . NOTIFICATION_TYPES_TABLE . " nt
WHERE nt.notification_type_name = '" . $this->item_type . "' WHERE nt.notification_type_name = '" . $this->item_type . "'
AND n.notification_type_id = nt.notification_type_id AND n.notification_type_id = nt.notification_type_id
ORDER BY user_id, item_id ASC"; ORDER BY user_id ASC, item_id ASC";
$result = $this->db->sql_query($sql); $result = $this->db->sql_query($sql);
$this->assertEquals($expected_before, $this->db->sql_fetchrowset($result)); $this->assertEquals($expected_before, $this->db->sql_fetchrowset($result));
$this->db->sql_freeresult($result); $this->db->sql_freeresult($result);
@ -142,11 +142,6 @@ abstract class phpbb_notification_submit_post_base extends phpbb_database_test_c
$post_data = array_merge($this->post_data, $additional_post_data); $post_data = array_merge($this->post_data, $additional_post_data);
submit_post('reply', '', 'poster-name', POST_NORMAL, $poll_data, $post_data, false, false); submit_post('reply', '', 'poster-name', POST_NORMAL, $poll_data, $post_data, false, false);
$sql = 'SELECT user_id, item_id, item_parent_id
FROM ' . NOTIFICATIONS_TABLE . ' n, ' . NOTIFICATION_TYPES_TABLE . " nt
WHERE nt.notification_type_name = '" . $this->item_type . "'
AND n.notification_type_id = nt.notification_type_id
ORDER BY user_id ASC, item_id ASC";
$result = $this->db->sql_query($sql); $result = $this->db->sql_query($sql);
$this->assertEquals($expected_after, $this->db->sql_fetchrowset($result)); $this->assertEquals($expected_after, $this->db->sql_fetchrowset($result));
$this->db->sql_freeresult($result); $this->db->sql_freeresult($result);

View file

@ -27,7 +27,7 @@ class phpbb_notification_submit_post_type_bookmark_test extends phpbb_notificati
$this->greaterThan(0)) $this->greaterThan(0))
->will($this->returnValueMap(array( ->will($this->returnValueMap(array(
array( array(
array('3', '4', '5', '6', '7'), array(3, 4, 5, 6, 7),
'f_read', 'f_read',
1, 1,
array( array(

View file

@ -27,7 +27,7 @@ class phpbb_notification_submit_post_type_post_test extends phpbb_notification_s
$this->greaterThan(0)) $this->greaterThan(0))
->will($this->returnValueMap(array( ->will($this->returnValueMap(array(
array( array(
array('3', '4', '5', '6', '7', '8'), array(3, 4, 5, 6, 7, 8),
'f_read', 'f_read',
1, 1,
array( array(

View file

@ -27,7 +27,7 @@ class phpbb_notification_submit_post_type_quote_test extends phpbb_notification_
$this->greaterThan(0)) $this->greaterThan(0))
->will($this->returnValueMap(array( ->will($this->returnValueMap(array(
array( array(
array('3', '4', '5', '6', '7'), array(3, 4, 5, 6, 7),
'f_read', 'f_read',
1, 1,
array( array(