mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/9687] Fix tests on postgres
PHPBB3-9687
This commit is contained in:
parent
a0bd70885d
commit
66cb07d2f4
3 changed files with 9 additions and 2 deletions
|
@ -115,7 +115,7 @@ abstract class base implements type_interface
|
|||
WHERE (ban_end >= ' . time() . "
|
||||
OR ban_end = 0)
|
||||
AND ban_mode = '{$this->get_type()}'
|
||||
ORDER BY ban_item ASC, ban_id ASC";
|
||||
ORDER BY ban_item";
|
||||
$result = $this->db->sql_query($sql);
|
||||
$rowset = $this->db->sql_fetchrowset($result);
|
||||
$this->db->sql_freeresult($result);
|
||||
|
|
|
@ -80,7 +80,7 @@ class user extends base
|
|||
OR b.ban_end = 0)
|
||||
AND b.ban_userid = u.user_id
|
||||
AND b.ban_mode = '{$this->get_type()}'
|
||||
ORDER BY username_clean ASC";
|
||||
ORDER BY u.username_clean ASC";
|
||||
$result = $this->db->sql_query($sql);
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
|
|
|
@ -276,6 +276,13 @@ class ban_manager_test extends \phpbb_session_test_case
|
|||
{
|
||||
$this->expectException($expected_exception);
|
||||
}
|
||||
|
||||
// Fix weird sorting by postgres
|
||||
if (is_array($expected) && $ban_type == 'email' && $this->db->get_sql_layer() == 'postgres')
|
||||
{
|
||||
$expected = array_reverse($expected);
|
||||
}
|
||||
|
||||
$this->assertEquals($expected, $this->ban_manager->get_bans($ban_type));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue