public function testNormalizeHandlerToDriverConfig()
 {
     $testData = array('handlers' => 'TheCacheSettings');
     $returnedData = Configuration::normalizeHandlerToDriverConfig($testData);
     $this->assertInternalType('array', $returnedData, 'Returns array.');
     $this->assertArrayHasKey('drivers', $returnedData, 'Normalization converts "handlers" to "drivers"');
     $this->assertEquals($testData['handlers'], $returnedData['drivers'], 'Normalization converts "handlers" to "drivers"');
 }
 /**
  * Creates the driver configuration tree.
  *
  * @return \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition|\Symfony\Component\Config\Definition\Builder\NodeDefinition
  */
 public function getCachesNode()
 {
     $drivers = array_keys(DriverList::getAvailableDrivers());
     $treeBuilder = new TreeBuilder();
     $node = $treeBuilder->root('caches');
     $childNode = $node->fixXmlConfig('handler')->fixXmlConfig('driver')->beforeNormalization()->ifTrue(function ($v) {
         return is_array($v) && array_key_exists('handlers', $v);
     })->then(function ($v) {
         return Configuration::normalizeHandlerToDriverConfig($v);
     })->end()->requiresAtLeastOneElement()->useAttributeAsKey('name')->prototype('array')->children()->arrayNode('drivers')->requiresAtLeastOneElement()->defaultValue(array('FileSystem'))->prototype('scalar')->validate()->ifNotInArray($drivers)->thenInvalid('A driver of that name is not registered.')->end()->end()->end()->booleanNode('registerDoctrineAdapter')->defaultFalse()->end()->booleanNode('registerSessionHandler')->defaultFalse()->end()->booleanNode('inMemory')->defaultTrue()->end()->scalarNode('logger')->defaultNull()->end();
     foreach ($drivers as $driver) {
         if ($driver !== 'Composite') {
             $this->addDriverSettings($driver, $childNode);
         }
     }
     $childNode->end();
     return $node;
 }