Code Duplication    Length = 15-15 lines in 3 locations

Tests/Functional/EventListener/InvalidationSubscriberTest.php 1 location

@@ 58-72 (lines=15) @@
55
        $client->request('POST', sprintf('/invalidate/path/%s', $statusCode));
56
    }
57
58
    public function testErrorIsNotInvalidated()
59
    {
60
        $client = static::createClient();
61
62
        $client->getContainer()->mock(
63
            'fos_http_cache.cache_manager',
64
            '\FOS\HttpCacheBundle\CacheManager'
65
        )
66
            ->shouldReceive('supports')->andReturn(true)
67
            ->shouldReceive('invalidatePath')->never()
68
            ->shouldReceive('flush')->once()
69
        ;
70
71
        $client->request('POST', '/invalidate/error');
72
    }
73
74
    public function getStatusCodesThatTriggerInvalidation()
75
    {

Tests/Functional/EventListener/TagSubscriberTest.php 2 locations

@@ 48-62 (lines=15) @@
45
        $client->request('POST', '/tag/123');
46
    }
47
48
    public function testErrorIsNotInvalidated()
49
    {
50
        $client = static::createClient();
51
52
        $client->getContainer()->mock(
53
            'fos_http_cache.cache_manager',
54
            '\FOS\HttpCacheBundle\CacheManager'
55
        )
56
            ->shouldReceive('supports')->andReturn(true)
57
            ->shouldReceive('invalidate')->never()
58
            ->shouldReceive('flush')->once()
59
        ;
60
61
        $client->request('POST', '/tag/error');
62
    }
63
64
    public function testConfigurationTagsAreSet()
65
    {
@@ 73-87 (lines=15) @@
70
        $this->assertEquals('area,area-51', $response->headers->get('X-Cache-Tags'));
71
    }
72
73
    public function testConfigurationTagsAreInvalidated()
74
    {
75
        $client = static::createClient();
76
77
        $client->getContainer()->mock(
78
            'fos_http_cache.cache_manager',
79
            '\FOS\HttpCacheBundle\CacheManager'
80
        )
81
            ->shouldReceive('supports')->andReturn(true)
82
            ->shouldReceive('invalidate')->once()->with(array('X-Cache-Tags' => '(area|area\\-51)(,.+)?$'))
83
            ->shouldReceive('flush')->once()
84
        ;
85
86
        $client->request('PUT', '/cached/51');
87
    }
88
89
    public function testManualTagging()
90
    {