[BUGFIX] VariableFrontend initializeObject not called
authorDaniel Pötzinger <poetzinger@aoemedia.de>
Thu, 12 Apr 2012 17:59:38 +0000 (19:59 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 30 Jun 2012 12:35:23 +0000 (14:35 +0200)
The method is protected and is not called in the container then

Change-Id: I03ab47aa1030e782d14304d9371fc62b9c5aed18
Fixes: #35915
Releases: 6.0, 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/12472
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
t3lib/cache/frontend/class.t3lib_cache_frontend_variablefrontend.php
tests/t3lib/cache/frontend/t3lib_cache_frontend_variablefrontendTest.php

index 64491eb..63a5a5f 100644 (file)
@@ -62,7 +62,7 @@ class t3lib_cache_frontend_VariableFrontend extends t3lib_cache_frontend_Abstrac
         * @return void
         * @author Robert Lemke <robert@typo3.org>
         */
-       protected function initializeObject() {
+       public function initializeObject() {
                $this->useIgBinary = extension_loaded('igbinary');
        }
 
index 8d1efae..a16c533 100644 (file)
@@ -104,6 +104,7 @@ class t3lib_cache_frontend_VariableFrontendTest extends tx_phpunit_testcase {
                $backend->expects($this->once())->method('set')->with($this->equalTo('VariableCacheTest'), $this->equalTo(igbinary_serialize($theString)));
 
                $cache = new t3lib_cache_frontend_VariableFrontend('VariableFrontend', $backend);
+               $cache->initializeObject();
                $cache->set('VariableCacheTest', $theString);
        }
 
@@ -161,6 +162,7 @@ class t3lib_cache_frontend_VariableFrontendTest extends tx_phpunit_testcase {
                $backend->expects($this->once())->method('get')->will($this->returnValue(igbinary_serialize($theArray)));
 
                $cache = new t3lib_cache_frontend_VariableFrontend('VariableFrontend', $backend);
+               $cache->initializeObject();
 
                $this->assertEquals($theArray, $cache->get('VariableCacheTest'), 'The returned value was not the expected unserialized array.');
        }
@@ -243,6 +245,7 @@ class t3lib_cache_frontend_VariableFrontendTest extends tx_phpunit_testcase {
                $backend->expects($this->exactly(2))->method('get')->will($this->onConsecutiveCalls(igbinary_serialize('one value'), igbinary_serialize('two value')));
 
                $cache = new t3lib_cache_frontend_VariableFrontend('VariableFrontend', $backend);
+               $cache->initializeObject();
                $this->assertEquals($entries, $cache->getByTag($tag), 'Did not receive the expected entries');
        }
 }