Sha256: f85158d66d8f0804692c30db42fe9cabf00db13528a68a909cbc92bfbe995a68

Contents?: true

Size: 1.31 KB

Versions: 4

Compression:

Stored size: 1.31 KB

Contents

<?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\Console\Tests\Helper;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Helper\Dumper;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\VarDumper\Test\VarDumperTestTrait;

class DumperTest extends TestCase
{
    use VarDumperTestTrait;

    public static function setUpBeforeClass()
    {
        putenv('DUMP_LIGHT_ARRAY=1');
        putenv('DUMP_COMMA_SEPARATOR=1');
    }

    public static function tearDownAfterClass()
    {
        putenv('DUMP_LIGHT_ARRAY');
        putenv('DUMP_COMMA_SEPARATOR');
    }

    /**
     * @dataProvider provideVariables
     */
    public function testInvoke($variable)
    {
        $dumper = new Dumper($this->getMockBuilder(OutputInterface::class)->getMock());

        $this->assertDumpMatchesFormat($dumper($variable), $variable);
    }

    public function provideVariables()
    {
        return [
            [null],
            [true],
            [false],
            [1],
            [-1.5],
            ['string'],
            [[1, '2']],
            [new \stdClass()],
        ];
    }
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dependabot-composer-0.112.1 helpers/vendor/symfony/console/Tests/Helper/DumperTest.php
dependabot-composer-0.111.57 helpers/vendor/symfony/console/Tests/Helper/DumperTest.php
dependabot-composer-0.111.56 helpers/vendor/symfony/console/Tests/Helper/DumperTest.php
dependabot-composer-0.111.52 helpers/vendor/symfony/console/Tests/Helper/DumperTest.php