You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

48 lines
1.2 KiB

  1. <?php
  2. // must be run within Dokuwiki
  3. if (!defined('DOKU_INC')) die();
  4. /**
  5. * Test cases for the move plugin
  6. *
  7. * @group plugin_move
  8. * @group plugins
  9. */
  10. class plugin_move_cache_handling_test extends DokuWikiTest {
  11. function setUp(): void {
  12. parent::setUpBeforeClass();
  13. $this->pluginsEnabled[] = 'move';
  14. parent::setUp();
  15. }
  16. /**
  17. * @group slow
  18. */
  19. function test_cache_handling() {
  20. $testid = 'wiki:bar:test';
  21. saveWikiText($testid,
  22. '[[wiki:foo:]]', 'Test setup');
  23. idx_addPage($testid);
  24. saveWikiText('wiki:foo:start',
  25. 'bar', 'Test setup');
  26. idx_addPage('wiki:foo:start');
  27. sleep(1); // wait in order to make sure that conditions with < give the right result.
  28. p_wiki_xhtml($testid); // populate cache
  29. $cache = new cache_renderer($testid, wikiFN($testid), 'xhtml');
  30. $this->assertTrue($cache->useCache());
  31. /** @var helper_plugin_move_op $move */
  32. $move = plugin_load('helper', 'move_op');
  33. $this->assertTrue($move->movePage('wiki:foo:start', 'wiki:foo2:start'));
  34. $cache = new cache_renderer($testid, wikiFN($testid), 'xhtml');
  35. $this->assertFalse($cache->useCache());
  36. }
  37. }