<commit_before><?php
declare(strict_types=1);

namespace Doctrine\Tests\ORM\Functional\Ticket;

use Doctrine\ORM\Annotation as ORM;

final class GH7067Test extends \Doctrine\Tests\OrmFunctionalTestCase
{
    public function setUp() : void
    {
        $this->enableSecondLevelCache();
        parent::setUp();

        $this->setUpEntitySchema([GH7067Entity::class]);
    }

    /**
     * @group 7067
     */
    public function testSLCWithVersion() : void
    {
        $entity             = new GH7067Entity();
        $entity->lastUpdate = new \DateTime();

        $this->em->persist($entity);
        $this->em->flush();
        $this->em->clear();

        /** @var GH7067Entity $notCached */
        $notCached = $this->em->find(GH7067Entity::class, $entity->id);

        self::assertNotNull($notCached->version, 'Version already cached by persister above, it must be not null');

        $notCached->lastUpdate = new \DateTime();

        $this->em->flush();
        $this->em->clear();
    }
}

/**
 * @ORM\Entity()
 * @ORM\Cache(usage="NONSTRICT_READ_WRITE")
 */
class GH7067Entity
{
    /**
     * @ORM\Id
     * @ORM\GeneratedValue
     * @ORM\Column(type="integer")
     */
    public $id;

    /**
     * @ORM\Column(type="datetime")
     *
     * @var \DateTime
     */
    public $lastUpdate;
<commit_msg>Fix incorrect value in L2C+lock test<commit_after><?php
declare(strict_types=1);

namespace Doctrine\Tests\ORM\Functional\Ticket;

use Doctrine\ORM\Annotation as ORM;

final class GH7067Test extends \Doctrine\Tests\OrmFunctionalTestCase
{
    public function setUp() : void
    {
        $this->enableSecondLevelCache();
        parent::setUp();

        $this->setUpEntitySchema([GH7067Entity::class]);
    }

    /**
     * @group 7067
     */
    public function testSLCWithVersion() : void
    {
        $entity             = new GH7067Entity();
        $entity->lastUpdate = new \DateTime();

        $this->em->persist($entity);
        $this->em->flush();
        $this->em->clear();

        /** @var GH7067Entity $notCached */
        $notCached = $this->em->find(GH7067Entity::class, $entity->id);

        self::assertNotNull($notCached->version, 'Version already cached by persister above, it must be not null');

        $notCached->lastUpdate = new \DateTime('+1 second');

        $this->em->flush();
        $this->em->clear();
    }
}

/**
 * @ORM\Entity()
 * @ORM\Cache(usage="NONSTRICT_READ_WRITE")
 */
class GH7067Entity
{
    /**
     * @ORM\Id
     * @ORM\GeneratedValue
     * @ORM\Column(type="integer")
     */
    public $id;

    /**
     * @ORM\Column(type="datetime")
     *
     * @var \DateTime
     */
    public $lastUpdate;

{'fraction_non_alphanumeric': 0.16256524981357195, 'fraction_numerical': 0.02237136465324385, 'mean_word_length': 2.4708926261319535, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7388996', 'n_tokens_mistral': 908, 'n_tokens_neox': 849, 'n_words': 150}