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/src/Symfony/Framework/FoundationBundle/Tests/DependencyInjection/WebExtensionTest.php

57 lines
2.6 KiB
PHP
Raw Normal View History

<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Framework\FoundationBundle\Tests\DependencyInjection;
use Symfony\Framework\FoundationBundle\Tests\TestCase;
use Symfony\Framework\FoundationBundle\DependencyInjection\WebExtension;
use Symfony\Components\DependencyInjection\BuilderConfiguration;
class WebExtensionTest extends TestCase
{
2010-06-16 13:19:46 +01:00
public function testConfigLoad()
{
$configuration = new BuilderConfiguration();
$loader = new WebExtension();
2010-06-16 13:19:46 +01:00
$configuration = $loader->configLoad(array(), $configuration);
$this->assertEquals('Symfony\\Framework\\FoundationBundle\\Listener\\RequestParser', $configuration->getParameter('request_parser.class'), '->webLoad() loads the web.xml file if not already loaded');
2010-06-16 13:19:46 +01:00
$configuration = new BuilderConfiguration();
$loader = new WebExtension();
$configuration = $loader->configLoad(array('profiler' => true), $configuration);
$this->assertEquals('Symfony\\Framework\\FoundationBundle\\Profiler', $configuration->getParameter('profiler.class'), '->configLoad() loads the collectors.xml file if not already loaded');
2010-06-16 13:19:46 +01:00
$this->assertFalse($configuration->hasParameter('debug.toolbar.class'), '->configLoad() does not load the toolbar.xml file');
$configuration = $loader->configLoad(array('toolbar' => true), $configuration);
$this->assertEquals('Symfony\\Components\\HttpKernel\\Listener\\WebDebugToolbar', $configuration->getParameter('debug.toolbar.class'), '->configLoad() loads the collectors.xml file if the toolbar option is given');
}
public function testUserLoad()
{
$configuration = new BuilderConfiguration();
$loader = new WebExtension();
$configuration = $loader->userLoad(array(), $configuration);
$this->assertEquals('Symfony\\Framework\\FoundationBundle\\User', $configuration->getParameter('user.class'), '->userLoad() loads the user.xml file if not already loaded');
}
public function testTemplatingLoad()
{
$configuration = new BuilderConfiguration();
$loader = new WebExtension();
$configuration = $loader->templatingLoad(array(), $configuration);
$this->assertEquals('Symfony\\Framework\\FoundationBundle\\Templating\\Engine', $configuration->getParameter('templating.engine.class'), '->templatingLoad() loads the templating.xml file if not already loaded');
}
}