PHP 8.2.30
Preview: EnumNodeTest.php Size: 1.13 KB
/opt/cloudlinux/alt-php55/root/usr/share/pear/test/Config/Symfony/Component/Config/Tests/Definition/EnumNodeTest.php

<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * 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;

use Symfony\Component\Config\Definition\EnumNode;

class EnumNodeTest extends \PHPUnit_Framework_TestCase
{
    public function testFinalizeValue()
    {
        $node = new EnumNode('foo', null, array('foo', 'bar'));
        $this->assertSame('foo', $node->finalize('foo'));
    }

    /**
     * @expectedException \InvalidArgumentException
     */
    public function testConstructionWithOneValue()
    {
        new EnumNode('foo', null, array('foo', 'foo'));
    }

    /**
     * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
     * @expectedExceptionMessage The value "foobar" is not allowed for path "foo". Permissible values: "foo", "bar"
     */
    public function testFinalizeWithInvalidValue()
    {
        $node = new EnumNode('foo', null, array('foo', 'bar'));
        $node->finalize('foobar');
    }
}

Directory Contents

Dirs: 2 × Files: 10

Name Size Perms Modified Actions
Builder DIR
- drwxr-xr-x 2024-03-03 22:54:40
Edit Download
Dumper DIR
- drwxr-xr-x 2024-03-03 22:54:40
Edit Download
4.79 KB lrw-r--r-- 2019-12-18 11:24:05
Edit Download
1.38 KB lrw-r--r-- 2019-12-18 11:24:05
Edit Download
1.13 KB lrw-r--r-- 2019-12-18 11:24:05
Edit Download
2.08 KB lrw-r--r-- 2019-12-18 11:24:05
Edit Download
1.51 KB lrw-r--r-- 2019-12-18 11:24:05
Edit Download
1.41 KB lrw-r--r-- 2019-12-18 11:24:05
Edit Download
5.06 KB lrw-r--r-- 2019-12-18 11:24:05
Edit Download
6.24 KB lrw-r--r-- 2019-12-18 11:24:05
Edit Download
6.74 KB lrw-r--r-- 2019-12-18 11:24:05
Edit Download
1.38 KB lrw-r--r-- 2019-12-18 11:24:05
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).