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 e3627f1
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3967Test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?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()
{
$country = array_pop($this->countries);
$id = $country->getId();

// First time, loaded from database
$this->_em->find(Country::CLASSNAME, "$id");
$this->_em->clear();

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

// Identifier type should be integer
$this->assertSame($country->getId(), $id);
}
}

0 comments on commit e3627f1

Please sign in to comment.