Project

General

Profile

Bug #22556 » doesGetImgResourceReturnRightValue-v2.patch

Administrator Admin, 2010-05-03 10:18

View differences:

tests/typo3/sysext/cms/tslib/tslib_content_testcase.php (Arbeitskopie)
////////////////////////
/**
* Converts the subject and the expected result into the target charset.
* Tests whether cImage returns right img-tag
*
* @test
*/
public function doesGetImgResourceReturnRightValue() {
$template = $this->getMock(
't3lib_TStemplate', array( 'linkData')
);
$template->allowedPaths = Array(
'media/',
$GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'], // fileadmin/ path
'uploads/',
'typo3temp/',
't3lib/fonts/',
TYPO3_mainDir . 'ext/',
TYPO3_mainDir . 'sysext/',
TYPO3_mainDir . 'contrib/',
'typo3conf/ext/'
);
$template->getFileName_backPath = PATH_site;
$GLOBALS['TSFE']->tmpl = $template ;
$imgRes = 'typo3/sysext/cms/ext_icon.gif';
$result = $this->cObj->getImgResource($imgRes, NULL);
$this->assertEquals($imgRes, $result[3]);
$imgRes = 'EXT:cms/ext_icon.gif';
$expected = 'typo3/sysext/cms/ext_icon.gif';
$result = $this->cObj->getImgResource($imgRes, NULL);
$this->assertEquals($expected, $result[3]);
$GLOBALS['TSFE']->tmpl = $this->template ;
}
/**
* Tests whether the getImgResource hook is called correctly.
*
* @param string $charset the target charset
* @param string $subject the subject, will be modified
* @param string $expected the expected result, will be modified
(3-3/4)