This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/tests/Symfony/Tests/Component
Victor Berchet 1e0ed22c55 [Config] Component refactoring
The Config component API have changed and the extension configuration files must be updated accordingly:

1. Array nodes must enclosed their children definition in ->children() ... ->end() calls:

Before:

    $treeBuilder->root('zend', 'array')
        ->arrayNode('logger')
            ->scalarNode('priority')->defaultValue('INFO')->end()
            ->booleanNode('log_errors')->defaultFalse()->end()
        ->end();

After:

    $treeBuilder->root('zend', 'array')
        ->children()
            ->arrayNode('logger')
                ->children()
                    ->scalarNode('priority')->defaultValue('INFO')->end()
                    ->booleanNode('log_errors')->defaultFalse()->end()
                ->end()
            ->end()
        ->end();

2. The 'builder' method (in NodeBuilder) has been dropped in favor of an 'append' method (in ArrayNodeDefinition)

Before:

    $treeBuilder->root('doctrine', 'array')
        ->arrayNode('dbal')
            ->builder($this->getDbalConnectionsNode())
        ->end();

After:

    $treeBuilder->root('doctrine', 'array')
        ->children()
            ->arrayNode('dbal')
                ->append($this->getDbalConnectionsNode())
            ->end()
        ->end();

3. The root of a TreeBuilder is now an NodeDefinition (and most probably an ArrayNodeDefinition):

Before:

    $root = $treeBuilder->root('doctrine', 'array');
    $this->addDbalSection($root);

    public function addDbalSection(NodeBuilder $node)
    {
        ...
    }

After:

    $root = $treeBuilder->root('doctrine', 'array');
    $this->addDbalSection($root);

    public function addDbalSection(ArrayNodeDefinition $node)
    {
        ...
    }

4. The NodeBuilder API has changed (this is seldom used):

Before:

    $node = new NodeBuilder('connections', 'array');

After:

The recommended way is to use a tree builder:

    $treeBuilder = new TreeBuilder();
    $node = $treeBuilder->root('connections', 'array');

An other way would be:

    $builder = new NodeBuilder();
    $node = $builder->node('connections', 'array');

Some notes:

- Tree root nodes should most always be array nodes, so this as been made the default:

    $treeBuilder->root('doctrine', 'array') is equivalent to $treeBuilder->root('doctrine')

- There could be more than one ->children() ... ->end() sections. This could help with the readability:

    $treeBuilder->root('doctrine')
        ->children()
            ->scalarNode('default_connection')->end()
        ->end()
        ->fixXmlConfig('type')
        ->children()
            ->arrayNode('types')
                ....
            ->end()
        ->end()
2011-03-17 16:26:15 +01:00
..
BrowserKit replaced symfony-project.org by symfony.com 2011-03-06 12:40:06 +01:00
ClassLoader replaced symfony-project.org by symfony.com 2011-03-06 12:40:06 +01:00
Config [Config] Component refactoring 2011-03-17 16:26:15 +01:00
Console if proper style not found, then this is a tag - no need in Exception 2011-03-12 11:55:44 +02:00
CssSelector replaced symfony-project.org by symfony.com 2011-03-06 12:40:06 +01:00
DependencyInjection Added matching test to mirror the xml file loader test 2011-03-16 08:56:26 -05:00
DomCrawler replaced symfony-project.org by symfony.com 2011-03-06 12:40:06 +01:00
EventDispatcher replaced symfony-project.org by symfony.com 2011-03-06 12:40:06 +01:00
Finder replaced symfony-project.org by symfony.com 2011-03-06 12:40:06 +01:00
Form [HttpFoundation] UploadedFile::getOriginalName is now overriding getName 2011-03-09 17:26:08 +01:00
HttpFoundation [HttpFoundation] fixed ApacheRequest, added tests 2011-03-16 06:13:01 -07:00
HttpKernel fixed previous commit 2011-03-16 21:39:30 +01:00
Locale [Locale] updated the tests so that we can be green again (previous version always add 2 skipped tests) 2011-03-17 12:20:37 +01:00
Routing [Routing] Fixed compiling routes with empty string or 0 as default parameter value. 2011-03-13 18:13:41 +01:00
Security [Security] small performance optimization 2011-03-14 17:41:33 +01:00
Serializer [Serializer] fixed XmlEncoder for single char tags 2011-03-12 15:23:30 +01:00
Templating [Templating] introduced concept of asset packages so base URLs and asset versions can be set more granularly 2011-03-08 08:31:39 -08:00
Translation replaced symfony-project.org by symfony.com 2011-03-06 12:40:06 +01:00
Validator replaced symfony-project.org by symfony.com 2011-03-06 12:40:06 +01:00
Yaml replaced symfony-project.org by symfony.com 2011-03-06 12:40:06 +01:00