Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@..

Decoded Output download

<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\VarDumper\Tests\Caster;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\PersistentCollection;
use PHPUnit\Framework\TestCase;
use Symfony\Component\VarDumper\Test\VarDumperTestTrait;

/**
 * @requires function \Doctrine\Common\Collections\ArrayCollection::__construct
 */
class DoctrineCasterTest extends TestCase
{
    use VarDumperTestTrait;

    public function testCastPersistentCollection()
    {
        $classMetadata = new ClassMetadata(__CLASS__);

        $collection = new PersistentCollection($this->createMock(EntityManagerInterface::class), $classMetadata, new ArrayCollection(['test']));

        if (property_exists(PersistentCollection::class, 'isDirty')) {
            // Collections >= 2
            $expected = <<<EODUMP
                Doctrine\ORM\PersistentCollection {
                %A
                  -backRefFieldName: null
                  -isDirty: false
                  -em: Mock_EntityManagerInterface_%s { 3}
                  -typeClass: Doctrine\ORM\Mapping\ClassMetadata { }
                %A
                EODUMP;
        } else {
            // Collections 1
            $expected = <<<EODUMP
                Doctrine\ORM\PersistentCollection {
                %A
                  -em: Mock_EntityManagerInterface_%s { 3}
                  -backRefFieldName: null
                  -typeClass: Doctrine\ORM\Mapping\ClassMetadata { }
                %A
                EODUMP;
        }

        $this->assertDumpMatchesFormat($expected, $collection);
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\VarDumper\Tests\Caster;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\PersistentCollection;
use PHPUnit\Framework\TestCase;
use Symfony\Component\VarDumper\Test\VarDumperTestTrait;

/**
 * @requires function \Doctrine\Common\Collections\ArrayCollection::__construct
 */
class DoctrineCasterTest extends TestCase
{
    use VarDumperTestTrait;

    public function testCastPersistentCollection()
    {
        $classMetadata = new ClassMetadata(__CLASS__);

        $collection = new PersistentCollection($this->createMock(EntityManagerInterface::class), $classMetadata, new ArrayCollection(['test']));

        if (property_exists(PersistentCollection::class, 'isDirty')) {
            // Collections >= 2
            $expected = <<<EODUMP
                Doctrine\ORM\PersistentCollection {
                %A
                  -backRefFieldName: null
                  -isDirty: false
                  -em: Mock_EntityManagerInterface_%s { 3}
                  -typeClass: Doctrine\ORM\Mapping\ClassMetadata { }
                %A
                EODUMP;
        } else {
            // Collections 1
            $expected = <<<EODUMP
                Doctrine\ORM\PersistentCollection {
                %A
                  -em: Mock_EntityManagerInterface_%s { 3}
                  -backRefFieldName: null
                  -typeClass: Doctrine\ORM\Mapping\ClassMetadata { }
                %A
                EODUMP;
        }

        $this->assertDumpMatchesFormat($expected, $collection);
    }
}

Function Calls

None

Variables

None

Stats

MD5 755f3f0f09be32f745b155d5614044d5
Eval Count 0
Decode Time 85 ms