diff --git a/tests/functional/acp_attachments_test.php b/tests/functional/acp_attachments_test.php index 8b1fb2cc6d..bed79eaaf2 100644 --- a/tests/functional/acp_attachments_test.php +++ b/tests/functional/acp_attachments_test.php @@ -82,9 +82,12 @@ class phpbb_functional_acp_attachments_test extends phpbb_functional_test_case // Also the file name should be in the first row of the files table $this->assertEquals('valid.jpg', $crawler->filter('span.file-name > a')->text()); - + + // Get attach id, the link looks similar to ./download/attachment/3 $attach_link = $crawler->filter('span.file-name > a')->attr('href'); - $attach_id = $this->get_parameter_from_link($attach_link, 'id'); + $matches = []; + preg_match('/\/([0-9]+)$/', $attach_link, $matches); + $attach_id = (int) $matches[1]; // Set file time older than 3 hours to consider it orphan $sql = 'UPDATE ' . ATTACHMENTS_TABLE . '