for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Doctrine\Tests\ORM\Functional\Ticket;
use Doctrine\DBAL\Types\Type as DBALType;
use Doctrine\Tests\DbalTypes\GH5804Type;
use Doctrine\Tests\Models\GH5804\GH5804Article;
use Doctrine\Tests\OrmFunctionalTestCase;
/**
* @group 6402
*/
class GH5804Test extends OrmFunctionalTestCase
{
protected function setUp()
$this->useModelSet('gh5804');
$this->registerType(GH5804Type::class);
parent::setUp();
}
* @group GH-5804
public function testTextColumnSaveAndRetrieve2()
$firstArticle = new GH5804Article;
$firstArticle->text = 'Max';
$this->_em->persist($firstArticle);
$this->_em->flush();
self::assertSame(1, $firstArticle->version);
$firstArticle->text = 'Moritz';
self::assertSame(2, $firstArticle->version);
* @param string $className
*
* @throws \Doctrine\DBAL\DBALException
* @return void
private function registerType(string $className)
$type = constant($className . '::NAME');
if (DBALType::hasType($type)) {
DBALType::overrideType($type, $className);
return;
DBALType::addType($type, $className);