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

SecondLevelCacheLoadAfterClearTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testAssociationLoadAfterClear() 0 17 1
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