Code Duplication    Length = 18-20 lines in 2 locations

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

@@ 260-277 (lines=18) @@
257
        $this->factory->buildCachedCollectionPersister($em, $persister, $mapping);
258
    }
259
260
    public function testInvalidFileLockRegionDirectoryException()
261
    {
262
        $factory = new DefaultCacheFactory($this->regionsConfig, $this->getSharedSecondLevelCacheDriverImpl());
263
264
        $this->expectException(\LogicException::class);
265
        $this->expectExceptionMessage(
266
            'If you want to use a "READ_WRITE" cache an implementation of "Doctrine\ORM\Cache\ConcurrentRegion" '
267
            . 'is required, The default implementation provided by doctrine is '
268
            . '"Doctrine\ORM\Cache\Region\FileLockRegion" if you want to use it please provide a valid directory'
269
        );
270
271
        $factory->getRegion(
272
            [
273
                'usage'   => ClassMetadata::CACHE_USAGE_READ_WRITE,
274
                'region'  => 'foo'
275
            ]
276
        );
277
    }
278
279
    public function testInvalidFileLockRegionDirectoryExceptionWithEmptyString()
280
    {
@@ 279-298 (lines=20) @@
276
        );
277
    }
278
279
    public function testInvalidFileLockRegionDirectoryExceptionWithEmptyString()
280
    {
281
        $factory = new DefaultCacheFactory($this->regionsConfig, $this->getSharedSecondLevelCacheDriverImpl());
282
283
        $factory->setFileLockRegionDirectory('');
284
285
        $this->expectException(\LogicException::class);
286
        $this->expectExceptionMessage(
287
            'If you want to use a "READ_WRITE" cache an implementation of "Doctrine\ORM\Cache\ConcurrentRegion" '
288
            . 'is required, The default implementation provided by doctrine is '
289
            . '"Doctrine\ORM\Cache\Region\FileLockRegion" if you want to use it please provide a valid directory'
290
        );
291
292
        $factory->getRegion(
293
            [
294
                'usage'   => ClassMetadata::CACHE_USAGE_READ_WRITE,
295
                'region'  => 'foo'
296
            ]
297
        );
298
    }
299
300
    public function testBuildsNewNamespacedCacheInstancePerRegionInstance()
301
    {