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.
 
 
 
 
 

59 lines
1.4 KiB

  1. <?php
  2. /**
  3. * Test cases for the move plugin
  4. *
  5. * @group plugin_move
  6. * @group plugins
  7. */
  8. class plugin_move_affectedPagesNS_test extends DokuWikiTest {
  9. protected $pluginsEnabled = array('move',);
  10. public function setUp(): void {
  11. parent::setUp();
  12. global $USERINFO;
  13. global $conf;
  14. $conf['useacl'] = 1;
  15. $conf['superuser'] = 'john';
  16. $_SERVER['REMOTE_USER'] = 'john'; //now it's testing as admin
  17. $USERINFO['grps'] = array('admin','user');
  18. }
  19. /**
  20. * @coversNothing
  21. */
  22. public function tearDown(): void {
  23. /** @var helper_plugin_move_plan $plan */
  24. $plan = plugin_load('helper', 'move_plan');
  25. $plan->abort();
  26. parent::tearDown();
  27. }
  28. /**
  29. * @covers helper_plugin_move_plan::findAffectedPages
  30. * @uses Doku_Indexer
  31. */
  32. public function test_affectedPagesNS_Media() {
  33. saveWikiText('oldns:start', '{{oldnsimage_missing.png}}', 'setup');
  34. idx_addPage('oldns:start');
  35. /** @var helper_plugin_move_plan $plan */
  36. $plan = plugin_load('helper','move_plan');
  37. $this->assertFalse($plan->inProgress());
  38. $plan->addMediaNamespaceMove('oldns', 'newns');
  39. $plan->commit();
  40. $affected_file = file(TMP_DIR . '/data/meta/__move_affected');
  41. $this->assertSame('oldns:start',trim($affected_file[0]));
  42. }
  43. }