|
@@ -0,0 +1,41 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+/*
|
|
|
+ * This file is part of the Sonata package.
|
|
|
+ *
|
|
|
+ * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
|
|
|
+ *
|
|
|
+ * For the full copyright and license information, please view the LICENSE
|
|
|
+ * file that was distributed with this source code.
|
|
|
+ */
|
|
|
+
|
|
|
+namespace Sonata\AdminBundle\Tests;
|
|
|
+
|
|
|
+use Sonata\AdminBundle\DependencyInjection\Configuration;
|
|
|
+use Symfony\Component\Config\Definition\Processor;
|
|
|
+
|
|
|
+class ConfigurationTest extends \PHPUnit_Framework_TestCase
|
|
|
+{
|
|
|
+ public function testOptions()
|
|
|
+ {
|
|
|
+ $processor = new Processor();
|
|
|
+
|
|
|
+ $config = $processor->processConfiguration(new Configuration(), array());
|
|
|
+
|
|
|
+ $this->assertTrue($config['options']['html5_validate']);
|
|
|
+ $this->assertTrue($config['options']['confirm_exit']);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function testOptionsWithInvalidFormat()
|
|
|
+ {
|
|
|
+ $this->setExpectedException('Symfony\Component\Config\Definition\Exception\InvalidTypeException');
|
|
|
+
|
|
|
+ $processor = new Processor();
|
|
|
+
|
|
|
+ $config = $processor->processConfiguration(new Configuration(), array(array(
|
|
|
+ 'options' => array(
|
|
|
+ 'html5_validate' => '1'
|
|
|
+ )
|
|
|
+ )));
|
|
|
+ }
|
|
|
+}
|