use PHPUnit\Framework\TestCase;
use Symfony\Component\Config\Definition\EnumNode;
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
use Symfony\Component\Config\Tests\Fixtures\TestEnum;
use Symfony\Component\Config\Tests\Fixtures\TestEnum2;
class EnumNodeTest extends TestCase
{ public function testFinalizeValue() { $node =
new EnumNode('foo', null,
['foo', 'bar', TestEnum::Bar
]);
$this->
assertSame('foo',
$node->
finalize('foo'
));
$this->
assertSame(TestEnum::Bar,
$node->
finalize(TestEnum::Bar
));
} public function testConstructionWithNoValues() { $this->
expectException(\InvalidArgumentException::
class);
$this->
expectExceptionMessage('$values must contain at least one element.'
);
new EnumNode('foo', null,
[]);
}