1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-17 14:18:24 +01:00

Merge pull request #6330 from rxu/ticket/16910-master

[ticket/16910] Fix ACP orphan attachments module tests
This commit is contained in:
Marc Alexander 2021-11-22 14:51:32 +01:00 committed by GitHub
commit 76922413bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 // 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()); $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_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 // Set file time older than 3 hours to consider it orphan
$sql = 'UPDATE ' . ATTACHMENTS_TABLE . ' $sql = 'UPDATE ' . ATTACHMENTS_TABLE . '