[BUGFIX][TESTS] Fix unit test cropIsMultibyteSafe
authorSteffen Gebert <steffen.gebert@typo3.org>
Fri, 29 Apr 2011 10:50:52 +0000 (12:50 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 29 Apr 2011 11:25:51 +0000 (13:25 +0200)
The unit test cropIsMultibyteSafe (class tslib_contentTest) fails, if
error reporting includes E_WARNING. In this case mb_strlen() throws an
error, as it is called with an empty string as second parameter
$charset. Initializing $GLOBALS['TSFE']->renderCharset in the setUp
method solves this.

Change-Id: Id57fab2393a651ddd72fdb46e86e71f0d70330a1
Resolves: #26491
Releases: 4.6, 4.5
Reviewed-on: http://review.typo3.org/1786
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
tests/typo3/sysext/cms/tslib/tslib_contentTest.php

index 7758ed1..86a7e52 100644 (file)
@@ -73,6 +73,7 @@ class tslib_contentTest extends tx_phpunit_testcase {
                $this->tsfe->config = array();
                $GLOBALS['TSFE'] = $this->tsfe;
                $GLOBALS['TSFE']->csConvObj = new t3lib_cs();
+               $GLOBALS['TSFE']->renderCharset = 'utf-8';
                $GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_utils'] = 'mbstring';
 
                $className = 'tslib_cObj_' . uniqid('test');