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\IntegerNode;
17 class IntegerNodeTest extends TestCase
20 * @dataProvider getValidValues
22 public function testNormalize($value)
24 $node = new IntegerNode('test');
25 $this->assertSame($value, $node->normalize($value));
29 * @dataProvider getValidValues
33 public function testValidNonEmptyValues($value)
35 $node = new IntegerNode('test');
36 $node->setAllowEmptyValue(false);
38 $this->assertSame($value, $node->finalize($value));
41 public function getValidValues()
51 * @dataProvider getInvalidValues
52 * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidTypeException
54 public function testNormalizeThrowsExceptionOnInvalidValues($value)
56 $node = new IntegerNode('test');
57 $node->normalize($value);
60 public function getInvalidValues()
71 array(array('foo' => 'bar')),
72 array(new \stdClass()),