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\FloatNode;
17 class FloatNodeTest extends TestCase
20 * @dataProvider getValidValues
22 public function testNormalize($value)
24 $node = new FloatNode('test');
25 $this->assertSame($value, $node->normalize($value));
29 * @dataProvider getValidValues
33 public function testValidNonEmptyValues($value)
35 $node = new FloatNode('test');
36 $node->setAllowEmptyValue(false);
38 $this->assertSame($value, $node->finalize($value));
41 public function getValidValues()
48 // Integer are accepted too, they will be cast
56 * @dataProvider getInvalidValues
57 * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidTypeException
59 public function testNormalizeThrowsExceptionOnInvalidValues($value)
61 $node = new FloatNode('test');
62 $node->normalize($value);
65 public function getInvalidValues()
74 array(array('foo' => 'bar')),
75 array(new \stdClass()),