Completed
Pull Request — 2.6 (#7200)
by Jan
09:51
created

testAssociationLoadAfterClear()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 9
nc 1
nop 0
dl 0
loc 17
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Doctrine\Tests\ORM\Functional;
4
5
use Doctrine\ORM\PersistentCollection;
6
use Doctrine\Tests\Models\Cache\Attraction;
7
use Doctrine\Tests\Models\Cache\Bar;
8
use Doctrine\Tests\Models\Cache\Beach;
9
use Doctrine\Tests\Models\Cache\City;
10
use Doctrine\Tests\Models\Cache\Restaurant;
11
12
class SecondLevelCacheLoadAfterClearTest extends SecondLevelCacheAbstractTest
13
{
14
15
    public function testAssociationLoadAfterClear()
16
    {
17
        $this->loadFixturesCountries();
18
        $this->loadFixturesStates();
19
        $this->loadFixturesCities();
20
        $this->loadFixturesAttractions();
21
22
        $cityId = $this->cities[0]->getId();
23
24
        $this->_em->clear();
25
26
        /** @var City $city */
27
        $city = $this->_em->find(City::class, $cityId);
28
29
        $this->_em->clear();
30
31
        $this->assertNotEmpty($city->getAttractions()->toArray());
32
    }
33
34
}
35