Skip to content

Commit

Permalink
Add a test for passing 0 as a param value.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulstraw committed Oct 20, 2016
1 parent 6caef36 commit 024a937
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/Imgix/Tests/UrlBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ public function testParamValuesAreEscaped() {
$this->assertEquals("https://demo.imgix.net/demo.png?hello_world=%2Ffoo%22%3E%3Cscript%3Ealert%28%22hacked%22%29%3C%2Fscript%3E%3C", $url);
}

public function testZeroValue() {
$builder = new UrlBuilder("demos.imgix.net", true, "", ShardStrategy::CRC, false);

$params = array("foo" => 0);
$url = $builder->createURL("bridge.png", $params);

$this->assertEquals("https://demos.imgix.net/bridge.png?foo=0", $url);
}

public function testBase64ParamVariantsAreBase64Encoded() {
$builder = new UrlBuilder("demo.imgix.net", true, "", ShardStrategy::CRC, false);
$params = array("txt64" => 'I cannøt belîév∑ it wors! 😱');
Expand Down

0 comments on commit 024a937

Please sign in to comment.