Code Duplication    Length = 18-18 lines in 2 locations

tests/Doctrine/Tests/ORM/Cache/DefaultCacheFactoryTest.php 2 locations

@@ 227-244 (lines=18) @@
224
        self::assertInstanceOf(NonStrictReadWriteCachedCollectionPersister::class, $cachedPersister);
225
    }
226
227
    public function testInheritedEntityCacheRegion()
228
    {
229
        $em         = $this->em;
230
        $metadata1  = clone $em->getClassMetadata(AttractionContactInfo::class);
231
        $metadata2  = clone $em->getClassMetadata(AttractionLocationInfo::class);
232
        $persister1 = new BasicEntityPersister($em, $metadata1);
233
        $persister2 = new BasicEntityPersister($em, $metadata2);
234
        $factory    = new DefaultCacheFactory($this->regionsConfig, $this->getSharedSecondLevelCacheDriverImpl());
235
236
        $cachedPersister1 = $factory->buildCachedEntityPersister($em, $persister1, $metadata1);
237
        $cachedPersister2 = $factory->buildCachedEntityPersister($em, $persister2, $metadata2);
238
239
        self::assertInstanceOf(CachedEntityPersister::class, $cachedPersister1);
240
        self::assertInstanceOf(CachedEntityPersister::class, $cachedPersister2);
241
242
        self::assertNotSame($cachedPersister1, $cachedPersister2);
243
        self::assertSame($cachedPersister1->getCacheRegion(), $cachedPersister2->getCacheRegion());
244
    }
245
246
    public function testCreateNewCacheDriver()
247
    {
@@ 246-263 (lines=18) @@
243
        self::assertSame($cachedPersister1->getCacheRegion(), $cachedPersister2->getCacheRegion());
244
    }
245
246
    public function testCreateNewCacheDriver()
247
    {
248
        $em         = $this->em;
249
        $metadata1  = clone $em->getClassMetadata(State::class);
250
        $metadata2  = clone $em->getClassMetadata(City::class);
251
        $persister1 = new BasicEntityPersister($em, $metadata1);
252
        $persister2 = new BasicEntityPersister($em, $metadata2);
253
        $factory    = new DefaultCacheFactory($this->regionsConfig, $this->getSharedSecondLevelCacheDriverImpl());
254
255
        $cachedPersister1 = $factory->buildCachedEntityPersister($em, $persister1, $metadata1);
256
        $cachedPersister2 = $factory->buildCachedEntityPersister($em, $persister2, $metadata2);
257
258
        self::assertInstanceOf(CachedEntityPersister::class, $cachedPersister1);
259
        self::assertInstanceOf(CachedEntityPersister::class, $cachedPersister2);
260
261
        self::assertNotSame($cachedPersister1, $cachedPersister2);
262
        self::assertNotSame($cachedPersister1->getCacheRegion(), $cachedPersister2->getCacheRegion());
263
    }
264
265
    public function testBuildCachedEntityPersisterNonStrictException()
266
    {