ConfigurationTest.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Bundle\WebProfilerBundle\Tests\DependencyInjection;
  11. use Symfony\Bundle\WebProfilerBundle\DependencyInjection\Configuration;
  12. use Symfony\Component\Config\Definition\Processor;
  13. class ConfigurationTest extends \PHPUnit_Framework_TestCase
  14. {
  15. /**
  16. * @dataProvider getDebugModes
  17. */
  18. public function testConfigTree($options, $results)
  19. {
  20. $processor = new Processor();
  21. $configuration = new Configuration(array());
  22. $config = $processor->processConfiguration($configuration, array($options));
  23. $this->assertEquals($results, $config);
  24. }
  25. public function getDebugModes()
  26. {
  27. return array(
  28. array(array(), array('intercept_redirects' => false, 'toolbar' => false, 'position' => 'bottom')),
  29. array(array('intercept_redirects' => true), array('intercept_redirects' => true, 'toolbar' => false, 'position' => 'bottom')),
  30. array(array('intercept_redirects' => false), array('intercept_redirects' => false, 'toolbar' => false, 'position' => 'bottom')),
  31. array(array('toolbar' => true), array('intercept_redirects' => false, 'toolbar' => true, 'position' => 'bottom')),
  32. array(array('position' => 'top'), array('intercept_redirects' => false, 'toolbar' => false, 'position' => 'top')),
  33. );
  34. }
  35. }