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