ConfigurationTest.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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->assertTrue($config['options']['confirm_exit']);
  21. }
  22. public function testOptionsWithInvalidFormat()
  23. {
  24. $this->setExpectedException('Symfony\Component\Config\Definition\Exception\InvalidTypeException');
  25. $processor = new Processor();
  26. $config = $processor->processConfiguration(new Configuration(), array(array(
  27. 'options' => array(
  28. 'html5_validate' => '1'
  29. )
  30. )));
  31. }
  32. }