Code Duplication    Length = 15-17 lines in 2 locations

Tests/Functional/Controller/ImagineControllerTest.php 2 locations

@@ 49-63 (lines=15) @@
46
        $this->assertInstanceOf('Liip\ImagineBundle\Controller\ImagineController', $controller);
47
    }
48
49
    public function testShouldResolvePopulatingCacheFirst()
50
    {
51
        //guard
52
        $this->assertFileNotExists($this->cacheRoot.'/thumbnail_web_path/images/cats.jpeg');
53
54
        $this->client->request('GET', '/media/cache/resolve/thumbnail_web_path/images/cats.jpeg');
55
56
        $response = $this->client->getResponse();
57
58
        $this->assertInstanceOf('Symfony\Component\HttpFoundation\RedirectResponse', $response);
59
        $this->assertEquals(301, $response->getStatusCode());
60
        $this->assertEquals('http://localhost/media/cache/thumbnail_web_path/images/cats.jpeg', $response->getTargetUrl());
61
62
        $this->assertFileExists($this->cacheRoot.'/thumbnail_web_path/images/cats.jpeg');
63
    }
64
65
    public function testShouldResolveFromCache()
66
    {
@@ 65-81 (lines=17) @@
62
        $this->assertFileExists($this->cacheRoot.'/thumbnail_web_path/images/cats.jpeg');
63
    }
64
65
    public function testShouldResolveFromCache()
66
    {
67
        $this->filesystem->dumpFile(
68
            $this->cacheRoot.'/thumbnail_web_path/images/cats.jpeg',
69
            'anImageContent'
70
        );
71
72
        $this->client->request('GET', '/media/cache/resolve/thumbnail_web_path/images/cats.jpeg');
73
74
        $response = $this->client->getResponse();
75
76
        $this->assertInstanceOf('Symfony\Component\HttpFoundation\RedirectResponse', $response);
77
        $this->assertEquals(301, $response->getStatusCode());
78
        $this->assertEquals('http://localhost/media/cache/thumbnail_web_path/images/cats.jpeg', $response->getTargetUrl());
79
80
        $this->assertFileExists($this->cacheRoot.'/thumbnail_web_path/images/cats.jpeg');
81
    }
82
83
    /**
84
     * @expectedException \Symfony\Component\HttpKernel\Exception\BadRequestHttpException