From 7422af5b97c8b36718593dbaf5cfb757771fb907 Mon Sep 17 00:00:00 2001 From: ZarlengoToptal <85881377+ZarlengoToptal@users.noreply.github.com> Date: Wed, 19 Jan 2022 14:36:48 -0800 Subject: [PATCH] Added pickup and order (#77) * Added pickup and order * Updated tests & added circle ci * Change version to 2.0 * Update date * Update LICENSE Co-authored-by: Chris --- .circleci/config.yml | 18 + .gitignore | 3 +- CHANGELOG | 5 + LICENSE | 2 +- VERSION | 2 +- composer.json | 4 +- composer.lock | 1370 ++++++++++++----- examples/filter-by-delivery-time.php | 2 +- examples/get-rates-to-show-customer.php | 1 + examples/purchase-fastest-service.php | 4 +- examples/schedule-pickup.php | 171 ++ lib/Shippo.php | 2 + lib/Shippo/Address.php | 4 +- lib/Shippo/ApiResource.php | 4 +- lib/Shippo/Batch.php | 2 +- lib/Shippo/CarrierAccount.php | 10 +- lib/Shippo/CustomsDeclaration.php | 2 +- lib/Shippo/CustomsItem.php | 2 +- lib/Shippo/Order.php | 38 + lib/Shippo/Pickup.php | 16 + lib/Shippo/SingletonApiResource.php | 2 +- lib/Shippo/Track.php | 2 +- ...AddressTest.php => Shippo_AddressTest.php} | 0 ...orTest.php => Shippo_ApiRequestorTest.php} | 0 ...php => Shippo_AuthenticationErrorTest.php} | 0 ...ShippoBaseTest.php => Shippo_BaseTest.php} | 0 test/{BatchTest.php => Shippo_BatchTest.php} | 10 +- ...Test.php => Shippo_CarrierAccountTest.php} | 4 +- ...ientTest.php => Shippo_CurlClientTest.php} | 0 ....php => Shippo_CustomsDeclarationTest.php} | 0 ...temTest.php => Shippo_CustomsItemTest.php} | 0 test/{ErrorTest.php => Shippo_ErrorTest.php} | 0 ...php => Shippo_InvalidRequestErrorTest.php} | 0 ...nifestTest.php => Shippo_ManifestTest.php} | 4 +- .../{ObjectTest.php => Shippo_ObjectTest.php} | 0 test/Shippo_OrderTest.php | 140 ++ .../{ParcelTest.php => Shippo_ParcelTest.php} | 2 +- test/Shippo_PickupTest.php | 147 ++ test/{RateTest.php => Shippo_RateTest.php} | 0 .../{RefundTest.php => Shippo_RefundTest.php} | 2 +- ...ipmentTest.php => Shippo_ShipmentTest.php} | 0 test/{TrackTest.php => Shippo_TrackTest.php} | 4 +- ...ionTest.php => Shippo_TransactionTest.php} | 4 +- test/{UtilTest.php => Shippo_UtilTest.php} | 0 test/TestCase.php | 4 +- 45 files changed, 1588 insertions(+), 399 deletions(-) create mode 100644 .circleci/config.yml create mode 100644 examples/schedule-pickup.php create mode 100644 lib/Shippo/Order.php create mode 100644 lib/Shippo/Pickup.php rename test/{AddressTest.php => Shippo_AddressTest.php} (100%) rename test/{ApiRequestorTest.php => Shippo_ApiRequestorTest.php} (100%) rename test/{AuthenticationErrorTest.php => Shippo_AuthenticationErrorTest.php} (100%) rename test/{ShippoBaseTest.php => Shippo_BaseTest.php} (100%) rename test/{BatchTest.php => Shippo_BatchTest.php} (96%) rename test/{CarrierAccountTest.php => Shippo_CarrierAccountTest.php} (95%) rename test/{CurlClientTest.php => Shippo_CurlClientTest.php} (100%) rename test/{CustomsDeclarationTest.php => Shippo_CustomsDeclarationTest.php} (100%) rename test/{CustomsItemTest.php => Shippo_CustomsItemTest.php} (100%) rename test/{ErrorTest.php => Shippo_ErrorTest.php} (100%) rename test/{InvalidRequestErrorTest.php => Shippo_InvalidRequestErrorTest.php} (100%) rename test/{ManifestTest.php => Shippo_ManifestTest.php} (96%) rename test/{ObjectTest.php => Shippo_ObjectTest.php} (100%) create mode 100644 test/Shippo_OrderTest.php rename test/{ParcelTest.php => Shippo_ParcelTest.php} (98%) create mode 100644 test/Shippo_PickupTest.php rename test/{RateTest.php => Shippo_RateTest.php} (100%) rename test/{RefundTest.php => Shippo_RefundTest.php} (76%) rename test/{ShipmentTest.php => Shippo_ShipmentTest.php} (100%) rename test/{TrackTest.php => Shippo_TrackTest.php} (96%) rename test/{TransactionTest.php => Shippo_TransactionTest.php} (96%) rename test/{UtilTest.php => Shippo_UtilTest.php} (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..734a92c --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,18 @@ +version: 2.1 +orbs: + php: circleci/php@1.1.0 + +jobs: + build: + executor: php/default + steps: + - checkout + - php/install-composer: + install-version: 1.10.16 + - php/install-packages + - run: + name: Composer Update + command: composer update + - run: + name: Test + command: ./vendor/bin/phpunit diff --git a/.gitignore b/.gitignore index 49ce3c1..59780f8 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -/vendor \ No newline at end of file +/vendor +*.cache \ No newline at end of file diff --git a/CHANGELOG b/CHANGELOG index 8c3e747..c03f9ce 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,8 @@ +=== =2.0.0 2022-01-18 +- Add pickups +- Add orders +- Add CircleCi + === =1.3.2 2017-05-04 - Revert changes to namespacing to be revisted - Fix parcel to parcels diff --git a/LICENSE b/LICENSE index a41997d..3aa3b3e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License -Copyright (c) 2014-2015 Shippo +Copyright (c) 2014-2022 Shippo Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/VERSION b/VERSION index 9df886c..227cea2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.4.2 +2.0.0 diff --git a/composer.json b/composer.json index ee5ce7f..04e3ba2 100644 --- a/composer.json +++ b/composer.json @@ -21,13 +21,13 @@ } ], "require": { - "php": ">=5.2", + "php": ">=7.3", "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*" }, "require-dev": { - "phpunit/phpunit": "5.5.*" + "phpunit/phpunit": "9.5.*" }, "autoload": { "classmap": ["lib/Shippo/"] diff --git a/composer.lock b/composer.lock index 3abe313..ece6ff5 100644 --- a/composer.lock +++ b/composer.lock @@ -1,42 +1,39 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ca5871891c36b301b6e1e16d752463b6", + "content-hash": "a78ee705de7a181401b45e77dc7b8b9e", "packages": [], "packages-dev": [ { "name": "doctrine/instantiator", - "version": "1.0.5", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": "^7.1 || ^8.0" }, "require-dev": { - "athletic/athletic": "~0.1.8", + "doctrine/coding-standard": "^8.0", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" @@ -50,50 +47,70 @@ { "name": "Marco Pivetta", "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" + "homepage": "https://ocramius.github.io/" } ], "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": "2015-06-14T21:17:01+00:00" + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2020-11-10T18:47:58+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.5.5", + "version": "1.10.2", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "399c1f9781e222f6eb6cc238796f5200d1b7f108" + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/399c1f9781e222f6eb6cc238796f5200d1b7f108", - "reference": "399c1f9781e222f6eb6cc238796f5200d1b7f108", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": "^7.1 || ^8.0" + }, + "replace": { + "myclabs/deep-copy": "self.version" }, "require-dev": { - "doctrine/collections": "1.*", - "phpunit/phpunit": "~4.1" + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" }, "type": "library", "autoload": { "psr-4": { "DeepCopy\\": "src/DeepCopy/" - } + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "description": "Create deep copies (clones) of your objects", - "homepage": "https://github.com/myclabs/DeepCopy", "keywords": [ "clone", "copy", @@ -101,39 +118,195 @@ "object", "object graph" ], - "time": "2016-10-31T17:19:45+00:00" + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2020-11-13T09:40:50+00:00" }, { - "name": "phpdocumentor/reflection-common", - "version": "1.0", + "name": "nikic/php-parser", + "version": "v4.13.1", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "63a79e8daa781cac14e5195e63ed8ae231dd10fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/63a79e8daa781cac14e5195e63ed8ae231dd10fd", + "reference": "63a79e8daa781cac14e5195e63ed8ae231dd10fd", "shasum": "" }, "require": { - "php": ">=5.5" + "ext-tokenizer": "*", + "php": ">=7.0" }, "require-dev": { - "phpunit/phpunit": "^4.6" + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "time": "2021-11-03T20:52:16+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "time": "2021-07-20T11:28:43+00:00" + }, + { + "name": "phar-io/version", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "bae7c545bef187884426f042434e561ab1ddb182" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", + "reference": "bae7c545bef187884426f042434e561ab1ddb182", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "time": "2021-02-23T14:00:09+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-2.x": "2.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src" - ] + "phpDocumentor\\Reflection\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -155,38 +328,42 @@ "reflection", "static analysis" ], - "time": "2015-12-27T11:43:31+00:00" + "time": "2020-06-27T09:03:43+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "3.1.1", + "version": "5.3.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", - "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", "shasum": "" }, "require": { - "php": ">=5.5", - "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.2.0", - "webmozart/assert": "^1.0" + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^4.4" + "mockery/mockery": "~1.3.2", + "psalm/phar": "^4.8" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] + "phpDocumentor\\Reflection\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -197,44 +374,46 @@ { "name": "Mike van Riel", "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2016-09-30T07:12:33+00:00" + "time": "2021-10-19T17:43:47+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.2.1", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", - "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", "shasum": "" }, "require": { - "php": ">=5.5", - "phpdocumentor/reflection-common": "^1.0" + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^5.2||^4.8.24" + "ext-tokenizer": "*", + "psalm/phar": "^4.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-1.x": "1.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] + "phpDocumentor\\Reflection\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -247,42 +426,43 @@ "email": "me@mikevanriel.com" } ], - "time": "2016-11-25T06:54:22+00:00" + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "time": "2021-10-02T14:08:47+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.6.2", + "version": "1.14.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "6c52c2722f8460122f96f86346600e1077ce22cb" + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/6c52c2722f8460122f96f86346600e1077ce22cb", - "reference": "6c52c2722f8460122f96f86346600e1077ce22cb", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", - "sebastian/comparator": "^1.1", - "sebastian/recursion-context": "^1.0|^2.0" + "doctrine/instantiator": "^1.2", + "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": "^2.0", - "phpunit/phpunit": "^4.8 || ^5.6.5" + "phpspec/phpspec": "^6.0 || ^7.0", + "phpunit/phpunit": "^8.0 || ^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { - "psr-0": { - "Prophecy\\": "src/" + "psr-4": { + "Prophecy\\": "src/Prophecy" } }, "notification-url": "https://packagist.org/downloads/", @@ -310,44 +490,48 @@ "spy", "stub" ], - "time": "2016-11-21T14:58:47+00:00" + "time": "2021-09-10T09:02:12+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "4.0.4", + "version": "9.2.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "c14196e64a78570034afd0b7a9f3757ba71c2a0a" + "reference": "f301eb1453c9e7a1bc912ee8b0ea9db22c60223b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c14196e64a78570034afd0b7a9f3757ba71c2a0a", - "reference": "c14196e64a78570034afd0b7a9f3757ba71c2a0a", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f301eb1453c9e7a1bc912ee8b0ea9db22c60223b", + "reference": "f301eb1453c9e7a1bc912ee8b0ea9db22c60223b", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "^1.4.2", - "sebastian/code-unit-reverse-lookup": "~1.0", - "sebastian/environment": "^1.3.2 || ^2.0", - "sebastian/version": "~1.0|~2.0" + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.13.0", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" }, "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "^5.4" + "phpunit/phpunit": "^9.3" }, "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.4.0", - "ext-xmlwriter": "*" + "ext-pcov": "*", + "ext-xdebug": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0.x-dev" + "dev-master": "9.2-dev" } }, "autoload": { @@ -362,7 +546,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -373,29 +557,38 @@ "testing", "xunit" ], - "time": "2016-12-20T15:22:42+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-11-19T15:21:02+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.2", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8", + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -410,7 +603,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -420,26 +613,44 @@ "filesystem", "iterator" ], - "time": "2016-10-03T07:40:28+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:57:25+00:00" }, { - "name": "phpunit/php-text-template", - "version": "1.2.1", + "name": "phpunit/php-invoker", + "version": "3.1.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -456,34 +667,45 @@ "role": "lead" } ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", "keywords": [ - "template" + "process" + ], + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2015-06-21T13:50:34+00:00" + "time": "2020-09-28T05:58:55+00:00" }, { - "name": "phpunit/php-timer", - "version": "1.0.8", + "name": "phpunit/php-text-template", + "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", - "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "~4|~5" + "phpunit/phpunit": "^9.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -496,42 +718,47 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", "keywords": [ - "timer" + "template" + ], + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2016-05-12T18:03:57+00:00" + "time": "2020-10-26T05:33:50+00:00" }, { - "name": "phpunit/php-token-stream", - "version": "1.4.9", + "name": "phpunit/php-timer", + "version": "5.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b" + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3b402f65a4cc90abf6e1104e388b896ce209631b", - "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -546,64 +773,74 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", "keywords": [ - "tokenizer" + "timer" + ], + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2016-11-15T14:06:22+00:00" + "time": "2020-10-26T13:16:10+00:00" }, { "name": "phpunit/phpunit", - "version": "5.5.7", + "version": "9.5.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "3f67cee782c9abfaee5e32fd2f57cdd54bc257ba" + "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3f67cee782c9abfaee5e32fd2f57cdd54bc257ba", - "reference": "3f67cee782c9abfaee5e32fd2f57cdd54bc257ba", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c814a05837f2edb0d1471d6e3f4ab3501ca3899a", + "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a", "shasum": "" }, "require": { + "doctrine/instantiator": "^1.3.1", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "~1.3", - "php": "^5.6 || ^7.0", - "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "^4.0.1", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "^3.2", - "sebastian/comparator": "~1.1", - "sebastian/diff": "~1.2", - "sebastian/environment": "^1.3 || ^2.0", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/object-enumerator": "~1.0", - "sebastian/resource-operations": "~1.0", - "sebastian/version": "~1.0|~2.0", - "symfony/yaml": "~2.1|~3.0" - }, - "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2" + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.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.7", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.5", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.3", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^2.3.4", + "sebastian/version": "^3.0.2" }, "require-dev": { - "ext-pdo": "*" + "ext-pdo": "*", + "phpspec/prophecy-phpunit": "^2.0.1" }, "suggest": { - "ext-tidy": "*", - "ext-xdebug": "*", - "phpunit/php-invoker": "~1.1" + "ext-soap": "*", + "ext-xdebug": "*" }, "bin": [ "phpunit" @@ -611,12 +848,15 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.5.x-dev" + "dev-master": "9.5-dev" } }, "autoload": { "classmap": [ "src/" + ], + "files": [ + "src/Framework/Assert/Functions.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -637,41 +877,42 @@ "testing", "xunit" ], - "time": "2016-10-03T13:04:15+00:00" + "funding": [ + { + "url": "https://phpunit.de/donate.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-09-25T07:38:51+00:00" }, { - "name": "phpunit/phpunit-mock-objects", - "version": "3.4.3", + "name": "sebastian/cli-parser", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "3ab72b65b39b491e0c011e2e09bb2206c2aa8e24" + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/3ab72b65b39b491e0c011e2e09bb2206c2aa8e24", - "reference": "3ab72b65b39b491e0c011e2e09bb2206c2aa8e24", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.6 || ^7.0", - "phpunit/php-text-template": "^1.2", - "sebastian/exporter": "^1.2 || ^2.0" - }, - "conflict": { - "phpunit/phpunit": "<5.4.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^5.4" - }, - "suggest": { - "ext-soap": "*" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2.x-dev" + "dev-master": "1.0-dev" } }, "autoload": { @@ -686,42 +927,44 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2016-12-08T20:27:08+00:00" + "time": "2020-09-28T06:08:49+00:00" }, { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.0", + "name": "sebastian/code-unit", + "version": "1.0.8", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe" + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/c36f5e7cfce482fde5bf8d10d41a53591e0198fe", - "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", "shasum": "" }, "require": { - "php": ">=5.6" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "~5" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.0-dev" } }, "autoload": { @@ -736,39 +979,44 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2016-02-13T06:45:14+00:00" + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" }, { - "name": "sebastian/comparator", - "version": "1.2.2", + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "6a1ed12e8b2409076ab22e3897126211ff8b1f7f" + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/6a1ed12e8b2409076ab22e3897126211ff8b1f7f", - "reference": "6a1ed12e8b2409076ab22e3897126211ff8b1f7f", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -781,56 +1029,47 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" } ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2016-11-19T09:18:40+00:00" + "time": "2020-09-28T05:30:19+00:00" }, { - "name": "sebastian/diff", - "version": "1.4.1", + "name": "sebastian/comparator", + "version": "4.0.6", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" }, "require-dev": { - "phpunit/phpunit": "~4.8" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -844,45 +1083,179 @@ ], "authors": [ { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:49:45+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.7", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:52:27+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" } ], "description": "Diff implementation", "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ - "diff" + "diff", + "udiff", + "unidiff", + "unified diff" ], - "time": "2015-12-08T07:14:41+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:10:38+00:00" }, { "name": "sebastian/environment", - "version": "2.0.0", + "version": "5.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + "reference": "388b6ced16caa751030f6a69e588299fa09200ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^5.0" + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -907,34 +1280,40 @@ "environment", "hhvm" ], - "time": "2016-11-26T07:53:53+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:52:38+00:00" }, { "name": "sebastian/exporter", - "version": "1.2.2", + "version": "4.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -947,6 +1326,10 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, { "name": "Jeff Welch", "email": "whatthejeff@gmail.com" @@ -955,46 +1338,51 @@ "name": "Volker Dusch", "email": "github@wallbash.com" }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, { "name": "Adam Harvey", "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" } ], "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", + "homepage": "https://www.github.com/sebastianbergmann/exporter", "keywords": [ "export", "exporter" ], - "time": "2016-06-17T09:04:28+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-11-11T14:18:36+00:00" }, { "name": "sebastian/global-state", - "version": "1.1.1", + "version": "5.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "ext-dom": "*", + "phpunit/phpunit": "^9.3" }, "suggest": { "ext-uopz": "*" @@ -1002,7 +1390,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -1025,33 +1413,93 @@ "keywords": [ "global state" ], - "time": "2015-10-12T03:26:01+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-06-11T13:31:12+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.6", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-28T06:42:11+00:00" }, { "name": "sebastian/object-enumerator", - "version": "1.0.0", + "version": "4.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "d4ca2fb70344987502567bc50081c03e6192fb26" + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/d4ca2fb70344987502567bc50081c03e6192fb26", - "reference": "d4ca2fb70344987502567bc50081c03e6192fb26", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", "shasum": "" }, "require": { - "php": ">=5.6", - "sebastian/recursion-context": "~1.0" + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" }, "require-dev": { - "phpunit/phpunit": "~5" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1071,32 +1519,89 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2016-01-28T13:25:10+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" }, { "name": "sebastian/recursion-context", - "version": "1.0.2", + "version": "4.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791" + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1109,14 +1614,14 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, { "name": "Adam Harvey", "email": "aharvey@php.net" @@ -1124,29 +1629,38 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-11-11T19:50:13+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:17:30+00:00" }, { "name": "sebastian/resource-operations", - "version": "1.0.0", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", "shasum": "" }, "require": { - "php": ">=5.6.0" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1166,29 +1680,87 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28T20:34:47+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:45:17+00:00" + }, + { + "name": "sebastian/type", + "version": "2.3.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-06-15T12:49:02+00:00" }, { "name": "sebastian/version", - "version": "2.0.1", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + "reference": "c6c1022351a901512170118436c764e473f6de8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", "shasum": "" }, "require": { - "php": ">=5.6" + "php": ">=7.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1209,43 +1781,50 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03T07:35:21+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" }, { - "name": "symfony/yaml", - "version": "v3.2.2", + "name": "symfony/polyfill-ctype", + "version": "v1.23.0", "source": { "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "50eadbd7926e31842893c957eca362b21592a97d" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/50eadbd7926e31842893c957eca362b21592a97d", - "reference": "50eadbd7926e31842893c957eca362b21592a97d", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", "shasum": "" }, "require": { - "php": ">=5.5.9" - }, - "require-dev": { - "symfony/console": "~2.8|~3.0" + "php": ">=7.1" }, "suggest": { - "symfony/console": "For validating YAML files using the lint command" + "ext-ctype": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Yaml\\": "" + "Symfony\\Polyfill\\Ctype\\": "" }, - "exclude-from-classmap": [ - "/Tests/" + "files": [ + "bootstrap.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1254,43 +1833,113 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Yaml Component", + "description": "Symfony polyfill for ctype functions", "homepage": "https://symfony.com", - "time": "2017-01-03T13:51:32+00:00" + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2021-07-28T10:34:58+00:00" }, { "name": "webmozart/assert", - "version": "1.2.0", + "version": "1.10.0", "source": { "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" + "url": "https://github.com/webmozarts/assert.git", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", - "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.2 || ^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" }, "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" + "phpunit/phpunit": "^8.5.13" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.10-dev" } }, "autoload": { @@ -1314,7 +1963,7 @@ "check", "validate" ], - "time": "2016-11-23T20:04:58+00:00" + "time": "2021-03-09T10:59:23+00:00" } ], "aliases": [], @@ -1323,10 +1972,11 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=5.2", + "php": ">=7.3", "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*" }, - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "1.1.0" } diff --git a/examples/filter-by-delivery-time.php b/examples/filter-by-delivery-time.php index 6840faf..c212810 100644 --- a/examples/filter-by-delivery-time.php +++ b/examples/filter-by-delivery-time.php @@ -82,7 +82,7 @@ $eligible_rates = array_values(array_filter( $shipment['rates'], function($rate){ - return $rate['days'] <= MAX_TRANSIT_TIME_DAYS; + return $rate['estimated_days'] <= MAX_TRANSIT_TIME_DAYS; } )); diff --git a/examples/get-rates-to-show-customer.php b/examples/get-rates-to-show-customer.php index a8751da..01512d5 100644 --- a/examples/get-rates-to-show-customer.php +++ b/examples/get-rates-to-show-customer.php @@ -129,6 +129,7 @@ echo "--> " . $message . "\n"; } } + // For more tutorals of address validation, tracking, returns, refunds, and other functionality, check out our // complete documentation: https://goshippo.com/docs/ ?> diff --git a/examples/purchase-fastest-service.php b/examples/purchase-fastest-service.php index 9bb2b27..8c2165f 100644 --- a/examples/purchase-fastest-service.php +++ b/examples/purchase-fastest-service.php @@ -81,13 +81,13 @@ $eligible_rates = array_values(array_filter( $shipment['rates'], function($rate){ - return $rate['days'] <= MAX_TRANSIT_TIME_DAYS; + return $rate['estimated_days'] <= MAX_TRANSIT_TIME_DAYS; } )); // Select the fastest from eligible service levels usort($eligible_rates, function($a, $b) { - return $a['days'] - $b['days']; + return $a['estimated_days'] - $b['estimated_days']; }); // Purchase the desired rate with a transaction request diff --git a/examples/schedule-pickup.php b/examples/schedule-pickup.php new file mode 100644 index 0000000..448603a --- /dev/null +++ b/examples/schedule-pickup.php @@ -0,0 +1,171 @@ + Shipping label url: https://shippo-delivery-east.s3.amazonaws.com/785d52895d5a464cae35730a9f65ef28.pdf?Signature=TBmzL5S5mJ8BdzcacMQonaObZzE%3D&Expires=1510333519&AWSAccessKeyId=AKIAJGLCC5MYLLWIG42A +--> Shipping tracking number: CB150465075US + +Before running it, remember to do + composer install +*/ + +require_once(__DIR__ . '../../vendor/autoload.php'); + +// or if you do not have or want the composer autoload feature do +// require_once('path/to/shippo/library/folder/' . 'lib/Shippo.php'); + +// Replace with your credentials from https://app.goshippo.com/api/ +Shippo::setApiKey(''); + +// Example from_address array +// The complete refence for the address object is available here: https://goshippo.com/docs/reference#addresses +$from_address = array( + 'name' => 'Mr Hippo', + 'company' => 'Shippo', + 'street1' => '215 Clayton St.', + 'city' => 'San Francisco', + 'state' => 'CA', + 'zip' => '94117', + 'country' => 'US', + 'phone' => '+1 555 341 9393', + 'email' => 'mr-hippo@goshipppo.com', +); + +// Example to_address array +// The complete refence for the address object is available here: https://goshippo.com/docs/reference#addresses +$to_address = array( + 'name' => 'Ms Hippo', + 'company' => 'Regents Park', + 'street1' => 'Outer Cir', + 'city' => 'London', + 'zip' => 'NW1 4RY', + 'country' => 'GB', + 'phone' => '+1 555 341 9393', + 'email' => 'ms-hippo@goshipppo.com', + 'metadata' => 'For Order Number 123', +); + +// Parcel information array +// The complete reference for parcel object is here: https://goshippo.com/docs/reference#parcels +$parcel = array( + 'length'=> '5', + 'width'=> '5', + 'height'=> '5', + 'distance_unit'=> 'in', + 'weight'=> '2', + 'mass_unit'=> 'lb', +); + +// Example CustomsItems object. +// The complete reference for customs object is here: https://goshippo.com/docs/reference#customsitems +$customs_item = array( + 'description' => 'T-Shirt', + 'quantity' => '2', + 'net_weight' => '400', + 'mass_unit' => 'g', + 'value_amount' => '20', + 'value_currency' => 'USD', + 'origin_country' => 'US', + 'tariff_number' => '', +); + + +// Creating the Customs Declaration +// The details on creating the CustomsDeclaration is here: https://goshippo.com/docs/reference#customsdeclarations +$customs_declaration = Shippo_CustomsDeclaration::create( +array( + 'contents_type'=> 'MERCHANDISE', + 'contents_explanation'=> 'T-Shirt purchase', + 'non_delivery_option'=> 'RETURN', + 'certify'=> 'true', + 'certify_signer'=> 'Mr Hippo', + 'items'=> array($customs_item), +)); + + +// Example shipment object +// For complete reference to the shipment object: https://goshippo.com/docs/reference#shipments +// This object has async=false, indicating that the function will wait until all rates are generated before it returns. +// By default, Shippo handles responses asynchronously. However this will be depreciated soon. Learn more: https://goshippo.com/docs/async +$shipment = Shippo_Shipment::create( + array( + 'address_from' => $from_address, + 'address_to' => $to_address, + 'parcels'=> array($parcel), + 'customs_declaration' => $customs_declaration -> object_id, + 'async' => false, + ) +); + +// Filter rates by carrier +// Rates are stored in the `rates` array +// The details on the returned object are here: https://goshippo.com/docs/reference#rates +$filtered_rates = array_values(array_filter( + $shipment['rates'], + function($rate){ + return strtolower($rate['provider']) == 'usps' Or strtolower($rate['provider']) == 'dhl_express'; + } +)); + +$rate = $filtered_rates[1]; +$selected_rate_carrier_account = $rate['carrier_account']; +// dhl_express usps +// Purchase the desired rate with a transaction request +// Set async=false, indicating that the function will wait until the carrier returns a shipping label before it returns +$transaction = Shippo_Transaction::create(array( + 'rate'=> $rate['object_id'], + 'async'=> false, +)); + +// Print the shipping label from label_url +// Get the tracking number from tracking_number +// Most international shipments require you to add 3 commercial invoices in the package's "pouch", a special envelope attached on the package. Shippo automatically creates these 3 copies for you, which will be returned in the Transaction's commercial_invoice field. +if ($transaction['status'] != 'SUCCESS'){ + echo "Transaction failed with messages:" . "\n"; + foreach ($transaction['messages'] as $message) { + echo "--> " . $message . "\n"; + } + exit; +} + +$pickupTimeStart = date('Y-m-d H:i:s', time()); +$pickupTimeEnd = date('Y-m-d H:i:s', time() + 60*60*24); + +print_r(array( + "carrier_account" => $selected_rate_carrier_account, + "location" => array( + "building_location_type" => "Knock on Door", + "address" => $to_address + ), + "transactions" => array($transaction->object_id), + "requested_start_time" => $pickupTimeStart, + "requested_end_time" => $pickupTimeEnd, + "is_test" => true +)); + +$pickup = Shippo_Pickup::create(array( + "carrier_account" => $selected_rate_carrier_account, + "location" => array( + "building_location_type" => "Knock on Door", + "address" => $from_address + ), + "transactions" => array($transaction->object_id), + "requested_start_time" => $pickupTimeStart, + "requested_end_time" => $pickupTimeEnd, + "is_test" => true +)); +if ($pickup['status'] == 'SUCCESS'){ + echo "--> " . "Pickup has been scheduled\n"; +} else { + echo "Pickup failed with messages:" . "\n"; + foreach ($pickup['messages'] as $message) { + echo "--> " . $message . "\n"; + } +} + +// For more tutorals of address validation, tracking, returns, refunds, and other functionality, check out our +// complete documentation: https://goshippo.com/docs/ +?> diff --git a/lib/Shippo.php b/lib/Shippo.php index 5478f3b..bfb67e1 100644 --- a/lib/Shippo.php +++ b/lib/Shippo.php @@ -48,3 +48,5 @@ require(dirname(__FILE__) . '/Shippo/CarrierAccount.php'); require(dirname(__FILE__) . '/Shippo/Track.php'); require(dirname(__FILE__) . '/Shippo/Batch.php'); +require(dirname(__FILE__) . '/Shippo/Order.php'); +require(dirname(__FILE__) . '/Shippo/Pickup.php'); diff --git a/lib/Shippo/Address.php b/lib/Shippo/Address.php index f2e58e1..65536e2 100644 --- a/lib/Shippo/Address.php +++ b/lib/Shippo/Address.php @@ -11,14 +11,14 @@ class Shippo_Address extends Shippo_ApiResource */ public static function classUrl($class) { - return "/v1/addresses"; + return "/addresses"; } /** * @param array|null $params * @param string|null $apiKey * - * @return Shippo_Adress Create an Address. + * @return Shippo_Address Create an Address. */ public static function create($params = null, $apiKey = null) { diff --git a/lib/Shippo/ApiResource.php b/lib/Shippo/ApiResource.php index 9678355..10948bd 100644 --- a/lib/Shippo/ApiResource.php +++ b/lib/Shippo/ApiResource.php @@ -55,7 +55,7 @@ public static function className($class) public static function classUrl($class) { $base = self::_scopedLsb($class, 'className', $class); - return "/v1/${base}s"; + return "/${base}s"; } /** @@ -122,7 +122,7 @@ protected static function _scopedGet($class, $id, $params = null, $apiKey = null { self::_validateCall('create', $params, $apiKey); $requestor = new Shippo_ApiRequestor($apiKey); - $url = "/v1/shipments/" . $id . "/rates/{$params['currency']}"; + $url = "/shipments/" . $id . "/rates/{$params['currency']}"; list($response, $apiKey) = $requestor->request('get', $url, $params); return Shippo_Util::convertToShippoObject($response, $apiKey); } diff --git a/lib/Shippo/Batch.php b/lib/Shippo/Batch.php index 46de658..e407828 100644 --- a/lib/Shippo/Batch.php +++ b/lib/Shippo/Batch.php @@ -11,7 +11,7 @@ class Shippo_Batch extends Shippo_ApiResource */ public static function classUrl($class) { - return "/v1/batches"; + return "/batches"; } /** diff --git a/lib/Shippo/CarrierAccount.php b/lib/Shippo/CarrierAccount.php index cb8b03a..63ac5d9 100644 --- a/lib/Shippo/CarrierAccount.php +++ b/lib/Shippo/CarrierAccount.php @@ -11,14 +11,14 @@ class Shippo_CarrierAccount extends Shippo_ApiResource */ public static function classUrl($class) { - return "/v1/carrier_accounts"; + return "/carrier_accounts"; } /** * @param array|null $params * @param string|null $apiKey * - * @return Shippo_CustomsItem Create a customs item. + * @return Shippo_CarrierAccount Create a carrier account. */ public static function create($params = null, $apiKey = null) { @@ -29,7 +29,7 @@ public static function create($params = null, $apiKey = null) /** * @param array|null $params * - * @return Shippo_Retrieve Get a customs item. + * @return Shippo_Retrieve Get a carrier account. */ public static function retrieve($id, $apiKey = null) { @@ -40,7 +40,7 @@ public static function retrieve($id, $apiKey = null) /** * @param array|null $params * - * @return Shippo_All Get all the customs items. + * @return Shippo_All Get all the carrier account. */ public static function all($params = null, $apiKey = null) { @@ -51,7 +51,7 @@ public static function all($params = null, $apiKey = null) /** * @param id of the CarrierAccount to be updated * - * @return Shippo_Retrieve Get a customs item. + * @return Shippo_Retrieve Get a carrier account. */ public static function update($id, $params, $apiKey = null) { diff --git a/lib/Shippo/CustomsDeclaration.php b/lib/Shippo/CustomsDeclaration.php index 6476ac9..6338025 100644 --- a/lib/Shippo/CustomsDeclaration.php +++ b/lib/Shippo/CustomsDeclaration.php @@ -11,7 +11,7 @@ class Shippo_CustomsDeclaration extends Shippo_ApiResource */ public static function classUrl($class) { - return "/v1/customs/declarations"; + return "/customs/declarations"; } /** diff --git a/lib/Shippo/CustomsItem.php b/lib/Shippo/CustomsItem.php index 7b8c3bb..4dbb65c 100644 --- a/lib/Shippo/CustomsItem.php +++ b/lib/Shippo/CustomsItem.php @@ -11,7 +11,7 @@ class Shippo_CustomsItem extends Shippo_ApiResource */ public static function classUrl($class) { - return "/v1/customs/items"; + return "/customs/items"; } /** diff --git a/lib/Shippo/Order.php b/lib/Shippo/Order.php new file mode 100644 index 0000000..26116fd --- /dev/null +++ b/lib/Shippo/Order.php @@ -0,0 +1,38 @@ +mockRequest('POST', '/v1/batches/', + $this->mockRequest('POST', '/batches/', $data, $this->batchCreateResponse($carrier, $metadata)); $batch = Shippo_Batch::create($data); $this->assertEquals($batch->default_carrier_account, $carrier); @@ -60,7 +60,7 @@ public function testCreate() { public function testRetrieve() { $batch_id = 'test_batch_id'; - $this->mockRequest('GET', '/v1/batches/' . $batch_id, + $this->mockRequest('GET', '/batches/' . $batch_id, array(), $this->batchRetrieveResponse($batch_id)); $batch = Shippo_Batch::retrieve($batch_id); $this->assertEquals($batch->object_id, $batch_id); @@ -73,7 +73,7 @@ public function testAdd() { array('shipment' => 'batchID2'), array('shipment' => 'batchID3') ); - $this->mockRequest('POST', '/v1/batches/' . $batch_id . '/add_shipments/', + $this->mockRequest('POST', '/batches/' . $batch_id . '/add_shipments/', $data, $this->batchAddResponse($batch_id)); $batch = Shippo_Batch::add($batch_id, $data); $this->assertEquals($batch->object_id, $batch_id); @@ -85,7 +85,7 @@ public function testRemove() { "batchID1", "batchID2" ); - $this->mockRequest('POST', '/v1/batches/' . $batch_id . '/remove_shipments/', + $this->mockRequest('POST', '/batches/' . $batch_id . '/remove_shipments/', $data, $this->batchRemoveResponse($batch_id)); $batch = Shippo_Batch::remove($batch_id, $data); $this->assertEquals($batch->object_id, $batch_id); @@ -93,7 +93,7 @@ public function testRemove() { public function testPurchase() { $batch_id = 'test_batch_id'; - $this->mockRequest('POST', '/v1/batches/' . $batch_id . '/purchase/', + $this->mockRequest('POST', '/batches/' . $batch_id . '/purchase/', array(), $this->batchPurchaseResponse($batch_id)); $batch = Shippo_Batch::purchase($batch_id); $this->assertEquals($batch->object_id, $batch_id); diff --git a/test/CarrierAccountTest.php b/test/Shippo_CarrierAccountTest.php similarity index 95% rename from test/CarrierAccountTest.php rename to test/Shippo_CarrierAccountTest.php index 470e8c3..4f0d347 100644 --- a/test/CarrierAccountTest.php +++ b/test/Shippo_CarrierAccountTest.php @@ -10,7 +10,7 @@ public function testListAll() { public function testRetrieve() { $account_id = 'test_account_id'; - $this->mockRequest('GET', '/v1/carrier_accounts/' . $account_id, + $this->mockRequest('GET', '/carrier_accounts/' . $account_id, array(), $this->carrierRetrieveResponse($account_id)); $carrier_account = Shippo_CarrierAccount::retrieve($account_id); @@ -37,7 +37,7 @@ public function testUpdate() { $account_id = 'test_account_id'; $carrier = 'fedex'; $active = true; - $this->mockRequest('PUT', '/v1/carrier_accounts/' . $account_id, + $this->mockRequest('PUT', '/carrier_accounts/' . $account_id, array('active' => $active), $this->carrierUpdateResponse($account_id, $carrier, $active)); $updated_account = Shippo_CarrierAccount::update( $account_id, diff --git a/test/CurlClientTest.php b/test/Shippo_CurlClientTest.php similarity index 100% rename from test/CurlClientTest.php rename to test/Shippo_CurlClientTest.php diff --git a/test/CustomsDeclarationTest.php b/test/Shippo_CustomsDeclarationTest.php similarity index 100% rename from test/CustomsDeclarationTest.php rename to test/Shippo_CustomsDeclarationTest.php diff --git a/test/CustomsItemTest.php b/test/Shippo_CustomsItemTest.php similarity index 100% rename from test/CustomsItemTest.php rename to test/Shippo_CustomsItemTest.php diff --git a/test/ErrorTest.php b/test/Shippo_ErrorTest.php similarity index 100% rename from test/ErrorTest.php rename to test/Shippo_ErrorTest.php diff --git a/test/InvalidRequestErrorTest.php b/test/Shippo_InvalidRequestErrorTest.php similarity index 100% rename from test/InvalidRequestErrorTest.php rename to test/Shippo_InvalidRequestErrorTest.php diff --git a/test/ManifestTest.php b/test/Shippo_ManifestTest.php similarity index 96% rename from test/ManifestTest.php rename to test/Shippo_ManifestTest.php index 2ecd440..326eea1 100644 --- a/test/ManifestTest.php +++ b/test/Shippo_ManifestTest.php @@ -13,7 +13,7 @@ public function testCreate() 'transactions' => array('64bba01845ef40d29374032599f22588', 'c169aa586a844cc49da00d0272b590e1'), 'async' => false ); - $this->mockRequest('POST', '/v1/manifests/', + $this->mockRequest('POST', '/manifests/', $data, $this->manifestCreateResponse($carrier_account, $shipment_date)); $manifest = Shippo_Manifest::create($data); $this->assertEquals($manifest->carrier_account, $carrier_account); @@ -23,7 +23,7 @@ public function testCreate() public function testRetrieve() { $manifest_id = '0fadebf6f60c4aca95fa01bcc59c79ae'; - $this->mockRequest('GET', '/v1/manifests/' . $manifest_id, + $this->mockRequest('GET', '/manifests/' . $manifest_id, array(), $this->manifestRetrieveResponse($manifest_id)); $retrieve_manifest = Shippo_Manifest::retrieve($manifest_id); $this->assertEquals($retrieve_manifest->object_id, $manifest_id); diff --git a/test/ObjectTest.php b/test/Shippo_ObjectTest.php similarity index 100% rename from test/ObjectTest.php rename to test/Shippo_ObjectTest.php diff --git a/test/Shippo_OrderTest.php b/test/Shippo_OrderTest.php new file mode 100644 index 0000000..4e03bf4 --- /dev/null +++ b/test/Shippo_OrderTest.php @@ -0,0 +1,140 @@ +assertNotNull($order->object_id); + } + + public function testInvalidCreate() + { + try { + $order = Shippo_Order::create(array( + "total_tax" => "0.00", + "from_address" => array( + "city" =>"San Francisco", + "state" =>"CA", + "object_purpose" =>"PURCHASE", + "name" =>"lucas work", + "zip" =>"94103", + "country" =>"US", + "street2" =>"unit 200", + "street1" =>"731 Market ST", + "company" =>"Shippo", + "phone" =>"(985) 580-1234" + ), + "shipping_method" => null, + "weight" => 0, + "shop_app" =>"Shippo", + "currency" =>"USD", + "shipping_cost_currency" =>"USD", + "shipping_cost" => null, + "subtotal_price" =>"0", + "total_price" =>"0", + "items" => array( + array( + "total_amount" => 10.45, + "weight_unit" => "kg", + "title" => "package" + ) + ), + "order_status" =>"PAID", + "hidden" => false, + "order_number" =>"LOREM #1", + "weight_unit" =>"kg", + )); + } + catch (Exception $e) { + $this->assertTrue(true); + } + + } + + public function testRetrieve() + { + $order = self::getDefaultOrder(); + $retrieve_order = Shippo_Order::retrieve($order->object_id); + $this->assertEquals($retrieve_order->object_id, $order->object_id); + } + + public function testInvalidRetrieve() + { + $order = self::getDefaultOrder(); + $retrieve_order = Shippo_Order::retrieve($order->object_id); + $this->assertNotEquals($retrieve_order->object_id, 'Invalid Value'); + } + + public function testListAll() + { + $list = Shippo_Order::all(array( + 'results' => '3', + 'page' => '1' + )); + $this->assertFalse(is_null($list->results)); + } + + public function testListPageSize() + { + $pagesize = 1; + $list = Shippo_Order::all(array( + 'results' => $pagesize, + 'page' => '1' + )); + $this->assertEquals(count($list->results), $pagesize); + } + + public static function getDefaultOrder() + { + return Shippo_Order::create(array( + "total_tax" => "0.00", + "from_address" => array( + "city" =>"San Francisco", + "state" =>"CA", + "object_purpose" =>"PURCHASE", + "name" =>"lucas work", + "zip" =>"94103", + "country" =>"US", + "street2" =>"unit 200", + "street1" =>"731 Market ST", + "company" =>"Shippo", + "phone" =>"(985) 580-1234" + ), + "to_address" => array( + "object_purpose" =>"PURCHASE", + "name" =>"Mrs. Hippo", + "company" =>"Shippo & Co", + "street1" =>"156 Haviland Rd", + "street2" =>"", + "city" =>"Ridgefield", + "state" =>"CT", + "zip" =>"06877-2822", + "country" =>"US", + "phone" =>"+1 555 341 9393", + "email" =>"support@goshippo.com", + "metadata" =>"Customer ID 123456" + ), + "shipping_method" => null, + "weight" => 0, + "shop_app" =>"Shippo", + "currency" =>"USD", + "shipping_cost_currency" =>"USD", + "shipping_cost" => null, + "subtotal_price" =>"0", + "total_price" =>"0", + "items" => array( + array( + "total_amount" => 10.45, + "weight_unit" => "kg", + "title" => "package" + ) + ), + "order_status" =>"PAID", + "hidden" => false, + "order_number" =>"LOREM #1", + "weight_unit" =>"kg", + "placed_at" =>"2021-11-12T23:59:59" + )); + } +} diff --git a/test/ParcelTest.php b/test/Shippo_ParcelTest.php similarity index 98% rename from test/ParcelTest.php rename to test/Shippo_ParcelTest.php index 1d16ed8..0c14259 100644 --- a/test/ParcelTest.php +++ b/test/Shippo_ParcelTest.php @@ -45,7 +45,7 @@ public function testListAll() public function testListPageSize() { - $pagesize = 1; + $pagesize = 2; $list = Shippo_Parcel::all(array( 'results' => $pagesize, 'page' => '1' diff --git a/test/Shippo_PickupTest.php b/test/Shippo_PickupTest.php new file mode 100644 index 0000000..cebe688 --- /dev/null +++ b/test/Shippo_PickupTest.php @@ -0,0 +1,147 @@ + $rate->object_id, + "async" => false, + "label_file_type" => "PDF" + )); + try { + $pickup = self::getDefaultPickup($transaction->object_id, $rate->carrier_account, $shipment->address_from); + $this->assertEquals($pickup->status, 'CONFIRMED'); + } + catch (Exception $e) { + $jsonBody = (object) $e->jsonBody; + $this->assertEquals($jsonBody->status, 'ERROR'); + $this->assertEquals(substr($jsonBody->messages[0], 0, 28), 'You have already requested a'); + } + } + + public function testInvalidCreate() + { + try { + $invalid_account_id = 'XXXd8195e6e8a804f268380e99c9f24XXX'; + $pickup = self::getDefaultPickup($transaction->object_id, $invalid_account_id, $shipment->address_from); + } + catch (Exception $e) { + $this->assertTrue(true); + } + } + + private function getDefaultPickup($transactionId, $carrierAccount, $addressFrom) + { + $pickupTimeStart = date('Y-m-d', time()).'T'.date('H:i:s', time()).'.000Z'; + $pickupTimeEnd = date('Y-m-d', time() + 60*60*24).'T'.date('H:i:s', time()).'.000Z'; + return Shippo_Pickup::create(array( + + "carrier_account" => $carrierAccount, + "location" => array( + "building_location_type" => "Knock on Door", + "address" => self::getFromAddress() + ), + "transactions" => array($transactionId), + "requested_start_time" => $pickupTimeStart, + "requested_end_time" => $pickupTimeEnd, + "is_test" => true + )); + } + + private function getFromAddress() + { + return array( + "object_purpose"=> "PURCHASE", + 'name' => 'Mr Hippo', + 'company' => 'Shippo', + 'street1' => '85 Caine Avenue', + 'city' => 'San Francisco', + 'state' => 'CA', + 'zip' => '94112', + 'country' => 'US', + 'phone' => '+1 555 341 9393', + 'email' => 'mr-hippo@goshipppo.com', + ); + } + + private function getToAddress() + { + return array( + "object_purpose"=> "PURCHASE", + 'name' => 'Ms Hippo', + 'company' => "Regent's Park", + 'street1' => 'Outer Cir', + 'city' => 'London', + 'zip' => 'NW1 4RY', + 'country' => 'GB', + 'phone' => '+1 555 341 9393', + 'email' => 'ms-hippo@goshipppo.com', + 'metadata' => 'For Order Number 123', + ); + } + + private function getInternationalShipment() + { + $parcel = array( + 'length'=> '5', + 'width'=> '5', + 'height'=> '5', + 'distance_unit'=> 'in', + 'weight'=> '2', + 'mass_unit'=> 'lb', + ); + $customsDeclaration = Shippo_CustomsDeclaration::create(array( + 'exporter_reference' => '', + 'importer_reference' => '', + 'contents_type' => 'MERCHANDISE', + 'contents_explanation' => 'T-Shirt purchase', + 'invoice' => '#123123', + 'license' => '', + 'certificate' => '', + 'notes' => '', + 'eel_pfc' => 'NOEEI_30_37_a', + 'aes_itn' => '', + 'non_delivery_option' => 'ABANDON', + 'certify' => 'true', + 'certify_signer' => 'Laura Behrens Wu', + 'disclaimer' => '', + 'incoterm' => '', + 'items' => array(array( + 'description' => 'T-Shirt', + 'quantity' => '2', + 'net_weight' => '400', + 'mass_unit' => 'g', + 'value_amount' => '20', + 'value_currency' => 'USD', + 'tariff_number' => '', + 'origin_country' => 'US', + 'metadata' => 'Order ID #123123' + )), + 'metadata' => 'Order ID #123123' + )); + // Example shipment object + // For complete reference to the shipment object: https://goshippo.com/docs/reference#shipments + // This object has async=false, indicating that the function will wait until all rates are generated before it returns. + // By default, Shippo handles responses asynchronously. However this will be depreciated soon. Learn more: https://goshippo.com/docs/async + return Shippo_Shipment::create( + array( + "object_purpose"=> "PURCHASE", + 'address_from'=> Shippo_Address::create(self::getFromAddress()), + 'address_to'=> Shippo_Address::create(self::getToAddress()), + 'parcels'=> array($parcel), + "customs_declaration"=> $customsDeclaration->object_id, + 'test'=> true, + 'async'=> false, + ) + ); + } +} diff --git a/test/RateTest.php b/test/Shippo_RateTest.php similarity index 100% rename from test/RateTest.php rename to test/Shippo_RateTest.php diff --git a/test/RefundTest.php b/test/Shippo_RefundTest.php similarity index 76% rename from test/RefundTest.php rename to test/Shippo_RefundTest.php index f6709ab..0b87e4b 100644 --- a/test/RefundTest.php +++ b/test/Shippo_RefundTest.php @@ -1,7 +1,7 @@ mockRequest('GET', '/v1/tracks/' . $carrier . '/' . $tracking_id, + $this->mockRequest('GET', '/tracks/' . $carrier . '/' . $tracking_id, array(), $this->trackingResponse($tracking_id, $carrier, null)); $status = Shippo_Track::get_status(array( 'id' => $tracking_id, @@ -25,7 +25,7 @@ public function testCreate() { 'tracking_number' => $tracking_id, 'metadata' => $metadata ); - $this->mockRequest('POST', '/v1/tracks/', + $this->mockRequest('POST', '/tracks/', $params, $this->trackingResponse($tracking_id, $carrier, $metadata)); $webhook_response = Shippo_Track::create($params); $this->assertEquals($webhook_response->carrier, $carrier); diff --git a/test/TransactionTest.php b/test/Shippo_TransactionTest.php similarity index 96% rename from test/TransactionTest.php rename to test/Shippo_TransactionTest.php index e42550f..495f26e 100644 --- a/test/TransactionTest.php +++ b/test/Shippo_TransactionTest.php @@ -11,7 +11,7 @@ public function testCreate() 'rate' => $rate, 'metadata' => $metadata ); - $this->mockRequest('POST', '/v1/transactions/', + $this->mockRequest('POST', '/transactions/', $data, $this->transactionCreateResponse($rate, $metadata)); $transaction = Shippo_Transaction::create($data); @@ -22,7 +22,7 @@ public function testCreate() public function testRetrieve() { $transaction_id = '70ae8117ee1749e393f249d5b77c45e0'; - $this->mockRequest('GET', '/v1/transactions/' . $transaction_id, + $this->mockRequest('GET', '/transactions/' . $transaction_id, array(), $this->transactionRetrieveResponse($transaction_id)); $retrieve_transaction = Shippo_Transaction::retrieve($transaction_id); $this->assertEquals($retrieve_transaction->object_id, $transaction_id); diff --git a/test/UtilTest.php b/test/Shippo_UtilTest.php similarity index 100% rename from test/UtilTest.php rename to test/Shippo_UtilTest.php diff --git a/test/TestCase.php b/test/TestCase.php index 34c3ade..34a15b8 100644 --- a/test/TestCase.php +++ b/test/TestCase.php @@ -3,14 +3,14 @@ require 'vendor/autoload.php'; // Base class for test cases -class TestCase extends \PHPUnit_Framework_TestCase +class TestCase extends \PHPUnit\Framework\TestCase { const SHIPPO_KEY = ''; //mock curl client for mocking requests private $mock; - protected function setUp() + protected function setUp() : void { self::authFromEnv(); Shippo_ApiRequestor::setHttpClient(CurlClient::instance());