mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/16910] Fix ACP orphan attachments module tests
PHPBB3-16910
This commit is contained in:
parent
0766facdb2
commit
3f47b490b9
1 changed files with 5 additions and 2 deletions
|
@ -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 . '
|
||||||
|
|
Loading…
Add table
Reference in a new issue