for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Doctrine\Tests\ORM\Functional\Ticket;
use Doctrine\Tests\Models\GH7505\AbstractResponse;
use Doctrine\Tests\Models\GH7505\ArrayResponse;
use Doctrine\Tests\Models\GH7505\TextResponse;
use Doctrine\Tests\OrmFunctionalTestCase;
final class GH7505Test extends OrmFunctionalTestCase
{
/**
* {@inheritDoc}
*/
protected function setUp(): void
$this->useModelSet('gh7505');
parent::setUp();
}
public function testSimpleArrayTypeHydratedCorrectly(): void
$arrayResponse = new ArrayResponse();
$this->em->persist($arrayResponse);
$textResponse = new TextResponse();
$this->em->persist($textResponse);
$this->em->flush();
$this->em->clear();
$repository = $this->em->getRepository(AbstractResponse::class);
/** @var ArrayResponse $arrayResponse */
$arrayResponse = $repository->find($arrayResponse->id);
static::assertEquals($arrayResponse->value, []);
/** @var TextResponse $arrayResponse */
$textResponse = $repository->find($textResponse->id);
static::assertEquals($textResponse->value, null);