aboutsummaryrefslogtreecommitdiffstats
path: root/tests/attachment
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2015-09-23 09:09:09 +0200
committerMarc Alexander <admin@m-a-styles.de>2015-10-09 10:15:40 +0200
commit8d03b9e001526fb237cdb744dd832c1dd4182d01 (patch)
treeb07d3340437e42c0640b4070ccf6166d3bb32bad /tests/attachment
parentc6f9e3a966cffdc09c64f73a25ac98d6bbe559cd (diff)
downloadforums-8d03b9e001526fb237cdb744dd832c1dd4182d01.tar
forums-8d03b9e001526fb237cdb744dd832c1dd4182d01.tar.gz
forums-8d03b9e001526fb237cdb744dd832c1dd4182d01.tar.bz2
forums-8d03b9e001526fb237cdb744dd832c1dd4182d01.tar.xz
forums-8d03b9e001526fb237cdb744dd832c1dd4182d01.zip
[ticket/14168] Reset sequence before tests in delete tests
PHPBB3-14168
Diffstat (limited to 'tests/attachment')
-rw-r--r--tests/attachment/delete_test.php7
1 files changed, 7 insertions, 0 deletions
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));
}
}