コード例 #1
0
 /**
  * @dataProvider configProvider
  */
 public function testLoadHandlerConfiguration($config)
 {
     $container = new ContainerBuilder();
     $extension = new TedivmStashExtension();
     $extension->load(array($config), $container);
     $this->assertEquals($config['default_cache'], $container->getParameter('stash.default_cache'));
     $this->assertEquals(count($config['caches']), count($container->getParameter('stash.caches')));
     $options = $container->getParameter('stash.caches.options');
     foreach ($config['caches'] as $name => $cache) {
         $cacheoptions = $options[$name];
         $this->assertArrayHasKey($name, $container->getParameter('stash.caches'));
         foreach (array('registerDoctrineAdapter', 'inMemory') as $item) {
             $this->assertEquals($cache[$item], $cacheoptions[$item]);
         }
         foreach ($cache['handlers'] as $handler) {
             $handleroptions = $cache[$handler];
             foreach ($handleroptions as $handleroptname => $handleroptvalue) {
                 $this->assertEquals($handleroptvalue, $cacheoptions[$handler][$handleroptname]);
             }
         }
     }
 }
コード例 #2
0
 public function testGetAlias()
 {
     $extension = new TedivmStashExtension();
     $this->assertEquals('stash', $extension->getAlias(), 'getAlias returns "stash"');
 }