Code Duplication    Length = 15-16 lines in 2 locations

test/unit/Exception/CacheExceptionTest.php 2 locations

@@ 16-30 (lines=15) @@
13
 */
14
final class CacheExceptionTest extends TestCase
15
{
16
    public function testFromNonClearableCache()
17
    {
18
        /** @var DoctrineCache|\PHPUnit_Framework_MockObject_MockObject $doctrineCache */
19
        $doctrineCache = $this->createMock(DoctrineCache::class);
20
21
        $exception = CacheException::fromNonClearableCache($doctrineCache);
22
23
        self::assertInstanceOf(CacheException::class, $exception);
24
        self::assertInstanceOf(PsrCacheException::class, $exception);
25
26
        self::assertStringMatchesFormat(
27
            'The given cache %s was not clearable, but you tried to use a feature that requires a clearable cache.',
28
            $exception->getMessage()
29
        );
30
    }
31
32
    public function testFromNonMultiOperationCache()
33
    {
@@ 32-47 (lines=16) @@
29
        );
30
    }
31
32
    public function testFromNonMultiOperationCache()
33
    {
34
        /** @var DoctrineCache|\PHPUnit_Framework_MockObject_MockObject $doctrineCache */
35
        $doctrineCache = $this->createMock(DoctrineCache::class);
36
37
        $exception = CacheException::fromNonMultiOperationCache($doctrineCache);
38
39
        self::assertInstanceOf(CacheException::class, $exception);
40
        self::assertInstanceOf(PsrCacheException::class, $exception);
41
42
        self::assertStringMatchesFormat(
43
            'The given cache %s does not support multiple operations, '
44
            . 'but you tried to use a feature that requires a multi-operation cache.',
45
            $exception->getMessage()
46
        );
47
    }
48
}
49