1
0
Fork 0

Adding dw2pdf version 2023-11-25 (48253f1).

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2024-12-01 20:29:19 +01:00
parent d4820b660a
commit 8e32b01eb0
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
999 changed files with 144285 additions and 0 deletions

View file

@ -0,0 +1,73 @@
<?php
namespace dokuwiki\plugin\dw2pdf\test;
use dokuwiki\plugin\dw2pdf\DokuImageProcessorDecorator;
use DokuWikiTest;
/**
* General tests for the imagemap plugin
*
* @group plugin_dw2pdf
* @group plugins
*/
class DokuImageProcessorTest extends DokuWikiTest
{
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
require_once __DIR__ . '/../vendor/autoload.php';
}
/**
* @return array the Testdata
*/
public function provideGetImageTestdata() {
global $conf;
return [
[
DOKU_URL . 'lib/exe/fetch.php?tok=b0b7a3&media=http%3A%2F%2Fphp.net%2Fimages%2Fphp.gif',
DOKU_REL . 'lib/exe/fetch.php?tok=b0b7a3&media=http%3A%2F%2Fphp.net%2Fimages%2Fphp.gif',
'http://php.net/images/php.gif',
'http://php.net/images/php.gif',
'external image',
],
[
DOKU_URL . 'lib/images/throbber.gif',
DOKU_REL . 'lib/images/throbber.gif',
DOKU_INC . 'lib/images/throbber.gif',
DOKU_INC . 'lib/images/throbber.gif',
'fixed standard image',
],
[
DOKU_URL . 'lib/exe/fetch.php?media=wiki:dokuwiki-128.png',
DOKU_REL . 'lib/exe/fetch.php?media=wiki:dokuwiki-128.png',
$conf['mediadir'] . '/wiki/dokuwiki-128.png',
$conf['mediadir'] . '/wiki/dokuwiki-128.png',
'Internal image',
],
];
}
/**
* @dataProvider provideGetImageTestdata
*
* @param $input_file
* @param $input_orig_srcpath
* @param $expected_file
* @param $expected_orig_srcpath
* @param $msg
*/
public function testGetImage($input_file, $input_orig_srcpath, $expected_file, $expected_orig_srcpath, $msg)
{
list($actual_file, $actual_orig_srcpath) = DokuImageProcessorDecorator::adjustGetImageLinks($input_file,
$input_orig_srcpath);
$this->assertEquals($expected_file, $actual_file, '$file ' . $msg);
$this->assertEquals($expected_orig_srcpath, $actual_orig_srcpath, '$orig_srcpath ' . $msg);
}
}