4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Config\Tests\Definition;
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\Config\Definition\BooleanNode;
17 class BooleanNodeTest extends TestCase
20 * @dataProvider getValidValues
22 public function testNormalize($value)
24 $node = new BooleanNode('test');
25 $this->assertSame($value, $node->normalize($value));
29 * @dataProvider getValidValues
33 public function testValidNonEmptyValues($value)
35 $node = new BooleanNode('test');
36 $node->setAllowEmptyValue(false);
38 $this->assertSame($value, $node->finalize($value));
41 public function getValidValues()
50 * @dataProvider getInvalidValues
51 * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidTypeException
53 public function testNormalizeThrowsExceptionOnInvalidValues($value)
55 $node = new BooleanNode('test');
56 $node->normalize($value);
59 public function getInvalidValues()
70 array(array('foo' => 'bar')),
71 array(new \stdClass()),