Skip to content

Commit

Permalink
Test that reflects the issue described in http://www.doctrine-project…
Browse files Browse the repository at this point in the history
  • Loading branch information
guiwoda committed Nov 24, 2015
1 parent 91ce788 commit e2cdf2f
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3967Test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace Doctrine\Tests\ORM\Functional\Ticket;

use Doctrine\Tests\Models\Cache\Country;
use Doctrine\Tests\ORM\Functional\SecondLevelCacheAbstractTest;

class DDC3967Test extends SecondLevelCacheAbstractTest
{
protected function setUp()
{
parent::setUp();

$this->loadFixturesCountries();
$this->_em->getCache()->evictEntityRegion(Country::CLASSNAME);
$this->_em->clear();
}

public function testIdentifierCachedWithProperType()
{
// First time, loaded from database
$this->_em->find(Country::CLASSNAME, "1");
$this->_em->clear();

// Second time, loaded from cache
/** @var Country $country */
$country = $this->_em->find(Country::CLASSNAME, "1");

// Identifier type should be integer
$this->assertTrue($country->getId() === 1);
}
}

0 comments on commit e2cdf2f

Please sign in to comment.