-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add media reference adaption support for images inside other links
- Loading branch information
Showing
2 changed files
with
59 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
/** | ||
* Test cases for the pagemove plugin | ||
*/ | ||
class plugin_pagemove_mediamove_test extends DokuWikiTest { | ||
|
||
public function setUp() { | ||
$this->pluginsEnabled[] = 'pagemove'; | ||
parent::setUp(); | ||
} | ||
|
||
public function test_movePageWithRelativeMedia() { | ||
global $ID; | ||
|
||
$ID = 'mediareltest:foo'; | ||
saveWikiText($ID, | ||
'{{ myimage.png}} [[:start|{{ testimage.png?200x800 }}]] [[bar|{{testimage.gif?400x200}}]] | ||
[[doku>wiki:dokuwiki|{{wiki:logo.png}}]] [[http://www.example.com|{{testimage.jpg}}]] | ||
[[doku>wiki:foo|{{foo.gif?200x3000}}]]', 'Test setup'); | ||
idx_addPage($ID); | ||
|
||
$opts = array(); | ||
$opts['ns'] = getNS($ID); | ||
$opts['name'] = noNS($ID); | ||
$opts['newns'] = ''; | ||
$opts['newname'] = 'foo'; | ||
/** @var helper_plugin_pagemove $pagemove */ | ||
$pagemove = plugin_load('helper', 'pagemove'); | ||
$pagemove->move_page($opts); | ||
|
||
$this->assertEquals('{{ mediareltest:myimage.png}} [[:start|{{ mediareltest:testimage.png?200x800 }}]] [[mediareltest:bar|{{mediareltest:testimage.gif?400x200}}]] | ||
[[doku>wiki:dokuwiki|{{wiki:logo.png}}]] [[http://www.example.com|{{mediareltest:testimage.jpg}}]] | ||
[[doku>wiki:foo|{{mediareltest:foo.gif?200x3000}}]]', rawWiki('foo')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters