fix FeedPageProcessorTest on Github

It seems that the dataProvider generator runs before the rest of the
test suite, resulting in a wrong modification timestamp being read.

It's unclear why this happens on Github only.
This commit is contained in:
Andreas Gohr 2024-01-26 12:41:38 +01:00
parent 2d1b030690
commit 482bf1d581
1 changed files with 9 additions and 4 deletions

View File

@ -30,7 +30,6 @@ class FeedPageProcessorTest extends \DokuWikiTest
]);
// an Item returned by FeedCreator::fetchItemsFromNamespace()
clearstatcache();
yield ([
[
'id' => 'wiki:dokuwiki',
@ -40,18 +39,17 @@ class FeedPageProcessorTest extends \DokuWikiTest
'level' => 1,
'open' => true,
],
filemtime(wikiFN('wiki:dokuwiki')), // current revision
null, // current revision
['anonymous@undisclosed.example.com', 'Anonymous'], // unknown author
'', // no summary
]);
// an Item returned by FeedCreator::fetchItemsFromSearch()
clearstatcache();
yield ([
[
'id' => 'wiki:dokuwiki',
],
filemtime(wikiFN('wiki:dokuwiki')), // current revision
null, // current revision
['anonymous@undisclosed.example.com', 'Anonymous'], // unknown author
'', // no summary
]);
@ -68,6 +66,13 @@ class FeedPageProcessorTest extends \DokuWikiTest
$conf['showuseras'] = 'username';
$conf['useheading'] = 1;
// if no expected mtime is given, we expect the filemtime of the page
// see https://github.com/dokuwiki/dokuwiki/pull/4156#issuecomment-1911842452 why we can't
// create this in the data provider
if ($expectedMtime === null) {
$expectedMtime = filemtime(wikiFN($data['id']));
}
$proc = new FeedPageProcessor($data);
$this->assertEquals('wiki:dokuwiki', $proc->getId());