From 54c2da29cae9d5bbe8efabdbf4b39eca9e572208 Mon Sep 17 00:00:00 2001 From: Luis Ball Date: Thu, 19 Jan 2023 11:39:51 -0800 Subject: [PATCH] chore(release): v4.0.0 --- composer.json | 2 +- src/UrlBuilder.php | 2 +- tests/UrlBuilderTest.php | 78 ++++++++++++++++++++-------------------- 3 files changed, 41 insertions(+), 41 deletions(-) diff --git a/composer.json b/composer.json index 046f2b9..421ab82 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "imgix/imgix-php", "description": "A PHP client library for generating URLs with imgix.", "type": "library", - "version": "3.3.1", + "version": "4.0.0", "license": "BSD-2-Clause", "keywords": [ "imgix" diff --git a/src/UrlBuilder.php b/src/UrlBuilder.php index b4bb3ce..06b8a6b 100644 --- a/src/UrlBuilder.php +++ b/src/UrlBuilder.php @@ -4,7 +4,7 @@ class UrlBuilder { - private $currentVersion = "3.3.1"; + private $currentVersion = "4.0.0"; private $domain; private $useHttps; private $signKey; diff --git a/tests/UrlBuilderTest.php b/tests/UrlBuilderTest.php index 304a793..863f05f 100644 --- a/tests/UrlBuilderTest.php +++ b/tests/UrlBuilderTest.php @@ -216,7 +216,7 @@ public function testCustomSrcsetPairs() { $builder = new UrlBuilder("demos.imgix.net", true, false); $opts = array('start' => 328, 'stop' => 328); $actual = $builder->createSrcSet($path="image.jpg", $params=array(), $options=$opts); - $expected = 'https://demos.imgix.net/image.jpg?ixlib=php-3.3.1&w=328 328w'; + $expected = 'https://demos.imgix.net/image.jpg?ixlib=php-4.0.0&w=328 328w'; $this->assertEquals($expected, $actual); $builder = new UrlBuilder("demos.imgix.net", true, false); @@ -225,15 +225,15 @@ public function testCustomSrcsetPairs() { $params=array(), $options=array('start' => 720, 'stop' => 720)); - $expected = 'https://demos.imgix.net/image.jpg?ixlib=php-3.3.1&w=720 720w'; + $expected = 'https://demos.imgix.net/image.jpg?ixlib=php-4.0.0&w=720 720w'; $this->assertEquals($expected, $actual); $builder = new UrlBuilder("demos.imgix.net", true, false); $opts = array('start' => 640, 'stop' => 720); $actual = $builder->createSrcSet($path="image.jpg", $params=array(), $options=$opts); $expected = // Raw string literal -'https://demos.imgix.net/image.jpg?ixlib=php-3.3.1&w=640 640w, -https://demos.imgix.net/image.jpg?ixlib=php-3.3.1&w=720 720w'; +'https://demos.imgix.net/image.jpg?ixlib=php-4.0.0&w=640 640w, +https://demos.imgix.net/image.jpg?ixlib=php-4.0.0&w=720 720w'; $this->assertEquals($expected, $actual); @@ -242,11 +242,11 @@ public function testCustomSrcsetPairs() { $opts = array('start' => 100, 'stop' => 108, 'tol' => 0.01); $actual = $builder->createSrcSet($path="image.jpg", $params=array(), $options=$opts); $expected = // Raw string literal -'https://demos.imgix.net/image.jpg?ixlib=php-3.3.1&w=100 100w, -https://demos.imgix.net/image.jpg?ixlib=php-3.3.1&w=102 102w, -https://demos.imgix.net/image.jpg?ixlib=php-3.3.1&w=104 104w, -https://demos.imgix.net/image.jpg?ixlib=php-3.3.1&w=106 106w, -https://demos.imgix.net/image.jpg?ixlib=php-3.3.1&w=108 108w'; +'https://demos.imgix.net/image.jpg?ixlib=php-4.0.0&w=100 100w, +https://demos.imgix.net/image.jpg?ixlib=php-4.0.0&w=102 102w, +https://demos.imgix.net/image.jpg?ixlib=php-4.0.0&w=104 104w, +https://demos.imgix.net/image.jpg?ixlib=php-4.0.0&w=106 106w, +https://demos.imgix.net/image.jpg?ixlib=php-4.0.0&w=108 108w'; $this->assertEquals($expected, $actual); } @@ -291,11 +291,11 @@ public function testDprSrcsetWithQ100() { $actual = $builder->createSrcSet( $path="image.jpg", $params=array("w" => 640, "q" => 100)); $expected = -'https://demos.imgix.net/image.jpg?dpr=1&ixlib=php-3.3.1&q=100&w=640 1x, -https://demos.imgix.net/image.jpg?dpr=2&ixlib=php-3.3.1&q=100&w=640 2x, -https://demos.imgix.net/image.jpg?dpr=3&ixlib=php-3.3.1&q=100&w=640 3x, -https://demos.imgix.net/image.jpg?dpr=4&ixlib=php-3.3.1&q=100&w=640 4x, -https://demos.imgix.net/image.jpg?dpr=5&ixlib=php-3.3.1&q=100&w=640 5x'; +'https://demos.imgix.net/image.jpg?dpr=1&ixlib=php-4.0.0&q=100&w=640 1x, +https://demos.imgix.net/image.jpg?dpr=2&ixlib=php-4.0.0&q=100&w=640 2x, +https://demos.imgix.net/image.jpg?dpr=3&ixlib=php-4.0.0&q=100&w=640 3x, +https://demos.imgix.net/image.jpg?dpr=4&ixlib=php-4.0.0&q=100&w=640 4x, +https://demos.imgix.net/image.jpg?dpr=5&ixlib=php-4.0.0&q=100&w=640 5x'; $this->assertEquals($expected, $actual); } @@ -305,11 +305,11 @@ public function testDprSrcsetWithDefaultQuality() { $actual = $builder->createSrcSet($path="image.jpg", $params=array("w" => 740)); $expected = -'https://demos.imgix.net/image.jpg?dpr=1&ixlib=php-3.3.1&q=75&w=740 1x, -https://demos.imgix.net/image.jpg?dpr=2&ixlib=php-3.3.1&q=50&w=740 2x, -https://demos.imgix.net/image.jpg?dpr=3&ixlib=php-3.3.1&q=35&w=740 3x, -https://demos.imgix.net/image.jpg?dpr=4&ixlib=php-3.3.1&q=23&w=740 4x, -https://demos.imgix.net/image.jpg?dpr=5&ixlib=php-3.3.1&q=20&w=740 5x'; +'https://demos.imgix.net/image.jpg?dpr=1&ixlib=php-4.0.0&q=75&w=740 1x, +https://demos.imgix.net/image.jpg?dpr=2&ixlib=php-4.0.0&q=50&w=740 2x, +https://demos.imgix.net/image.jpg?dpr=3&ixlib=php-4.0.0&q=35&w=740 3x, +https://demos.imgix.net/image.jpg?dpr=4&ixlib=php-4.0.0&q=23&w=740 4x, +https://demos.imgix.net/image.jpg?dpr=5&ixlib=php-4.0.0&q=20&w=740 5x'; $this->assertEquals($expected, $actual); } @@ -321,11 +321,11 @@ public function testDprVariableQualityDisabled() { $actual = $builder->createSrcSet($path="image.jpg", $params=$params, $opts=$opts); $expected = -'https://demos.imgix.net/image.jpg?dpr=1&ixlib=php-3.3.1&w=640 1x, -https://demos.imgix.net/image.jpg?dpr=2&ixlib=php-3.3.1&w=640 2x, -https://demos.imgix.net/image.jpg?dpr=3&ixlib=php-3.3.1&w=640 3x, -https://demos.imgix.net/image.jpg?dpr=4&ixlib=php-3.3.1&w=640 4x, -https://demos.imgix.net/image.jpg?dpr=5&ixlib=php-3.3.1&w=640 5x'; +'https://demos.imgix.net/image.jpg?dpr=1&ixlib=php-4.0.0&w=640 1x, +https://demos.imgix.net/image.jpg?dpr=2&ixlib=php-4.0.0&w=640 2x, +https://demos.imgix.net/image.jpg?dpr=3&ixlib=php-4.0.0&w=640 3x, +https://demos.imgix.net/image.jpg?dpr=4&ixlib=php-4.0.0&w=640 4x, +https://demos.imgix.net/image.jpg?dpr=5&ixlib=php-4.0.0&w=640 5x'; $this->assertEquals($expected, $actual); } @@ -338,11 +338,11 @@ public function testDprSrcsetQOverridesEnabledVariableQuality() { $actual = $builder->createSrcSet($path="image.jpg", $params, $opts); $expected = -'https://demos.imgix.net/image.jpg?dpr=1&ixlib=php-3.3.1&q=75&w=540 1x, -https://demos.imgix.net/image.jpg?dpr=2&ixlib=php-3.3.1&q=75&w=540 2x, -https://demos.imgix.net/image.jpg?dpr=3&ixlib=php-3.3.1&q=75&w=540 3x, -https://demos.imgix.net/image.jpg?dpr=4&ixlib=php-3.3.1&q=75&w=540 4x, -https://demos.imgix.net/image.jpg?dpr=5&ixlib=php-3.3.1&q=75&w=540 5x'; +'https://demos.imgix.net/image.jpg?dpr=1&ixlib=php-4.0.0&q=75&w=540 1x, +https://demos.imgix.net/image.jpg?dpr=2&ixlib=php-4.0.0&q=75&w=540 2x, +https://demos.imgix.net/image.jpg?dpr=3&ixlib=php-4.0.0&q=75&w=540 3x, +https://demos.imgix.net/image.jpg?dpr=4&ixlib=php-4.0.0&q=75&w=540 4x, +https://demos.imgix.net/image.jpg?dpr=5&ixlib=php-4.0.0&q=75&w=540 5x'; $this->assertEquals($expected, $actual); } @@ -356,11 +356,11 @@ public function testDprSrcsetQOverridesDisabledVariableQuality() { $options=$opts); $expected = -'https://demos.imgix.net/image.jpg?dpr=1&ixlib=php-3.3.1&q=99&w=440 1x, -https://demos.imgix.net/image.jpg?dpr=2&ixlib=php-3.3.1&q=99&w=440 2x, -https://demos.imgix.net/image.jpg?dpr=3&ixlib=php-3.3.1&q=99&w=440 3x, -https://demos.imgix.net/image.jpg?dpr=4&ixlib=php-3.3.1&q=99&w=440 4x, -https://demos.imgix.net/image.jpg?dpr=5&ixlib=php-3.3.1&q=99&w=440 5x'; +'https://demos.imgix.net/image.jpg?dpr=1&ixlib=php-4.0.0&q=99&w=440 1x, +https://demos.imgix.net/image.jpg?dpr=2&ixlib=php-4.0.0&q=99&w=440 2x, +https://demos.imgix.net/image.jpg?dpr=3&ixlib=php-4.0.0&q=99&w=440 3x, +https://demos.imgix.net/image.jpg?dpr=4&ixlib=php-4.0.0&q=99&w=440 4x, +https://demos.imgix.net/image.jpg?dpr=5&ixlib=php-4.0.0&q=99&w=440 5x'; $this->assertEquals($expected, $actual); } @@ -369,11 +369,11 @@ public function testCreateSrcSetFromWidthsArray() { $opts = array('widths' => array(100, 200, 303, 404, 535)); $actual = $builder->createSrcSet($path="image.jpg", $params=array(), $options=$opts); $expected = -'https://demos.imgix.net/image.jpg?ixlib=php-3.3.1&w=100 100w, -https://demos.imgix.net/image.jpg?ixlib=php-3.3.1&w=200 200w, -https://demos.imgix.net/image.jpg?ixlib=php-3.3.1&w=303 303w, -https://demos.imgix.net/image.jpg?ixlib=php-3.3.1&w=404 404w, -https://demos.imgix.net/image.jpg?ixlib=php-3.3.1&w=535 535w'; +'https://demos.imgix.net/image.jpg?ixlib=php-4.0.0&w=100 100w, +https://demos.imgix.net/image.jpg?ixlib=php-4.0.0&w=200 200w, +https://demos.imgix.net/image.jpg?ixlib=php-4.0.0&w=303 303w, +https://demos.imgix.net/image.jpg?ixlib=php-4.0.0&w=404 404w, +https://demos.imgix.net/image.jpg?ixlib=php-4.0.0&w=535 535w'; $this->assertEquals($expected, $actual); }