diff --git a/.travis.yml b/.travis.yml index 24d0120..fd0f877 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: php php: - - 5.3 - 5.4 - 5.5 - 5.6 diff --git a/Tests/Transformer/BaseTransformerTest.php b/Tests/Transformer/BaseTransformerTest.php index 7f2196e..2d4d26a 100644 --- a/Tests/Transformer/BaseTransformerTest.php +++ b/Tests/Transformer/BaseTransformerTest.php @@ -271,4 +271,21 @@ public function testFilters() $this->assertEquals($transformedUrl, $buildedUrl); } + + /** + * Test setFactory + */ + public function testSetFactory() + { + $overrideFactory = new BuilderFactory('http://mynewhostname', '123456799'); + $this->transformer->setFactory($overrideFactory); + + $transformedUrl = $this->transformer->transform( + 'http://phumbor.jb.fr/logo.png', + null, + array('metadata_only' => true) + ); + $buildedUrl = $overrideFactory->url('http://phumbor.jb.fr/logo.png')->metadataOnly(true); + $this->assertEquals($transformedUrl, $buildedUrl); + } } diff --git a/Transformer/BaseTransformer.php b/Transformer/BaseTransformer.php index 55f1243..74909a8 100644 --- a/Transformer/BaseTransformer.php +++ b/Transformer/BaseTransformer.php @@ -236,10 +236,9 @@ protected function filters(Builder $url, $args) /** * Setter allowing for factory override * - * @param BuildFactory $factory - * + * @param \Thumbor\Url\BuilderFactory $factory */ - public function setFactory(BuildFactory $factory) + public function setFactory(BuilderFactory $factory) { $this->factory = $factory; }