ConfigurationTest.php 1.2 KB

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