[BUGFIX] PHP 5.4 unit test warnings
authorChristian Kuhn <lolli@schwarzbu.ch>
Fri, 2 Nov 2012 16:14:49 +0000 (17:14 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 2 Nov 2012 16:18:08 +0000 (17:18 +0100)
Incomplete mocking in some tests triggers
string offset PHP 5.4 warnings.

Fixes: #42644
Releases: 6.0

Change-Id: I261a7652909db21ee4839882a8360016cc854b2b
Reviewed-on: http://review.typo3.org/16144
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php
typo3/sysext/frontend/Tests/Unit/Controller/TypoScriptFrontendControllerTest.php

index 06890f9..3af14d5 100644 (file)
@@ -34,13 +34,6 @@ namespace TYPO3\CMS\Frontend\Tests\Unit\ContentObject;
 class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
-        * Enable backup of global and system variables
-        *
-        * @var boolean
-        */
-       protected $backupGlobals = TRUE;
-
-       /**
         * @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer
         */
        private $cObj;
@@ -65,6 +58,7 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->tsfe = $this->getMock('TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController', array(), array(), '', FALSE);
                $this->tsfe->tmpl = $this->template;
                $this->tsfe->config = array();
+               $this->tsfe->page = array();
                $sysPageMock = $this->getMock('TYPO3\\CMS\\Frontend\\Page\\PageRepository');
                $this->tsfe->sys_page = $sysPageMock;
                $GLOBALS['TSFE'] = $this->tsfe;
index 498b1b7..4fce947 100644 (file)
@@ -33,13 +33,6 @@ namespace TYPO3\CMS\Frontend\Tests\Unit\Controller;
 class TypoScriptFrontendControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
-        * Enable backup of global and system variables
-        *
-        * @var boolean
-        */
-       protected $backupGlobals = TRUE;
-
-       /**
         * @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
         */
        private $fixture;
@@ -172,6 +165,7 @@ class TypoScriptFrontendControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCas
                        '',
                        FALSE
                );
+               $this->fixture->page = array();
 
                $pageRepository = $this->getMock('TYPO3\\CMS\\Frontend\\Page\\PageRepository');
                \TYPO3\CMS\Core\Utility\GeneralUtility::addInstance('TYPO3\\CMS\\Frontend\\Page\\PageRepository', $pageRepository);