12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- namespace Symfony\Component\Config\Tests\Definition;
- use PHPUnit\Framework\TestCase;
- use Symfony\Component\Config\Definition\EnumNode;
- class EnumNodeTest extends TestCase
- {
- public function testFinalizeValue()
- {
- $node = new EnumNode('foo', null, array('foo', 'bar'));
- $this->assertSame('foo', $node->finalize('foo'));
- }
-
- public function testConstructionWithNoValues()
- {
- new EnumNode('foo', null, array());
- }
- public function testConstructionWithOneValue()
- {
- $node = new EnumNode('foo', null, array('foo'));
- $this->assertSame('foo', $node->finalize('foo'));
- }
- public function testConstructionWithOneDistinctValue()
- {
- $node = new EnumNode('foo', null, array('foo', 'foo'));
- $this->assertSame('foo', $node->finalize('foo'));
- }
-
- public function testFinalizeWithInvalidValue()
- {
- $node = new EnumNode('foo', null, array('foo', 'bar'));
- $node->finalize('foobar');
- }
- }
|