PersistentCollection example

/** * @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)$classMetadatanew ArrayCollection(['test']));

        $expected = <<<EODUMP Doctrine\ORM\PersistentCollection { %A -em: Mock_EntityManagerInterface_%s { …3} -backRefFieldName: null -typeClass: Doctrine\ORM\Mapping\ClassMetadata { …} %A EODUMP;

        $this->assertDumpMatchesFormat($expected$collection);
    }
Home | Imprint | This part of the site doesn't use cookies.