<commit_before><?php

namespace Doctrine\Tests\ORM\Functional\Ticket;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Tests\Models\CMS\CmsEmployee;

require_once __DIR__ . '/../../../TestInit.php';

/**
 * @group DDC-1238
 */
class DDC1238Test extends \Doctrine\Tests\OrmFunctionalTestCase
{
    public function setUp()
    {
        parent::setUp();
        try {
            $this->_schemaTool->createSchema(array(
                $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1238User'),
                #$this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1238UserBase'),
                $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1238UserSuperClass'),
            ));
        } catch(\PDOException $e) {
            
        }
    }
    
    public function testIssue()
    {
        $user = new DDC1238User;
        $user->setName("test");
        
        $this->_em->persist($user);
        $this->_em->flush();
        $this->_em->clear();
        
        for ($i = 0; $i < 5; $i++) {
            $user = $this->_em->getReference(__NAMESPACE__ . '\\DDC1238User', $user->getId());
        }
        
        $this->assertInstanceOf(__NAMESPACE__ . '\\DDC1238User', $user);
    }
}

/**
 * @MappedSuperclass
 */
abstract class DDC1238UserSuperClass
{
    /**
     * @Column
     * @var string
     */
    private $name;
    
    public function getName()
    {
        return $this->name;
    }

    public function setName($name)
    {<commit_msg>DDC-1238 - Reproducible case, its correct through<commit_after><?php

namespace Doctrine\Tests\ORM\Functional\Ticket;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Tests\Models\CMS\CmsEmployee;

require_once __DIR__ . '/../../../TestInit.php';

/**
 * @group DDC-1238
 */
class DDC1238Test extends \Doctrine\Tests\OrmFunctionalTestCase
{
    public function setUp()
    {
        parent::setUp();
        try {
            $this->_schemaTool->createSchema(array(
                $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1238User'),
                #$this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1238UserBase'),
                $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC1238UserSuperClass'),
            ));
        } catch(\PDOException $e) {
            
        }
    }
    
    public function testIssue()
    {
        $user = new DDC1238User;
        $user->setName("test");
        
        $this->_em->persist($user);
        $this->_em->flush();
        $this->_em->clear();
        
        $user = $this->_em->getReference(__NAMESPACE__ . '\\DDC1238User', $user->getId());
        $this->_em->clear();
        
        $userId = $user->getId();
        
        $this->assertNull($userId, "This proxy is unitialized and was cleared from the identity map, so no loading possible.");
    }
}

/**
 * @MappedSuperclass
 */
abstract class DDC1238UserSuperClass
{
    /**
     * @Column
     * @var string
     */
    private $name;
    
    public function getName()
    {
        return $this->name;
    }

    public function setName($name)
    {
{'fraction_non_alphanumeric': 0.15237166991552956, 'fraction_numerical': 0.024041585445094216, 'mean_word_length': 2.075924075924076, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 46, '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': '934644', 'n_tokens_mistral': 999, 'n_tokens_neox': 968, 'n_words': 155}