Skip to content

Commit

Permalink
fix and test setFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
jbouzekri committed Aug 16, 2016
1 parent f9d5eec commit 2b43f5d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: php

php:
- 5.3
- 5.4
- 5.5
- 5.6
Expand Down
17 changes: 17 additions & 0 deletions Tests/Transformer/BaseTransformerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
5 changes: 2 additions & 3 deletions Transformer/BaseTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 2b43f5d

Please sign in to comment.