From f667951e7e0c23f3aa2b9159809e8284b7cabeca Mon Sep 17 00:00:00 2001 From: Daniel Paul Carbone Date: Mon, 4 Oct 2021 09:30:56 -0500 Subject: [PATCH] Updating to use guzzle/psr7 v2 --- composer.json | 2 +- composer.lock | 299 +++++++++++------- tests/ConsulManager.php | 12 + tests/Usage/ACL/ACLClientTest.php | 5 +- tests/Usage/Agent/AgentClientTest.php | 22 +- tests/Usage/Catalog/CatalogClientTest.php | 22 +- tests/Usage/ConfigUsageTest.php | 16 +- .../Usage/Coordinate/CoordinateClientTest.php | 8 +- tests/Usage/Event/EventClientUsageTest.php | 4 +- tests/Usage/KV/KVCRUDTest.php | 18 +- tests/Usage/KV/KVClientCASTest.php | 4 +- tests/Usage/KV/KVClientLockTest.php | 4 +- tests/Usage/KV/KVClientTest.php | 4 +- .../Usage/Operator/OperatorAutopilotTest.php | 10 +- tests/Usage/Operator/OperatorClientTest.php | 4 +- tests/Usage/RequestUsageTest.php | 14 +- .../Usage/Session/SessionClientUsageTest.php | 4 +- 17 files changed, 263 insertions(+), 189 deletions(-) diff --git a/composer.json b/composer.json index a254f27..b84ef02 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "dcarbone/gotime": "0.4.*", "dcarbone/gohttp": "v0.3.*", "guzzlehttp/guzzle": "~7", - "guzzlehttp/psr7": "~1" + "guzzlehttp/psr7": "~2" }, "autoload": { "files": [ diff --git a/composer.lock b/composer.lock index e117a8b..0559af1 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": "187db00272df7345caf40f2c52ae8ccd", + "content-hash": "4b2459243981d2e1566a2fb8c79a0bd3", "packages": [ { "name": "dcarbone/gohttp", @@ -109,22 +109,22 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.2.0", + "version": "7.3.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "0aa74dfb41ae110835923ef10a9d803a22d50e79" + "reference": "7008573787b430c1c1f650e3722d9bba59967628" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/0aa74dfb41ae110835923ef10a9d803a22d50e79", - "reference": "0aa74dfb41ae110835923ef10a9d803a22d50e79", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/7008573787b430c1c1f650e3722d9bba59967628", + "reference": "7008573787b430c1c1f650e3722d9bba59967628", "shasum": "" }, "require": { "ext-json": "*", "guzzlehttp/promises": "^1.4", - "guzzlehttp/psr7": "^1.7", + "guzzlehttp/psr7": "^1.7 || ^2.0", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0" }, @@ -132,6 +132,7 @@ "psr/http-client-implementation": "1.0" }, "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", "ext-curl": "*", "php-http/client-integration-tests": "^3.0", "phpunit/phpunit": "^8.5.5 || ^9.3.5", @@ -145,7 +146,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "7.1-dev" + "dev-master": "7.3-dev" } }, "autoload": { @@ -187,7 +188,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.2.0" + "source": "https://github.com/guzzle/guzzle/tree/7.3.0" }, "funding": [ { @@ -207,20 +208,20 @@ "type": "github" } ], - "time": "2020-10-10T11:47:56+00:00" + "time": "2021-03-23T11:33:13+00:00" }, { "name": "guzzlehttp/promises", - "version": "1.4.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "60d379c243457e073cff02bc323a2a86cb355631" + "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/60d379c243457e073cff02bc323a2a86cb355631", - "reference": "60d379c243457e073cff02bc323a2a86cb355631", + "url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d", + "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d", "shasum": "" }, "require": { @@ -260,35 +261,38 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.4.0" + "source": "https://github.com/guzzle/promises/tree/1.4.1" }, - "time": "2020-09-30T07:37:28+00:00" + "time": "2021-03-07T09:25:29+00:00" }, { "name": "guzzlehttp/psr7", - "version": "1.7.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3" + "reference": "1dc8d9cba3897165e16d12bb13d813afb1eb3fe7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/53330f47520498c0ae1f61f7e2c90f55690c06a3", - "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/1dc8d9cba3897165e16d12bb13d813afb1eb3fe7", + "reference": "1dc8d9cba3897165e16d12bb13d813afb1eb3fe7", "shasum": "" }, "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0", - "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0", + "ralouphie/getallheaders": "^3.0" }, "provide": { + "psr/http-factory-implementation": "1.0", "psr/http-message-implementation": "1.0" }, "require-dev": { - "ext-zlib": "*", - "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" + "bamarni/composer-bin-plugin": "^1.4.1", + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^8.5.8 || ^9.3.10" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" @@ -296,16 +300,13 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "2.0-dev" } }, "autoload": { "psr-4": { "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -320,6 +321,11 @@ { "name": "Tobias Schultze", "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" } ], "description": "PSR-7 message implementation that also provides common utility methods", @@ -335,9 +341,9 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.7.0" + "source": "https://github.com/guzzle/psr7/tree/2.0.0" }, - "time": "2020-09-30T07:37:11+00:00" + "time": "2021-06-30T20:03:07+00:00" }, { "name": "psr/http-client", @@ -391,6 +397,61 @@ }, "time": "2020-06-29T06:28:15+00:00" }, + { + "name": "psr/http-factory", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "shasum": "" + }, + "require": { + "php": ">=7.0.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory/tree/master" + }, + "time": "2019-04-30T12:38:16+00:00" + }, { "name": "psr/http-message", "version": "1.0.1", @@ -619,16 +680,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.10.4", + "version": "v4.13.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e" + "reference": "50953a2691a922aa1769461637869a0a2faa3f53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/c6d052fc58cb876152f89f532b95a8d7907e7f0e", - "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/50953a2691a922aa1769461637869a0a2faa3f53", + "reference": "50953a2691a922aa1769461637869a0a2faa3f53", "shasum": "" }, "require": { @@ -669,22 +730,22 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.10.4" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.0" }, - "time": "2020-12-20T10:01:03+00:00" + "time": "2021-09-20T12:20:58+00:00" }, { "name": "phar-io/manifest", - "version": "2.0.1", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133" + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", - "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", "shasum": "" }, "require": { @@ -729,22 +790,22 @@ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/master" + "source": "https://github.com/phar-io/manifest/tree/2.0.3" }, - "time": "2020-06-27T14:33:11+00:00" + "time": "2021-07-20T11:28:43+00:00" }, { "name": "phar-io/version", - "version": "3.0.4", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "e4782611070e50613683d2b9a57730e9a3ba5451" + "reference": "bae7c545bef187884426f042434e561ab1ddb182" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/e4782611070e50613683d2b9a57730e9a3ba5451", - "reference": "e4782611070e50613683d2b9a57730e9a3ba5451", + "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", + "reference": "bae7c545bef187884426f042434e561ab1ddb182", "shasum": "" }, "require": { @@ -780,9 +841,9 @@ "description": "Library for handling version information and constraints", "support": { "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.0.4" + "source": "https://github.com/phar-io/version/tree/3.1.0" }, - "time": "2020-12-13T23:18:30+00:00" + "time": "2021-02-23T14:00:09+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -895,16 +956,16 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.4.0", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0" + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", - "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", "shasum": "" }, "require": { @@ -912,7 +973,8 @@ "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "ext-tokenizer": "*" + "ext-tokenizer": "*", + "psalm/phar": "^4.8" }, "type": "library", "extra": { @@ -938,39 +1000,39 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1" }, - "time": "2020-09-17T18:55:26+00:00" + "time": "2021-10-02T14:08:47+00:00" }, { "name": "phpspec/prophecy", - "version": "1.12.2", + "version": "1.14.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "245710e971a030f42e08f4912863805570f23d39" + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/245710e971a030f42e08f4912863805570f23d39", - "reference": "245710e971a030f42e08f4912863805570f23d39", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", "shasum": "" }, "require": { "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.1", + "php": "^7.2 || ~8.0, <8.2", "phpdocumentor/reflection-docblock": "^5.2", "sebastian/comparator": "^3.0 || ^4.0", "sebastian/recursion-context": "^3.0 || ^4.0" }, "require-dev": { - "phpspec/phpspec": "^6.0", + "phpspec/phpspec": "^6.0 || ^7.0", "phpunit/phpunit": "^8.0 || ^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.11.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { @@ -1005,29 +1067,29 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/1.12.2" + "source": "https://github.com/phpspec/prophecy/tree/1.14.0" }, - "time": "2020-12-19T10:15:11+00:00" + "time": "2021-09-10T09:02:12+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.5", + "version": "9.2.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1" + "reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f3e026641cc91909d421802dd3ac7827ebfd97e1", - "reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d4c798ed8d51506800b441f7a13ecb0f76f12218", + "reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.10.2", + "nikic/php-parser": "^4.12.0", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -1076,7 +1138,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.5" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.7" }, "funding": [ { @@ -1084,7 +1146,7 @@ "type": "github" } ], - "time": "2020-11-28T06:44:49+00:00" + "time": "2021-09-17T05:39:03+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1329,16 +1391,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.2", + "version": "9.5.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f661659747f2f87f9e72095bb207bceb0f151cb4" + "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f661659747f2f87f9e72095bb207bceb0f151cb4", - "reference": "f661659747f2f87f9e72095bb207bceb0f151cb4", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c814a05837f2edb0d1471d6e3f4ab3501ca3899a", + "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a", "shasum": "" }, "require": { @@ -1350,11 +1412,11 @@ "ext-xml": "*", "ext-xmlwriter": "*", "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.1", + "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", "php": ">=7.3", "phpspec/prophecy": "^1.12.1", - "phpunit/php-code-coverage": "^9.2.3", + "phpunit/php-code-coverage": "^9.2.7", "phpunit/php-file-iterator": "^3.0.5", "phpunit/php-invoker": "^3.1.1", "phpunit/php-text-template": "^2.0.3", @@ -1368,7 +1430,7 @@ "sebastian/global-state": "^5.0.1", "sebastian/object-enumerator": "^4.0.3", "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^2.3", + "sebastian/type": "^2.3.4", "sebastian/version": "^3.0.2" }, "require-dev": { @@ -1416,7 +1478,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.2" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.10" }, "funding": [ { @@ -1428,7 +1490,7 @@ "type": "github" } ], - "time": "2021-02-02T14:45:58+00:00" + "time": "2021-09-25T07:38:51+00:00" }, { "name": "sebastian/cli-parser", @@ -1936,16 +1998,16 @@ }, { "name": "sebastian/global-state", - "version": "5.0.2", + "version": "5.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "a90ccbddffa067b51f574dea6eb25d5680839455" + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/a90ccbddffa067b51f574dea6eb25d5680839455", - "reference": "a90ccbddffa067b51f574dea6eb25d5680839455", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49", "shasum": "" }, "require": { @@ -1988,7 +2050,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.2" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.3" }, "funding": [ { @@ -1996,7 +2058,7 @@ "type": "github" } ], - "time": "2020-10-26T15:55:19+00:00" + "time": "2021-06-11T13:31:12+00:00" }, { "name": "sebastian/lines-of-code", @@ -2287,16 +2349,16 @@ }, { "name": "sebastian/type", - "version": "2.3.1", + "version": "2.3.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2" + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/81cd61ab7bbf2de744aba0ea61fae32f721df3d2", - "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", "shasum": "" }, "require": { @@ -2331,7 +2393,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/2.3.1" + "source": "https://github.com/sebastianbergmann/type/tree/2.3.4" }, "funding": [ { @@ -2339,7 +2401,7 @@ "type": "github" } ], - "time": "2020-10-26T13:18:59+00:00" + "time": "2021-06-15T12:49:02+00:00" }, { "name": "sebastian/version", @@ -2396,16 +2458,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.22.0", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "c6c942b1ac76c82448322025e084cadc56048b4e" + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/c6c942b1ac76c82448322025e084cadc56048b4e", - "reference": "c6c942b1ac76c82448322025e084cadc56048b4e", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", "shasum": "" }, "require": { @@ -2417,7 +2479,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2455,7 +2517,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.22.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" }, "funding": [ { @@ -2471,20 +2533,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "theseer/tokenizer", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "75a63c33a8577608444246075ea0af0d052e452a" + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/75a63c33a8577608444246075ea0af0d052e452a", - "reference": "75a63c33a8577608444246075ea0af0d052e452a", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", "shasum": "" }, "require": { @@ -2513,7 +2575,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/master" + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" }, "funding": [ { @@ -2521,34 +2583,39 @@ "type": "github" } ], - "time": "2020-07-12T23:59:07+00:00" + "time": "2021-07-28T10:34:58+00:00" }, { "name": "webmozart/assert", - "version": "1.9.1", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0 || ^8.0", + "php": "^7.2 || ^8.0", "symfony/polyfill-ctype": "^1.8" }, "conflict": { "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<3.9.1" + "vimeo/psalm": "<4.6.1 || 4.6.2" }, "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" + "phpunit/phpunit": "^8.5.13" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -2572,9 +2639,9 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.9.1" + "source": "https://github.com/webmozarts/assert/tree/1.10.0" }, - "time": "2020-07-08T17:02:28+00:00" + "time": "2021-03-09T10:59:23+00:00" } ], "aliases": [], @@ -2589,5 +2656,5 @@ "ext-json": "*" }, "platform-dev": [], - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.1.0" } diff --git a/tests/ConsulManager.php b/tests/ConsulManager.php index 554401b..4e3ba65 100644 --- a/tests/ConsulManager.php +++ b/tests/ConsulManager.php @@ -16,6 +16,8 @@ limitations under the License. */ +use DCarbone\PHPConsulAPI\Config; + /** * Class ConsulManager */ @@ -67,4 +69,14 @@ public static function stopSingle(): void \sleep(1); } } + + /** + * @return \DCarbone\PHPConsulAPI\Config + */ + public static function testConfig(): Config{ + $conf = new Config(); + $conf->Address = '127.0.0.1:8500'; + $conf->Scheme = 'http'; + return $conf; + } } diff --git a/tests/Usage/ACL/ACLClientTest.php b/tests/Usage/ACL/ACLClientTest.php index 021597c..55b3f10 100644 --- a/tests/Usage/ACL/ACLClientTest.php +++ b/tests/Usage/ACL/ACLClientTest.php @@ -17,7 +17,6 @@ */ use DCarbone\PHPConsulAPI\ACL\ACLClient; -use DCarbone\PHPConsulAPI\Config; use DCarbone\PHPConsulAPI\QueryMeta; use DCarbone\PHPConsulAPI\WriteMeta; use DCarbone\PHPConsulAPITests\ConsulManager; @@ -41,7 +40,7 @@ public function testCanBootstrapACL() { ConsulManager::startSingleDev('-bind="127.0.0.1"'); - $client = new ACLClient(new Config()); + $client = new ACLClient(ConsulManager::testConfig()); [$aclID, $wm, $err] = $client->Bootstrap(); static::assertNull($err, 'ACL::bootstrap() returned error: ' . $err); @@ -57,7 +56,7 @@ public function testCanBootstrapACL() */ public function testCanGetBootstrappedACL(string $aclID): void { - $client = new ACLClient(new Config()); + $client = new ACLClient(ConsulManager::testConfig()); [$acls, $qm, $err] = $client->Info($aclID); static::assertNull($err, 'ACL::info() return error: ' . $err); diff --git a/tests/Usage/Agent/AgentClientTest.php b/tests/Usage/Agent/AgentClientTest.php index 2840050..2d20844 100644 --- a/tests/Usage/Agent/AgentClientTest.php +++ b/tests/Usage/Agent/AgentClientTest.php @@ -21,7 +21,7 @@ use DCarbone\PHPConsulAPI\Agent\AgentService; use DCarbone\PHPConsulAPI\Agent\AgentServiceCheck; use DCarbone\PHPConsulAPI\Agent\AgentServiceRegistration; -use DCarbone\PHPConsulAPI\Config; +use DCarbone\PHPConsulAPITests\ConsulManager; use DCarbone\PHPConsulAPITests\Usage\AbstractUsageTests; use PHPUnit\Framework\AssertionFailedError; @@ -39,7 +39,7 @@ final class AgentClientTest extends AbstractUsageTests public function testCanConstructAgentClient(): void { - $client = new AgentClient(new Config()); + $client = new AgentClient(ConsulManager::testConfig()); static::assertInstanceOf(AgentClient::class, $client); } @@ -48,7 +48,7 @@ public function testCanConstructAgentClient(): void */ public function testCanGetSelf(): void { - $client = new AgentClient(new Config()); + $client = new AgentClient(ConsulManager::testConfig()); [$self, $err] = $client->Self(); static::assertNull($err); @@ -66,7 +66,7 @@ public function testCanGetSelf(): void */ public function testCanReloadSelf(): void { - $client = new AgentClient(new Config()); + $client = new AgentClient(ConsulManager::testConfig()); $err = $client->Reload(); static::assertNull($err, \sprintf('AgentClient::reload returned error: %s', $err)); } @@ -76,7 +76,7 @@ public function testCanReloadSelf(): void */ public function testCanGetNodeName(): void { - $client = new AgentClient(new Config()); + $client = new AgentClient(ConsulManager::testConfig()); [$nodeName, $err] = $client->NodeName(); static::assertNull($err, \sprintf('Unable to get agent node name: %s', $err)); @@ -92,7 +92,7 @@ public function testCanGetNodeName(): void */ public function testCanGeMembers(): void { - $client = new AgentClient(new Config()); + $client = new AgentClient(ConsulManager::testConfig()); [$members, $err] = $client->Members(); static::assertNull($err, \sprintf('AgentClient::members returned error: %s', $err)); @@ -106,7 +106,7 @@ public function testCanGeMembers(): void */ public function testCanRegisterServiceNoChecks(): void { - $client = new AgentClient(new Config()); + $client = new AgentClient(ConsulManager::testConfig()); $svc = new AgentServiceRegistration(); $svc @@ -123,7 +123,7 @@ public function testCanRegisterServiceNoChecks(): void */ public function testCanRegisterServiceWithOneCheck(): void { - $client = new AgentClient(new Config()); + $client = new AgentClient(ConsulManager::testConfig()); $svc = new AgentServiceRegistration(); $svc @@ -145,7 +145,7 @@ public function testCanRegisterServiceWithOneCheck(): void */ public function testCanGetServiceList(): void { - $client = new AgentClient(new Config()); + $client = new AgentClient(ConsulManager::testConfig()); [$svcs, $err] = $client->Services(); @@ -170,7 +170,7 @@ public function testCanGetServiceList(): void */ public function testCanDeregisterService(): void { - $client = new AgentClient(new Config()); + $client = new AgentClient(ConsulManager::testConfig()); $err = $client->ServiceDeregister(self::Service1Name); static::assertNull($err, \sprintf('AgentClient::serviceDeregister returned error: %s', $err)); @@ -196,7 +196,7 @@ public function testCanDeregisterService(): void */ public function testCanRegisterServiceWithCheck(): void { - $client = new AgentClient(new Config()); + $client = new AgentClient(ConsulManager::testConfig()); $svc = new AgentServiceRegistration(); $svc diff --git a/tests/Usage/Catalog/CatalogClientTest.php b/tests/Usage/Catalog/CatalogClientTest.php index bea9131..e98aec1 100644 --- a/tests/Usage/Catalog/CatalogClientTest.php +++ b/tests/Usage/Catalog/CatalogClientTest.php @@ -23,9 +23,9 @@ use DCarbone\PHPConsulAPI\Catalog\CatalogRegistration; use DCarbone\PHPConsulAPI\Catalog\CatalogService; use DCarbone\PHPConsulAPI\Catalog\Node; -use DCarbone\PHPConsulAPI\Config; use DCarbone\PHPConsulAPI\QueryMeta; use DCarbone\PHPConsulAPI\WriteMeta; +use DCarbone\PHPConsulAPITests\ConsulManager; use DCarbone\PHPConsulAPITests\Usage\AbstractUsageTests; use PHPUnit\Framework\AssertionFailedError; @@ -48,7 +48,7 @@ final class CatalogClientTest extends AbstractUsageTests public function testCanConstructClient(): void { - $client = new CatalogClient(new Config()); + $client = new CatalogClient(ConsulManager::testConfig()); static::assertInstanceOf(CatalogClient::class, $client); } @@ -57,7 +57,7 @@ public function testCanConstructClient(): void */ public function testCanRegisterService(): void { - $client = new CatalogClient(new Config()); + $client = new CatalogClient(ConsulManager::testConfig()); $registration = new CatalogRegistration([ 'Node' => 'dc1', @@ -80,7 +80,7 @@ public function testCanRegisterService(): void */ public function testCanGetService(): void { - $client = new CatalogClient(new Config()); + $client = new CatalogClient(ConsulManager::testConfig()); [$service, $qm, $err] = $client->Service(self::ServiceName); static::assertNull($err, 'CatalogClient::service returned error: ' . $err); @@ -95,7 +95,7 @@ public function testCanGetService(): void */ public function testCanRegisterSecondServiceWithSameName(): void { - $client = new CatalogClient(new Config()); + $client = new CatalogClient(ConsulManager::testConfig()); [$wm, $err] = $client->Register(new CatalogRegistration([ 'Node' => 'dc1', @@ -117,7 +117,7 @@ public function testCanRegisterSecondServiceWithSameName(): void */ public function testCanGetListOfService(): void { - $client = new CatalogClient(new Config()); + $client = new CatalogClient(ConsulManager::testConfig()); [$service, $qm, $err] = $client->Service(self::ServiceName); static::assertNull($err, 'CatalogClient::service returned error: ' . $err); @@ -140,7 +140,7 @@ public function testCanGetListOfService(): void */ public function testCanGetListOfServices(): void { - $client = new CatalogClient(new Config()); + $client = new CatalogClient(ConsulManager::testConfig()); [$services, $qm, $err] = $client->Services(); @@ -161,7 +161,7 @@ public function testCanGetListOfServices(): void */ public function testCanDeregisterService(): void { - $client = new CatalogClient(new Config()); + $client = new CatalogClient(ConsulManager::testConfig()); [$wm, $err] = $client->Deregister(new CatalogDeregistration([ 'Node' => 'dc1', @@ -184,7 +184,7 @@ public function testCanDeregisterService(): void */ public function testCanGetDatacenters(): void { - $client = new CatalogClient(new Config()); + $client = new CatalogClient(ConsulManager::testConfig()); [$dcs, $err] = $client->Datacenters(); @@ -204,7 +204,7 @@ public function testCanGetDatacenters(): void */ public function testCanGetListOfNodes(): void { - $client = new CatalogClient(new Config()); + $client = new CatalogClient(ConsulManager::testConfig()); [$nodes, $qm, $err] = $client->Nodes(); try { @@ -225,7 +225,7 @@ public function testCanGetListOfNodes(): void */ public function testCanGetNode(): void { - $client = new CatalogClient(new Config()); + $client = new CatalogClient(ConsulManager::testConfig()); [$nodes] = $client->Nodes(); try { diff --git a/tests/Usage/ConfigUsageTest.php b/tests/Usage/ConfigUsageTest.php index 3288fdc..764a321 100644 --- a/tests/Usage/ConfigUsageTest.php +++ b/tests/Usage/ConfigUsageTest.php @@ -31,14 +31,10 @@ final class ConfigUsageTest extends TestCase public const DEFAULT_ADDRESS = '127.0.0.1:8500'; public const DEFAULT_SCHEME = 'http'; - /** - * @return \DCarbone\PHPConsulAPITests\Usage\Config - */ - public function testCanConstructConfig() + public function testCanConstructConfig(): void { $config = new Config(); - static::assertInstanceOf(Config::class, $config); - return $config; + self::assertInstanceOf(Config::class, $config); } /** @@ -51,18 +47,18 @@ public function testConfigDefaults(): void $expectedAddress = $_ENV[Consul::HTTPAddrEnvName] ?: self::DEFAULT_ADDRESS; $expectedScheme = $_ENV[Consul::HTTPSSLEnvName] ? 'https' : self::DEFAULT_SCHEME; - static::assertSame( + self::assertSame( $expectedAddress, $config->getAddress(), \sprintf('Default address is not "%s"', $expectedAddress) ); - static::assertSame( + self::assertSame( $expectedScheme, $config->getScheme(), \sprintf('Default scheme is not "%s"', $expectedScheme) ); - static::assertNotNull($config->getHttpClient(), 'HttpClient is null'); - static::assertFalse($config->isInsecureSkipVerify(), 'InsecureSkipVerify is not false'); + self::assertNotNull($config->getHttpClient(), 'HttpClient is null'); + self::assertFalse($config->isInsecureSkipVerify(), 'InsecureSkipVerify is not false'); } protected function setUp(): void diff --git a/tests/Usage/Coordinate/CoordinateClientTest.php b/tests/Usage/Coordinate/CoordinateClientTest.php index 6d4be8e..1e797a4 100644 --- a/tests/Usage/Coordinate/CoordinateClientTest.php +++ b/tests/Usage/Coordinate/CoordinateClientTest.php @@ -16,9 +16,9 @@ limitations under the License. */ -use DCarbone\PHPConsulAPI\Config; use DCarbone\PHPConsulAPI\Coordinate\CoordinateClient; use DCarbone\PHPConsulAPI\QueryMeta; +use DCarbone\PHPConsulAPITests\ConsulManager; use DCarbone\PHPConsulAPITests\Usage\AbstractUsageTests; /** @@ -33,7 +33,7 @@ final class CoordinateClientTest extends AbstractUsageTests public function testCanConstructClient(): void { - $client = new CoordinateClient(new Config()); + $client = new CoordinateClient(ConsulManager::testConfig()); static::assertInstanceOf(CoordinateClient::class, $client); } @@ -42,7 +42,7 @@ public function testCanConstructClient(): void */ public function testDatacenters(): void { - $client = new CoordinateClient(new Config()); + $client = new CoordinateClient(ConsulManager::testConfig()); [$dcs, $err] = $client->Datacenters(); static::assertNull($err, \sprintf('CoordinateClient::datacenters() - %s', $err)); @@ -55,7 +55,7 @@ public function testDatacenters(): void */ public function testNodes(): void { - $client = new CoordinateClient(new Config()); + $client = new CoordinateClient(ConsulManager::testConfig()); [$nodes, $qm, $err] = $client->Nodes(); static::assertNull($err, \sprintf('CoordinateClient::nodes() - %s', $err)); diff --git a/tests/Usage/Event/EventClientUsageTest.php b/tests/Usage/Event/EventClientUsageTest.php index 93e0226..8246e73 100644 --- a/tests/Usage/Event/EventClientUsageTest.php +++ b/tests/Usage/Event/EventClientUsageTest.php @@ -16,8 +16,8 @@ limitations under the License. */ -use DCarbone\PHPConsulAPI\Config; use DCarbone\PHPConsulAPI\Event\EventClient; +use DCarbone\PHPConsulAPITests\ConsulManager; use DCarbone\PHPConsulAPITests\Usage\AbstractUsageTests; /** @@ -32,7 +32,7 @@ final class EventClientUsageTest extends AbstractUsageTests public function testCanConstructClient(): void { - $client = new EventClient(new Config()); + $client = new EventClient(ConsulManager::testConfig()); static::assertInstanceOf(EventClient::class, $client); } } diff --git a/tests/Usage/KV/KVCRUDTest.php b/tests/Usage/KV/KVCRUDTest.php index f838206..5b3ecbf 100644 --- a/tests/Usage/KV/KVCRUDTest.php +++ b/tests/Usage/KV/KVCRUDTest.php @@ -17,13 +17,13 @@ limitations under the License. */ -use DCarbone\PHPConsulAPI\Config; use DCarbone\PHPConsulAPI\Error; use DCarbone\PHPConsulAPI\KV\KVClient; use DCarbone\PHPConsulAPI\KV\KVPair; use DCarbone\PHPConsulAPI\KV\KVPairs; use DCarbone\PHPConsulAPI\QueryMeta; use DCarbone\PHPConsulAPI\WriteMeta; +use DCarbone\PHPConsulAPITests\ConsulManager; use DCarbone\PHPConsulAPITests\Usage\AbstractUsageTests; use PHPUnit\Framework\AssertionFailedError; @@ -49,7 +49,7 @@ final class KVCRUDTest extends AbstractUsageTests public function testCanPutKey(): void { - $client = new KVClient(new Config()); + $client = new KVClient(ConsulManager::testConfig()); [$wm, $err] = $client->Put(new KVPair(['Key' => self::KVKey1, 'Value' => self::KVValue1])); static::assertNull($err, \sprintf('Unable to set kvp: %s', (string)$err)); @@ -61,7 +61,7 @@ public function testCanPutKey(): void */ public function testCanGetKey(): void { - $client = new KVClient(new Config()); + $client = new KVClient(ConsulManager::testConfig()); $client->Put(new KVPair(['Key' => self::KVKey1, 'Value' => self::KVValue1])); [$kv, $qm, $err] = $client->Get(self::KVKey1); @@ -77,7 +77,7 @@ public function testCanGetKey(): void */ public function testCanDeleteKey(): void { - $client = new KVClient(new Config()); + $client = new KVClient(ConsulManager::testConfig()); $client->Put(new KVPair(['Key' => self::KVKey1, 'Value' => self::KVValue1])); [$wm, $err] = $client->Delete(self::KVKey1); @@ -95,7 +95,7 @@ public function testCanDeleteKey(): void public function testListReturnsErrorWithInvalidPrefix(): void { - $client = new KVClient(new Config()); + $client = new KVClient(ConsulManager::testConfig()); [$_, $_, $err] = $client->List(12345); static::assertInstanceOf( Error::class, @@ -116,7 +116,7 @@ public function testCanGetNoPrefixList(): void /** @var \DCarbone\PHPConsulAPI\KV\KVPair[] $list */ /** @var \DCarbone\PHPConsulAPI\QueryMeta $qm */ /** @var \DCarbone\PHPConsulAPI\Error $err */ - $client = new KVClient(new Config()); + $client = new KVClient(ConsulManager::testConfig()); $client->Put(new KVPair(['Key' => self::KVKey1, 'Value' => self::KVValue1])); $client->Put(new KVPair(['Key' => self::KVKey2, 'Value' => self::KVValue2])); $client->Put(new KVPair(['Key' => self::KVKey3, 'Value' => self::KVValue3])); @@ -164,7 +164,7 @@ public function testCanGetPrefixList(): void /** @var \DCarbone\PHPConsulAPI\KV\KVPair[] $list */ /** @var \DCarbone\PHPConsulAPI\QueryMeta $qm */ /** @var \DCarbone\PHPConsulAPI\Error $err */ - $client = new KVClient(new Config()); + $client = new KVClient(ConsulManager::testConfig()); $client->Put(new KVPair(['Key' => self::KVPrefix . '/' . self::KVKey1, 'Value' => self::KVValue1])); $client->Put(new KVPair(['Key' => self::KVPrefix . '/' . self::KVKey2, 'Value' => self::KVValue2])); $client->Put(new KVPair(['Key' => self::KVPrefix . '/' . self::KVKey3, 'Value' => self::KVValue3])); @@ -206,7 +206,7 @@ public function testCanGetPrefixList(): void public function testKeysReturnsErrorWithInvalidPrefix(): void { - $client = new KVClient(new Config()); + $client = new KVClient(ConsulManager::testConfig()); [$_, $_, $err] = $client->Keys(12345); static::assertInstanceOf( Error::class, @@ -227,7 +227,7 @@ public function testCanGetNoPrefixKeys(): void /** @var string[] $list */ /** @var \DCarbone\PHPConsulAPI\QueryMeta $qm */ /** @var \DCarbone\PHPConsulAPI\Error $err */ - $client = new KVClient(new Config()); + $client = new KVClient(ConsulManager::testConfig()); $client->Put(new KVPair(['Key' => self::KVKey1, 'Value' => self::KVValue1])); $client->Put(new KVPair(['Key' => self::KVKey2, 'Value' => self::KVValue2])); $client->Put(new KVPair(['Key' => self::KVKey3, 'Value' => self::KVValue3])); diff --git a/tests/Usage/KV/KVClientCASTest.php b/tests/Usage/KV/KVClientCASTest.php index b446cdc..3c67e5c 100644 --- a/tests/Usage/KV/KVClientCASTest.php +++ b/tests/Usage/KV/KVClientCASTest.php @@ -1,8 +1,8 @@ Put(new KVPair(['Key' => self::KVKey1, 'Value' => self::KVOriginalValue])); static::assertNull($err, \sprintf('Unable to put KV: %s', $err)); diff --git a/tests/Usage/KV/KVClientLockTest.php b/tests/Usage/KV/KVClientLockTest.php index d17db3e..66f8c67 100644 --- a/tests/Usage/KV/KVClientLockTest.php +++ b/tests/Usage/KV/KVClientLockTest.php @@ -1,13 +1,13 @@ AutopilotGetConfiguration(); static::assertNull($err, \sprintf('Unable to list autopilot configuration: %s', $err)); @@ -50,7 +50,7 @@ public function testCanGetAutopilotConfiguration(): void */ public function testCanSetAutopilotConfiguration(): void { - $client = new OperatorClient(new Config()); + $client = new OperatorClient(ConsulManager::testConfig()); /** @var \DCarbone\PHPConsulAPI\Operator\AutopilotConfiguration $current */ /** @var \DCarbone\PHPConsulAPI\Operator\AutopilotConfiguration $updated */ @@ -74,7 +74,7 @@ public function testCanSetAutopilotConfiguration(): void */ public function testCanCASAutopilotConfiguration(): void { - $client = new OperatorClient(new Config()); + $client = new OperatorClient(ConsulManager::testConfig()); /** @var \DCarbone\PHPConsulAPI\Operator\AutopilotConfiguration $current */ /** @var \DCarbone\PHPConsulAPI\Operator\AutopilotConfiguration $updated */ [$current] = $client->AutopilotGetConfiguration(); @@ -95,7 +95,7 @@ public function testCanCASAutopilotConfiguration(): void public function testCanGetAutopilotServerHealth(): void { - $client = new OperatorClient(new Config()); + $client = new OperatorClient(ConsulManager::testConfig()); /** @var \DCarbone\PHPConsulAPI\Operator\OperatorHealthReply $healths */ [$healths, $err] = $client->AutopilotServerHealth(); diff --git a/tests/Usage/Operator/OperatorClientTest.php b/tests/Usage/Operator/OperatorClientTest.php index 3d58d62..15933fb 100644 --- a/tests/Usage/Operator/OperatorClientTest.php +++ b/tests/Usage/Operator/OperatorClientTest.php @@ -16,8 +16,8 @@ limitations under the License. */ -use DCarbone\PHPConsulAPI\Config; use DCarbone\PHPConsulAPI\Operator\OperatorClient; +use DCarbone\PHPConsulAPITests\ConsulManager; use PHPUnit\Framework\TestCase; /** @@ -29,7 +29,7 @@ final class OperatorClientTest extends TestCase { public function testCanConstructOperatorClient(): void { - $client = new OperatorClient(new Config()); + $client = new OperatorClient(ConsulManager::testConfig()); self::assertInstanceOf(OperatorClient::class, $client); } } diff --git a/tests/Usage/RequestUsageTest.php b/tests/Usage/RequestUsageTest.php index 05f7f4e..e9de2a4 100644 --- a/tests/Usage/RequestUsageTest.php +++ b/tests/Usage/RequestUsageTest.php @@ -16,11 +16,11 @@ limitations under the License. */ -use DCarbone\PHPConsulAPI\Config; use DCarbone\PHPConsulAPI\KV\KVPair; use DCarbone\PHPConsulAPI\QueryOptions; use DCarbone\PHPConsulAPI\Request; use DCarbone\PHPConsulAPI\WriteOptions; +use DCarbone\PHPConsulAPITests\ConsulManager; use PHPUnit\Framework\TestCase; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\UriInterface; @@ -34,7 +34,7 @@ final class RequestUsageTest extends TestCase { public function testCanConstructWithoutBody(): void { - $r = new Request('', '', new Config(), null); + $r = new Request('', '', ConsulManager::testConfig(), null); static::assertInstanceOf(Request::class, $r); } @@ -43,7 +43,7 @@ public function testCanConstructWithoutBody(): void */ public function testCanConstructWithBody(): void { - $r = new Request('', '', new Config(), new KVPair()); + $r = new Request('', '', ConsulManager::testConfig(), new KVPair()); static::assertInstanceOf(Request::class, $r); } @@ -52,7 +52,7 @@ public function testCanConstructWithBody(): void */ public function testCanCreatePsr7Uri(): void { - $r = new Request('GET', 'kv', new Config(), null); + $r = new Request('GET', 'kv', ConsulManager::testConfig(), null); $uri = $r->getUri(); static::assertInstanceOf(UriInterface::class, $uri); static::assertSame('/kv', $uri->getPath()); @@ -63,7 +63,7 @@ public function testCanCreatePsr7Uri(): void */ public function testCanCreatePsr7Request(): void { - $r = new Request('GET', '/kv', new Config(), null); + $r = new Request('GET', '/kv', ConsulManager::testConfig(), null); $psr7Request = $r->toPsrRequest(); static::assertInstanceOf(RequestInterface::class, $psr7Request); @@ -76,7 +76,7 @@ public function testCanCreatePsr7Request(): void */ public function testCanSetQueryOptions(): void { - $r = new Request('GET', 'kv', new Config(), null); + $r = new Request('GET', 'kv', ConsulManager::testConfig(), null); $r->applyOptions(new QueryOptions(['Pretty' => true])); $psr7 = $r->toPsrRequest(); @@ -89,7 +89,7 @@ public function testCanSetQueryOptions(): void */ public function testCanSetWriteOptions(): void { - $r = new Request('GET', 'kv', new Config(), null); + $r = new Request('GET', 'kv', ConsulManager::testConfig(), null); $r->applyOptions(new WriteOptions(['Datacenter' => 'dc1'])); $psr7 = $r->toPsrRequest(); diff --git a/tests/Usage/Session/SessionClientUsageTest.php b/tests/Usage/Session/SessionClientUsageTest.php index d0a9c09..21df17c 100644 --- a/tests/Usage/Session/SessionClientUsageTest.php +++ b/tests/Usage/Session/SessionClientUsageTest.php @@ -1,12 +1,12 @@ CreateNoChecks(new SessionEntry([ 'Name' => $name,