ConfigurationTest.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /*
  3. * This file is part of the Sonata package.
  4. *
  5. * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
  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 Sonata\AdminBundle\Tests;
  11. use Sonata\AdminBundle\DependencyInjection\Configuration;
  12. use Symfony\Component\Config\Definition\Processor;
  13. class ConfigurationTest extends \PHPUnit_Framework_TestCase
  14. {
  15. public function testOptions()
  16. {
  17. $processor = new Processor();
  18. $config = $processor->processConfiguration(new Configuration(), array());
  19. $this->assertTrue($config['options']['html5_validate']);
  20. $this->assertNull($config['options']['pager_links']);
  21. $this->assertTrue($config['options']['confirm_exit']);
  22. }
  23. public function testOptionsWithInvalidFormat()
  24. {
  25. $this->setExpectedException('Symfony\Component\Config\Definition\Exception\InvalidTypeException');
  26. $processor = new Processor();
  27. $config = $processor->processConfiguration(new Configuration(), array(array(
  28. 'options' => array(
  29. 'html5_validate' => '1'
  30. )
  31. )));
  32. }
  33. }