TYPO3 CMS  TYPO3_6-2
FactoryTest.php
Go to the documentation of this file.
1 <?php
3 
25 
30  $mockCacheManager = $this->getMock('TYPO3\\CMS\\Core\\Cache\\CacheManager', array('registerCache'), array(), '', FALSE);
31  $factory = new \TYPO3\CMS\Core\Cache\CacheFactory('Testing', $mockCacheManager);
32  $cache = $factory->create('TYPO3_Cache_FactoryTest_Cache', 'TYPO3\\CMS\\Core\\Cache\\Frontend\\VariableFrontend', 'TYPO3\\CMS\\Core\\Cache\\Backend\\NullBackend');
33  $this->assertInstanceOf('TYPO3\\CMS\\Core\\Cache\\Frontend\\VariableFrontend', $cache);
34  }
35 
40  $mockCacheManager = $this->getMock('TYPO3\\CMS\\Core\\Cache\\CacheManager', array('registerCache'), array(), '', FALSE);
41  $factory = new \TYPO3\CMS\Core\Cache\CacheFactory('Testing', $mockCacheManager);
42  $cache = $factory->create('TYPO3_Cache_FactoryTest_Cache', 'TYPO3\\CMS\\Core\\Cache\\Frontend\\VariableFrontend', 'TYPO3\\CMS\\Core\\Cache\\Backend\\FileBackend');
43  $this->assertInstanceOf('TYPO3\\CMS\\Core\\Cache\\Backend\\FileBackend', $cache->getBackend());
44  }
45 
50  $mockCacheManager = $this->getMock('TYPO3\\CMS\\Core\\Cache\\CacheManager', array('registerCache'), array(), '', FALSE);
51  $mockCacheManager->expects($this->once())->method('registerCache');
52  $factory = new \TYPO3\CMS\Core\Cache\CacheFactory('Testing', $mockCacheManager);
53  $factory->create('TYPO3_Cache_FactoryTest_Cache', 'TYPO3\\CMS\\Core\\Cache\\Frontend\\VariableFrontend', 'TYPO3\\CMS\\Core\\Cache\\Backend\\FileBackend');
54  }
55 
56 }