Code Duplication    Length = 17-17 lines in 3 locations

eZ/Bundle/EzPublishCoreBundle/Tests/Imagine/Cache/Resolver/ProxyResolverTest.php 3 locations

@@ 38-54 (lines=17) @@
35
        $this->filter = 'medium';
36
    }
37
38
    public function testResolveUsingProxyHostWithTrailingSlash()
39
    {
40
        $hosts = ['http://ezplatform.com/'];
41
        $proxyResolver = new ProxyResolver($this->resolver, $hosts);
42
43
        $resolvedPath = 'http://ez.no/var/site/storage/images/_aliases/medium/7/4/2/0/247-1-eng-GB/img_0885.jpg';
44
45
        $this->resolver
46
            ->expects($this->once())
47
            ->method('resolve')
48
            ->with($this->path, $this->filter)
49
            ->willReturn($resolvedPath);
50
51
        $expected = 'http://ezplatform.com/var/site/storage/images/_aliases/medium/7/4/2/0/247-1-eng-GB/img_0885.jpg';
52
53
        $this->assertEquals($expected, $proxyResolver->resolve($this->path, $this->filter));
54
    }
55
56
    public function testResolveAndRemovePortUsingProxyHost()
57
    {
@@ 56-72 (lines=17) @@
53
        $this->assertEquals($expected, $proxyResolver->resolve($this->path, $this->filter));
54
    }
55
56
    public function testResolveAndRemovePortUsingProxyHost()
57
    {
58
        $hosts = ['http://ez.no'];
59
        $proxyResolver = new ProxyResolver($this->resolver, $hosts);
60
61
        $resolvedPath = 'http://ez.no:8060/var/site/storage/images/_aliases/medium/7/4/2/0/247-1-eng-GB/img_0885.jpg';
62
63
        $this->resolver
64
            ->expects($this->once())
65
            ->method('resolve')
66
            ->with($this->path, $this->filter)
67
            ->willReturn($resolvedPath);
68
69
        $expected = 'http://ez.no/var/site/storage/images/_aliases/medium/7/4/2/0/247-1-eng-GB/img_0885.jpg';
70
71
        $this->assertEquals($expected, $proxyResolver->resolve($this->path, $this->filter));
72
    }
73
74
    public function testResolveAndRemovePortUsingProxyHostWithTrailingSlash()
75
    {
@@ 74-90 (lines=17) @@
71
        $this->assertEquals($expected, $proxyResolver->resolve($this->path, $this->filter));
72
    }
73
74
    public function testResolveAndRemovePortUsingProxyHostWithTrailingSlash()
75
    {
76
        $hosts = ['http://ez.no'];
77
        $proxyResolver = new ProxyResolver($this->resolver, $hosts);
78
79
        $resolvedPath = 'http://ezplatform.com:8080/var/site/storage/images/_aliases/medium/7/4/2/0/247-1-eng-GB/img_0885.jpg';
80
81
        $this->resolver
82
            ->expects($this->once())
83
            ->method('resolve')
84
            ->with($this->path, $this->filter)
85
            ->willReturn($resolvedPath);
86
87
        $expected = 'http://ez.no/var/site/storage/images/_aliases/medium/7/4/2/0/247-1-eng-GB/img_0885.jpg';
88
89
        $this->assertEquals($expected, $proxyResolver->resolve($this->path, $this->filter));
90
    }
91
}
92