/**
  * @test
  */
 public function getFetchesFalseBooleanValueFromBackend()
 {
     $backend = $this->getMock(\TYPO3\CMS\Core\Cache\Backend\AbstractBackend::class, array('get', 'set', 'has', 'remove', 'findIdentifiersByTag', 'flush', 'flushByTag', 'collectGarbage'), array(), '', false);
     $backend->expects($this->once())->method('get')->will($this->returnValue(serialize(false)));
     $cache = new \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend('VariableFrontend', $backend);
     $this->assertFalse($cache->get('VariableCacheTest'), 'The returned value was not the FALSE.');
 }
Пример #2
0
 /**
  * @test
  */
 public function getUsesIgBinaryIfAvailable()
 {
     if (!extension_loaded('igbinary')) {
         $this->markTestSkipped('Cannot test igbinary support, because igbinary is not installed.');
     }
     $theArray = array('Just some value', 'and another one.');
     $backend = $this->getMock('TYPO3\\CMS\\Core\\Cache\\Backend\\AbstractBackend', array('get', 'set', 'has', 'remove', 'findIdentifiersByTag', 'flush', 'flushByTag', 'collectGarbage'), array(), '', FALSE);
     $backend->expects($this->once())->method('get')->will($this->returnValue(igbinary_serialize($theArray)));
     $cache = new \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend('VariableFrontend', $backend);
     $cache->initializeObject();
     $this->assertEquals($theArray, $cache->get('VariableCacheTest'), 'The returned value was not the expected unserialized array.');
 }