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\Builder;
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\Config\Definition\Builder\BooleanNodeDefinition;
17 class BooleanNodeDefinitionTest extends TestCase
20 * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidDefinitionException
21 * @expectedExceptionMessage ->cannotBeEmpty() is not applicable to BooleanNodeDefinition.
23 public function testCannotBeEmptyThrowsAnException()
25 $def = new BooleanNodeDefinition('foo');
26 $def->cannotBeEmpty();
29 public function testSetDeprecated()
31 $def = new BooleanNodeDefinition('foo');
32 $def->setDeprecated('The "%path%" node is deprecated.');
34 $node = $def->getNode();
36 $this->assertTrue($node->isDeprecated());
37 $this->assertSame('The "foo" node is deprecated.', $node->getDeprecationMessage($node->getName(), $node->getPath()));