From 8d03b9e001526fb237cdb744dd832c1dd4182d01 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 23 Sep 2015 09:09:09 +0200 Subject: [ticket/14168] Reset sequence before tests in delete tests PHPBB3-14168 --- tests/attachment/delete_test.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/attachment') diff --git a/tests/attachment/delete_test.php b/tests/attachment/delete_test.php index 19a5e0bcca..df7e305dc5 100644 --- a/tests/attachment/delete_test.php +++ b/tests/attachment/delete_test.php @@ -65,6 +65,13 @@ class phpbb_attachment_delete_test extends \phpbb_database_test_case */ public function test_attachment_delete($mode, $ids, $resync, $expected) { + // We need to reset the attachment ID sequence to properly test this + if ($this->db->get_sql_layer() === 'postgres') + { + $sql = 'ALTER SEQUENCE phpbb_attachments_seq RESTART WITH 1'; + $this->db->sql_query($sql); + } + $this->assertSame($expected, $this->attachment_delete->delete($mode, $ids, $resync)); } } -- cgit v1.2.1