PHP 8.2.30
Preview: BooleanNodeTest.php Size: 1.38 KB
/opt/cloudlinux/alt-php55/root/usr/share/pear/test/Config/Symfony/Component/Config/Tests/Definition/BooleanNodeTest.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\BooleanNode;

class BooleanNodeTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @dataProvider getValidValues
     */
    public function testNormalize($value)
    {
        $node = new BooleanNode('test');
        $this->assertSame($value, $node->normalize($value));
    }

    public function getValidValues()
    {
        return array(
            array(false),
            array(true),
        );
    }

    /**
     * @dataProvider getInvalidValues
     * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidTypeException
     */
    public function testNormalizeThrowsExceptionOnInvalidValues($value)
    {
        $node = new BooleanNode('test');
        $node->normalize($value);
    }

    public function getInvalidValues()
    {
        return array(
            array(null),
            array(''),
            array('foo'),
            array(0),
            array(1),
            array(0.0),
            array(0.1),
            array(array()),
            array(array('foo' => 'bar')),
            array(new \stdClass()),
        );
    }
}

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).