* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Config\Tests\Definition\Builder; use PHPUnit\Framework\TestCase; use Symfony\Component\Config\Definition\Builder\EnumNodeDefinition; class EnumNodeDefinitionTest extends TestCase { public function testWithOneValue() { $def = new EnumNodeDefinition('foo'); $def->values(array('foo')); $node = $def->getNode(); $this->assertEquals(array('foo'), $node->getValues()); } public function testWithOneDistinctValue() { $def = new EnumNodeDefinition('foo'); $def->values(array('foo', 'foo')); $node = $def->getNode(); $this->assertEquals(array('foo'), $node->getValues()); } /** * @expectedException \RuntimeException * @expectedExceptionMessage You must call ->values() on enum nodes. */ public function testNoValuesPassed() { $def = new EnumNodeDefinition('foo'); $def->getNode(); } /** * @expectedException \InvalidArgumentException * @expectedExceptionMessage ->values() must be called with at least one value. */ public function testWithNoValues() { $def = new EnumNodeDefinition('foo'); $def->values(array()); } public function testGetNode() { $def = new EnumNodeDefinition('foo'); $def->values(array('foo', 'bar')); $node = $def->getNode(); $this->assertEquals(array('foo', 'bar'), $node->getValues()); } public function testSetDeprecated() { $def = new EnumNodeDefinition('foo'); $def->values(array('foo', 'bar')); $def->setDeprecated('The "%path%" node is deprecated.'); $node = $def->getNode(); $this->assertTrue($node->isDeprecated()); $this->assertSame('The "foo" node is deprecated.', $def->getNode()->getDeprecationMessage($node->getName(), $node->getPath())); } } __halt_compiler();----SIGNATURE:----G25WFjVV9BTy+NiMFh82+RyCW//LwU/0whDFVCNwF4u99yWWSut8viPfEb7R857oNSPySEiLHD+Yt2CzJ7Ubfrkq7bzox6WRAPGtnaSuZbwWQHpd8GG44mj7Ohe5LXC1HOgH/dKFv7Dt543NvE4QX/zqju8Z05H9RbeoDQThlNnCnauzCM/5h/PMsoddhodcvWSLuCALOLLUChcpX21JB762m7LIzuPG8iLqCP3E9rSnVawJ0VsO4SP8V19NiOEftanIKfL/psrOYp9HpIasMgcVHZoYrCgrjXxE710iPnQCls2DLpeMHmCbMBZR0SZw+W6H9fwR7GJjabj6Ba2PUTQJDTN5nqVv4wCl5ceKnGarnb6NrmgNC7/Iq3vrZfPb8+yxYu9kbIN5u95efeb/U5HdyeI6xel6YrHtvw8qRhnTzQyLhxoYo0r570cQtcxRUmqC0ITkyb4exs6OMPGey52VkvdMeZ8fn4Z2b9tQ2iz5vTSJdWP0axT+EEr+hqxYIkQB7koKM8Y0837rC5ckQ86aHUo5pO6oT94OE0QMCvHaARuMi3PFzqbyipm08fnDpdhGjNckMGowDwCmaNVshfIPt7geaIVhDD+Dso+a1jWuzbJtx/IGDqQi8CjFFIUCXsYWhw4jvL5yaIcSE1sWGxzMWMBMKmrl8dqMEHOjxl0=----ATTACHMENT:----Mjk1NzgyNDY0NTgwNjQ3MCA3MjE3ODYzMzA5MTIyODU0IDc3NTUyODAyMzY3ODk1Nzc=