From 4f83df759944782e4ebf76b893fbda565a51be51 Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Tue, 16 Jul 2019 18:38:09 -0700 Subject: [PATCH] Added phpcs ruleset repo; fixed linting issues --- .buildpath | 239 --------------------- .gitignore | 2 +- composer.json | 11 +- composer.lock | 143 ++++++------ src/Client/License.php | 15 +- src/Utils/APIUtils.php | 34 +-- test/src/Api/APIUtils/APIUtilsTest.php | 50 +++-- test/src/Api/Client/LicenseFactoryTest.php | 1 - 8 files changed, 138 insertions(+), 357 deletions(-) delete mode 100644 .buildpath mode change 100644 => 100755 composer.json mode change 100644 => 100755 src/Utils/APIUtils.php mode change 100644 => 100755 test/src/Api/APIUtils/APIUtilsTest.php diff --git a/.buildpath b/.buildpath deleted file mode 100644 index ff86ba0..0000000 --- a/.buildpath +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.gitignore b/.gitignore index a3ce18c..5ad60d0 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,4 @@ *~ *# TAGS -libphp-edit-prod.sh +.phpunit.result.cache diff --git a/composer.json b/composer.json old mode 100644 new mode 100755 index 4bbd37b..14cfb9f --- a/composer.json +++ b/composer.json @@ -2,11 +2,18 @@ "name": "astock/stock-api-libphp", "description": "Adobe Stock API library", "license": "Apache-2.0", + "repositories": [ + { + "type": "vcs", + "url": "./libs/phpcs-psr2-stock" + } + ], "require": { "php": "~7.1", "guzzlehttp/guzzle": "~6.0" }, "require-dev": { + "squizlabs/php_codesniffer": "~2.8", "astock/phpcs-psr2-stock": "~1.4", "phpunit/phpunit": "~6.0", "mockery/mockery": "^0.9.9" @@ -26,8 +33,10 @@ }, "scripts": { "check": [ - "@test" + "@test", + "@lint" ], + "lint": "vendor/bin/phpcs --standard='vendor/astock/phpcs-psr2-stock/PSR2Stock' src test", "test": "vendor/bin/phpunit", "test-coverage": "vendor/bin/phpunit --coverage-html data/clover" } diff --git a/composer.lock b/composer.lock index dc788fa..123f372 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9668b7360b297cf7e49b2a3f349d9d2d", + "content-hash": "de813d66458ae63eafb354d6df8348c2", "packages": [ { "name": "guzzlehttp/guzzle", @@ -124,33 +124,37 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.5.2", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "9f83dded91781a01c63574e387eaa769be769115" + "reference": "239400de7a173fe9901b9ac7c06497751f00727a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115", - "reference": "9f83dded91781a01c63574e387eaa769be769115", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a", + "reference": "239400de7a173fe9901b9ac7c06497751f00727a", "shasum": "" }, "require": { "php": ">=5.4.0", "psr/http-message": "~1.0", - "ralouphie/getallheaders": "^2.0.5" + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" }, "provide": { "psr/http-message-implementation": "1.0" }, "require-dev": { + "ext-zlib": "*", "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" }, + "suggest": { + "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5-dev" + "dev-master": "1.6-dev" } }, "autoload": { @@ -187,7 +191,7 @@ "uri", "url" ], - "time": "2018-12-04T20:46:45+00:00" + "time": "2019-07-01T23:21:34+00:00" }, { "name": "psr/http-message", @@ -241,24 +245,24 @@ }, { "name": "ralouphie/getallheaders", - "version": "2.0.5", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa" + "reference": "120b605dfeb996808c31b6477290a714d356e822" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa", - "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", "shasum": "" }, "require": { - "php": ">=5.3" + "php": ">=5.6" }, "require-dev": { - "phpunit/phpunit": "~3.7.0", - "satooshi/php-coveralls": ">=1.0" + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" }, "type": "library", "autoload": { @@ -277,17 +281,17 @@ } ], "description": "A polyfill for getallheaders.", - "time": "2016-02-11T07:05:27+00:00" + "time": "2019-03-08T08:55:37+00:00" } ], "packages-dev": [ { "name": "astock/phpcs-psr2-stock", - "version": "v1.5", + "version": "v1.6", "source": { "type": "git", - "url": "git@git.corp.adobe.com:AdobeStock/phpcs-psr2-stock.git", - "reference": "8b90e8eab977201120e1f8506e50982b6c939c5b" + "url": "./libs/phpcs-psr2-stock", + "reference": "2fd4a0c43a380dd08f7d1370760a992a9ec93e94" }, "require": { "squizlabs/php_codesniffer": "~2.8" @@ -307,31 +311,33 @@ } ], "description": "Adobe Stock PHP coding style validator", - "time": "2017-03-01T14:00:18+00:00" + "time": "2017-08-25T18:49:33+00:00" }, { "name": "doctrine/instantiator", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" + "reference": "a2c590166b2133a4633738648b6b064edae0814a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/a2c590166b2133a4633738648b6b064edae0814a", + "reference": "a2c590166b2133a4633738648b6b064edae0814a", "shasum": "" }, "require": { "php": "^7.1" }, "require-dev": { - "athletic/athletic": "~0.1.8", + "doctrine/coding-standard": "^6.0", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "^6.2.3", - "squizlabs/php_codesniffer": "^3.0.2" + "phpbench/phpbench": "^0.13", + "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-shim": "^0.11", + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { @@ -356,12 +362,12 @@ } ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", "keywords": [ "constructor", "instantiate" ], - "time": "2017-07-22T11:58:36+00:00" + "time": "2019-03-17T17:37:11+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -410,16 +416,16 @@ }, { "name": "mockery/mockery", - "version": "0.9.10", + "version": "0.9.11", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "4876fc0c7d9e5da49712554a35c94d84ed1e9ee5" + "reference": "be9bf28d8e57d67883cba9fcadfcff8caab667f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/4876fc0c7d9e5da49712554a35c94d84ed1e9ee5", - "reference": "4876fc0c7d9e5da49712554a35c94d84ed1e9ee5", + "url": "https://api.github.com/repos/mockery/mockery/zipball/be9bf28d8e57d67883cba9fcadfcff8caab667f8", + "reference": "be9bf28d8e57d67883cba9fcadfcff8caab667f8", "shasum": "" }, "require": { @@ -471,20 +477,20 @@ "test double", "testing" ], - "time": "2018-11-13T20:50:16+00:00" + "time": "2019-02-12T16:07:13+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.8.1", + "version": "1.9.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" + "reference": "e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", - "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72", + "reference": "e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72", "shasum": "" }, "require": { @@ -519,7 +525,7 @@ "object", "object graph" ], - "time": "2018-06-11T23:09:50+00:00" + "time": "2019-04-07T13:18:21+00:00" }, { "name": "phar-io/manifest", @@ -679,16 +685,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.3.0", + "version": "4.3.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", + "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", "shasum": "" }, "require": { @@ -726,7 +732,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-11-30T07:14:17+00:00" + "time": "2019-04-30T17:48:53+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -777,16 +783,16 @@ }, { "name": "phpspec/prophecy", - "version": "1.8.0", + "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", - "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/1927e75f4ed19131ec9bcc3b002e07fb1173ee76", + "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76", "shasum": "" }, "require": { @@ -807,8 +813,8 @@ } }, "autoload": { - "psr-0": { - "Prophecy\\": "src/" + "psr-4": { + "Prophecy\\": "src/Prophecy" } }, "notification-url": "https://packagist.org/downloads/", @@ -836,7 +842,7 @@ "spy", "stub" ], - "time": "2018-08-05T17:53:17+00:00" + "time": "2019-06-13T12:50:23+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1089,16 +1095,16 @@ }, { "name": "phpunit/phpunit", - "version": "6.5.13", + "version": "6.5.14", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "0973426fb012359b2f18d3bd1e90ef1172839693" + "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0973426fb012359b2f18d3bd1e90ef1172839693", - "reference": "0973426fb012359b2f18d3bd1e90ef1172839693", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/bac23fe7ff13dbdb461481f706f0e9fe746334b7", + "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7", "shasum": "" }, "require": { @@ -1169,7 +1175,7 @@ "testing", "xunit" ], - "time": "2018-09-08T15:10:43+00:00" + "time": "2019-02-01T05:22:47+00:00" }, { "name": "phpunit/phpunit-mock-objects", @@ -1228,6 +1234,7 @@ "mock", "xunit" ], + "abandoned": true, "time": "2018-08-09T05:50:03+00:00" }, { @@ -1869,16 +1876,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.10.0", + "version": "v1.11.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + "reference": "82ebae02209c21113908c229e9883c419720738a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/82ebae02209c21113908c229e9883c419720738a", + "reference": "82ebae02209c21113908c229e9883c419720738a", "shasum": "" }, "require": { @@ -1890,7 +1897,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.11-dev" } }, "autoload": { @@ -1912,7 +1919,7 @@ }, { "name": "Gert de Pagter", - "email": "backendtea@gmail.com" + "email": "BackEndTea@gmail.com" } ], "description": "Symfony polyfill for ctype functions", @@ -1923,20 +1930,20 @@ "polyfill", "portable" ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2019-02-06T07:57:58+00:00" }, { "name": "theseer/tokenizer", - "version": "1.1.0", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" + "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", - "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/11336f6f84e16a720dae9d8e6ed5019efa85a0f9", + "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9", "shasum": "" }, "require": { @@ -1963,7 +1970,7 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2017-04-07T12:08:54+00:00" + "time": "2019-06-13T22:48:21+00:00" }, { "name": "webmozart/assert", diff --git a/src/Client/License.php b/src/Client/License.php index 1b83f03..9a0d387 100644 --- a/src/Client/License.php +++ b/src/Client/License.php @@ -50,7 +50,7 @@ public function __construct(CoreConfig $config) * Method to return URL to asset * @return string $_url */ - protected function getDownloadUrl(): string + protected function _getDownloadUrl(): string { return $this->_url; } @@ -60,11 +60,12 @@ protected function getDownloadUrl(): string * @param string $url * @param string $access_token */ - protected function setDownloadUrl(string $url, string $access_token = null) + protected function _setDownloadUrl(string $url, string $access_token = null) { if ($access_token) { $url .= '?token=' . $access_token; } + $this->_url = $url; } @@ -245,11 +246,11 @@ public function downloadAssetRequest(LicenseRequest $request, string $access_tok //adds middleware in the client which controls the redirection behaviour. $this->_addHandler($client_handler); //store original url - $this->setDownloadUrl($url, $access_token); + $this->_setDownloadUrl($url, $access_token); //guzzle get request by client to fetch s3 url $http_client->doGet($url, $headers); //guzzle request object is created which can be used to download asset - $guzzle_request = new Request('GET', $this->getDownloadUrl()); + $guzzle_request = new Request('GET', $this->_getDownloadUrl()); $client_handler->remove('Redirection check'); return $guzzle_request; } @@ -307,10 +308,10 @@ private function _addHandler(HandlerStack $stack) if (intval($http_status_code) == 200) { // append content-disposition header to url $header = $response->getHeader('Content-Disposition'); - $this->setDownloadUrl($this->getDownloadUrl() . '&' . $header[0]); - } elseif (intval($http_status_code / 100) == 3) { + $this->_setDownloadUrl($this->_getDownloadUrl() . '&' . $header[0]); + } else if (intval($http_status_code / 100) == 3) { // override url with redirect link - $this->setDownloadUrl($response->getHeader('Location')[0]); + $this->_setDownloadUrl($response->getHeader('Location')[0]); } else { throw StockApiException::withMessage('No redirection done by server'); } diff --git a/src/Utils/APIUtils.php b/src/Utils/APIUtils.php old mode 100644 new mode 100755 index 48aac10..f3d6c7b --- a/src/Utils/APIUtils.php +++ b/src/Utils/APIUtils.php @@ -113,7 +113,7 @@ public static function downSampleImage(string $file_path) : string $new_dimension = static::_calculateResizeParameters($original_width, $original_height); - return static::resizeImage( + return static::_resizeImage( $file_path, $type, $original_width, @@ -126,43 +126,43 @@ public static function downSampleImage(string $file_path) : string /** * Resize a JPEG, PNG or GIF image. Returns PNG resized image as string. * - * @param string $filePath - * @param int $type - * @param int $originalWidth - * @param int $originalHeight - * @param int $width - * @param int $height + * @param string $file_path + * @param int $type + * @param int $original_width + * @param int $original_height + * @param int $width + * @param int $height * @return string * @throws StockApiException */ - private static function resizeImage( - string $filePath, + private static function _resizeImage( + string $file_path, int $type, - int $originalWidth, - int $originalHeight, + int $original_width, + int $original_height, int $width, int $height ) { switch ($type) { case IMAGETYPE_JPEG: - $image = imagecreatefromjpeg($filePath); + $image = imagecreatefromjpeg($file_path); break; case IMAGETYPE_PNG: - $image = imagecreatefrompng($filePath); + $image = imagecreatefrompng($file_path); break; case IMAGETYPE_GIF: - $image = imagecreatefromgif($filePath); + $image = imagecreatefromgif($file_path); break; default: throw StockApiException::withMessage('Only jpg, png and gifs are supported image formats'); break; } - $sampleImage = imagecreatetruecolor($width, $height); - imagecopyresampled($sampleImage, $image, 0, 0, 0, 0, $width, $height, $originalWidth, $originalHeight); + $sample_image = imagecreatetruecolor($width, $height); + imagecopyresampled($sample_image, $image, 0, 0, 0, 0, $width, $height, $original_width, $original_height); ob_start(); - imagepng($sampleImage); + imagepng($sample_image); $blob = ob_get_clean(); return $blob; diff --git a/test/src/Api/APIUtils/APIUtilsTest.php b/test/src/Api/APIUtils/APIUtilsTest.php old mode 100644 new mode 100755 index 641ba28..7d754a0 --- a/test/src/Api/APIUtils/APIUtilsTest.php +++ b/test/src/Api/APIUtils/APIUtilsTest.php @@ -26,57 +26,61 @@ public function generateCommonAPIHeadersShouldGenerateHeadersArrayFromConfigAndA } /** - * @param string $absolutePath - * @param StockApi|null $expectedException + * @param string $absolute_path + * @param StockApi|null $expected_exception * @dataProvider downSampleImageProvider */ - public function testDownSampleImage(string $absolutePath, StockApi $expectedException = null): void + public function testDownSampleImage(string $absolute_path, StockApi $expected_exception = null): void { - if ($expectedException) { - $this->expectExceptionObject($expectedException); + if ($expected_exception) { + $this->expectExceptionObject($expected_exception); } - list($width, $height) = getimagesize($absolutePath); - $imageString = APIUtils::downSampleImage($absolutePath); - $image = imagecreatefromstring($imageString); - $resultWidth = imagesx($image); - $resultHeight = imagesy($image); + list($width, $height) = getimagesize($absolute_path); + $image_string = APIUtils::downSampleImage($absolute_path); - $this->assertLessThanOrEqual(min($width, 1000), $resultWidth); - $this->assertLessThanOrEqual(min($height, 1000), $resultHeight); + $image = imagecreatefromstring($image_string); + $result_width = imagesx($image); + $result_height = imagesy($image); + + $this->assertLessThanOrEqual(min($width, 1000), $result_width); + $this->assertLessThanOrEqual(min($height, 1000), $result_height); $this->assertNotNull($image); } + /** + * @return array + */ public function downSampleImageProvider(): array { return [ 'width_greater_than_height' => [ - $this->getAbsolutePath('test/resources/TestFileWidth.png') + $this->_getAbsolutePath('test/resources/TestFileWidth.png'), ], 'height_greater_than_width' => [ - $this->getAbsolutePath('test/resources/TestFile.png') + $this->_getAbsolutePath('test/resources/TestFile.png'), ], 'small_image' => [ - $this->getAbsolutePath('test/resources/SmallImage.jpg') + $this->_getAbsolutePath('test/resources/SmallImage.jpg'), ], 'not_supported_image' => [ - $this->getAbsolutePath('test/resources/UnsupportedBMP.bmp'), - new StockApi('Only jpg, png and gifs are supported image formats') + $this->_getAbsolutePath('test/resources/UnsupportedBMP.bmp'), + new StockApi('Only jpg, png and gifs are supported image formats'), ], 'bigger_than_expected_image' => [ - $this->getAbsolutePath('test/resources/BigImage.jpg'), - new StockApi('Image is too large for visual search!') - ] + $this->_getAbsolutePath('test/resources/BigImage.jpg'), + new StockApi('Image is too large for visual search!'), + ], ]; } /** - * @param string $pathInProject + * @param string $path_in_project * @return string */ - private function getAbsolutePath(string $pathInProject): string + private function _getAbsolutePath(string $path_in_project): string { - return dirname(dirname(dirname(dirname(__DIR__)))) . '/' . $pathInProject; + return dirname(dirname(dirname(dirname(__DIR__)))) . '/' . $path_in_project; } } diff --git a/test/src/Api/Client/LicenseFactoryTest.php b/test/src/Api/Client/LicenseFactoryTest.php index fec9323..d1bbe2a 100644 --- a/test/src/Api/Client/LicenseFactoryTest.php +++ b/test/src/Api/Client/LicenseFactoryTest.php @@ -349,7 +349,6 @@ public function downloadAssetRequestShouldReturnValidRequestObject() $request = new LicenseRequest(); $request->setContentId(84071201)->setLicenseState('STANDARD'); $guzzle_request = $this->_license_factory->downloadAssetRequest($request, 'access_token', $this->_mocked_http_client); - $this->assertEquals($guzzle_request, new Request('GET', '')); } /**