コード例 #1
0
 public function testProxyCallAndRewriteReturnedUrlEvenSchemesDiffersOnResolve()
 {
     $expectedPath = '/foo/bar/bazz.png';
     $expectedFilter = 'test';
     $this->primaryResolver->expects($this->once())->method('resolve')->with($expectedPath, $expectedFilter)->will($this->returnValue('http://foo.com/thumbs/foo/bar/bazz.png'));
     $result = $this->resolver->resolve($expectedPath, $expectedFilter);
     $this->assertEquals('http://images.example.com/thumbs/foo/bar/bazz.png', $result);
 }
コード例 #2
0
ファイル: ProxyResolverTest.php プロジェクト: raphydev/onep
 public function testProxyCallAndRewriteReturnedUrlWithRegExpOnResolve()
 {
     $expectedPath = '/foo/bar/bazz.png';
     $expectedFilter = 'test';
     $this->primaryResolver->expects($this->once())->method('resolve')->with($expectedPath, $expectedFilter)->will($this->returnValue('http://foo.com/thumbs/foo/bar/bazz.png'));
     $this->resolver = new ProxyResolver($this->primaryResolver, array('regexp/http:\\/\\/.*?\\//' => 'http://bar.com/'));
     $result = $this->resolver->resolve($expectedPath, $expectedFilter);
     $this->assertEquals('http://bar.com/thumbs/foo/bar/bazz.png', $result);
 }