From 70cb7db12fdf03b65d6a7121dcc6974b5fe63f29 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 27 Jan 2021 08:42:00 +1100 Subject: [PATCH] Fixes for parallel testing --- composer.json | 1 + composer.lock | 429 ++++++++++++------ tests/Integration/CompanyLedgerTest.php | 18 +- .../PaymentDrivers/AuthorizeTest.php | 1 - tests/MockAccountData.php | 70 +-- 5 files changed, 338 insertions(+), 181 deletions(-) diff --git a/composer.json b/composer.json index 6b364fa997c6..b9e2ba43218e 100644 --- a/composer.json +++ b/composer.json @@ -70,6 +70,7 @@ "php": "^7.4", "anahkiasen/former": "^4.2", "barryvdh/laravel-debugbar": "^3.4", + "brianium/paratest": "^6.1", "darkaonline/l5-swagger": "^8.0", "facade/ignition": "^2.3.6", "filp/whoops": "^2.7", diff --git a/composer.lock b/composer.lock index c662b6464375..256aeba52da0 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": "94ab2953278081e3fdf663e1e7cf14c4", + "content-hash": "d7265c55f98aa6cfeb2cfd26bd438c7f", "packages": [ { "name": "asgrim/ofxparser", @@ -116,16 +116,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.171.20", + "version": "3.172.1", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "02aaf7007c5678a6358ea924cd85531300aa1747" + "reference": "28a0929598be6e9e0b652091712068d37acd9d0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/02aaf7007c5678a6358ea924cd85531300aa1747", - "reference": "02aaf7007c5678a6358ea924cd85531300aa1747", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/28a0929598be6e9e0b652091712068d37acd9d0a", + "reference": "28a0929598be6e9e0b652091712068d37acd9d0a", "shasum": "" }, "require": { @@ -200,9 +200,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.171.20" + "source": "https://github.com/aws/aws-sdk-php/tree/3.172.1" }, - "time": "2021-01-19T19:13:08+00:00" + "time": "2021-01-26T19:11:49+00:00" }, { "name": "beganovich/snappdf", @@ -259,26 +259,26 @@ }, { "name": "brick/math", - "version": "0.9.1", + "version": "0.9.2", "source": { "type": "git", "url": "https://github.com/brick/math.git", - "reference": "283a40c901101e66de7061bd359252c013dcc43c" + "reference": "dff976c2f3487d42c1db75a3b180e2b9f0e72ce0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/brick/math/zipball/283a40c901101e66de7061bd359252c013dcc43c", - "reference": "283a40c901101e66de7061bd359252c013dcc43c", + "url": "https://api.github.com/repos/brick/math/zipball/dff976c2f3487d42c1db75a3b180e2b9f0e72ce0", + "reference": "dff976c2f3487d42c1db75a3b180e2b9f0e72ce0", "shasum": "" }, "require": { "ext-json": "*", - "php": "^7.1|^8.0" + "php": "^7.1 || ^8.0" }, "require-dev": { "php-coveralls/php-coveralls": "^2.2", - "phpunit/phpunit": "^7.5.15|^8.5", - "vimeo/psalm": "^3.5" + "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.0", + "vimeo/psalm": "4.3.2" }, "type": "library", "autoload": { @@ -303,7 +303,7 @@ ], "support": { "issues": "https://github.com/brick/math/issues", - "source": "https://github.com/brick/math/tree/master" + "source": "https://github.com/brick/math/tree/0.9.2" }, "funding": [ { @@ -311,7 +311,7 @@ "type": "tidelift" } ], - "time": "2020-08-18T23:57:15+00:00" + "time": "2021-01-20T22:51:39+00:00" }, { "name": "checkout/checkout-sdk-php", @@ -436,12 +436,12 @@ "version": "v1.5.0", "source": { "type": "git", - "url": "https://github.com/clue/php-stream-filter.git", + "url": "https://github.com/clue/stream-filter.git", "reference": "aeb7d8ea49c7963d3b581378955dbf5bc49aa320" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/clue/php-stream-filter/zipball/aeb7d8ea49c7963d3b581378955dbf5bc49aa320", + "url": "https://api.github.com/repos/clue/stream-filter/zipball/aeb7d8ea49c7963d3b581378955dbf5bc49aa320", "reference": "aeb7d8ea49c7963d3b581378955dbf5bc49aa320", "shasum": "" }, @@ -482,8 +482,8 @@ "stream_filter_register" ], "support": { - "issues": "https://github.com/clue/php-stream-filter/issues", - "source": "https://github.com/clue/php-stream-filter/tree/v1.5.0" + "issues": "https://github.com/clue/stream-filter/issues", + "source": "https://github.com/clue/stream-filter/tree/v1.5.0" }, "funding": [ { @@ -2665,16 +2665,16 @@ }, { "name": "laravel/framework", - "version": "v8.23.1", + "version": "v8.25.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "a813df1b248ca305e5f5ce23ea981ed6c6905504" + "reference": "05da44d6823c2923597519ac10151f5827a24f80" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/a813df1b248ca305e5f5ce23ea981ed6c6905504", - "reference": "a813df1b248ca305e5f5ce23ea981ed6c6905504", + "url": "https://api.github.com/repos/laravel/framework/zipball/05da44d6823c2923597519ac10151f5827a24f80", + "reference": "05da44d6823c2923597519ac10151f5827a24f80", "shasum": "" }, "require": { @@ -2761,6 +2761,7 @@ }, "suggest": { "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage and SES mail driver (^3.155).", + "brianium/paratest": "Required to run tests in parallel (^6.0).", "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6|^3.0).", "ext-ftp": "Required to use the Flysystem FTP driver.", "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().", @@ -2828,20 +2829,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-01-19T14:10:48+00:00" + "time": "2021-01-26T14:40:21+00:00" }, { "name": "laravel/slack-notification-channel", - "version": "v2.3.0", + "version": "v2.3.1", "source": { "type": "git", "url": "https://github.com/laravel/slack-notification-channel.git", - "reference": "f8a3893d9de36b86e941dac76c06c28141209970" + "reference": "f428e76b8d0a0a2ff413ab225eeb829b9a8ffc20" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/slack-notification-channel/zipball/f8a3893d9de36b86e941dac76c06c28141209970", - "reference": "f8a3893d9de36b86e941dac76c06c28141209970", + "url": "https://api.github.com/repos/laravel/slack-notification-channel/zipball/f428e76b8d0a0a2ff413ab225eeb829b9a8ffc20", + "reference": "f428e76b8d0a0a2ff413ab225eeb829b9a8ffc20", "shasum": "" }, "require": { @@ -2887,9 +2888,9 @@ ], "support": { "issues": "https://github.com/laravel/slack-notification-channel/issues", - "source": "https://github.com/laravel/slack-notification-channel/tree/v2.3.0" + "source": "https://github.com/laravel/slack-notification-channel/tree/v2.3.1" }, - "time": "2020-11-03T19:18:22+00:00" + "time": "2021-01-26T20:04:54+00:00" }, { "name": "laravel/socialite", @@ -3594,30 +3595,30 @@ }, { "name": "league/oauth1-client", - "version": "v1.8.2", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/thephpleague/oauth1-client.git", - "reference": "159c3d2bf27568f9af87d6c3f4bb616a251eb12b" + "reference": "1e7e6be2dc543bf466236fb171e5b20e1b06aee6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/oauth1-client/zipball/159c3d2bf27568f9af87d6c3f4bb616a251eb12b", - "reference": "159c3d2bf27568f9af87d6c3f4bb616a251eb12b", + "url": "https://api.github.com/repos/thephpleague/oauth1-client/zipball/1e7e6be2dc543bf466236fb171e5b20e1b06aee6", + "reference": "1e7e6be2dc543bf466236fb171e5b20e1b06aee6", "shasum": "" }, "require": { "ext-json": "*", "ext-openssl": "*", "guzzlehttp/guzzle": "^6.0|^7.0", - "php": ">=7.1" + "php": ">=7.1||>=8.0" }, "require-dev": { "ext-simplexml": "*", - "friendsofphp/php-cs-fixer": "^2.16.1", - "mockery/mockery": "^1.3", + "friendsofphp/php-cs-fixer": "^2.17", + "mockery/mockery": "^1.3.3", "phpstan/phpstan": "^0.12.42", - "phpunit/phpunit": "^7.5" + "phpunit/phpunit": "^7.5||9.5" }, "suggest": { "ext-simplexml": "For decoding XML-based responses." @@ -3663,9 +3664,9 @@ ], "support": { "issues": "https://github.com/thephpleague/oauth1-client/issues", - "source": "https://github.com/thephpleague/oauth1-client/tree/v1.8.2" + "source": "https://github.com/thephpleague/oauth1-client/tree/v1.9.0" }, - "time": "2020-09-28T09:39:08+00:00" + "time": "2021-01-20T01:40:53+00:00" }, { "name": "league/omnipay", @@ -3726,16 +3727,16 @@ }, { "name": "livewire/livewire", - "version": "v2.3.6", + "version": "v2.3.8", "source": { "type": "git", "url": "https://github.com/livewire/livewire.git", - "reference": "8663232c198ef12964b62559e9bb2023eb86701d" + "reference": "c661e295428b2baaff04320d0a9424db5ca72be5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/livewire/livewire/zipball/8663232c198ef12964b62559e9bb2023eb86701d", - "reference": "8663232c198ef12964b62559e9bb2023eb86701d", + "url": "https://api.github.com/repos/livewire/livewire/zipball/c661e295428b2baaff04320d0a9424db5ca72be5", + "reference": "c661e295428b2baaff04320d0a9424db5ca72be5", "shasum": "" }, "require": { @@ -3786,7 +3787,7 @@ "description": "A front-end framework for Laravel.", "support": { "issues": "https://github.com/livewire/livewire/issues", - "source": "https://github.com/livewire/livewire/tree/v2.3.6" + "source": "https://github.com/livewire/livewire/tree/v2.3.8" }, "funding": [ { @@ -3794,7 +3795,7 @@ "type": "github" } ], - "time": "2021-01-08T17:33:29+00:00" + "time": "2021-01-21T14:01:48+00:00" }, { "name": "maennchen/zipstream-php", @@ -4678,33 +4679,29 @@ }, { "name": "paragonie/random_compat", - "version": "v2.0.19", + "version": "v9.99.100", "source": { "type": "git", "url": "https://github.com/paragonie/random_compat.git", - "reference": "446fc9faa5c2a9ddf65eb7121c0af7e857295241" + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/446fc9faa5c2a9ddf65eb7121c0af7e857295241", - "reference": "446fc9faa5c2a9ddf65eb7121c0af7e857295241", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a", "shasum": "" }, "require": { - "php": ">=5.2.0" + "php": ">= 7" }, "require-dev": { - "phpunit/phpunit": "4.*|5.*" + "phpunit/phpunit": "4.*|5.*", + "vimeo/psalm": "^1" }, "suggest": { "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." }, "type": "library", - "autoload": { - "files": [ - "lib/random.php" - ] - }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" @@ -4728,7 +4725,7 @@ "issues": "https://github.com/paragonie/random_compat/issues", "source": "https://github.com/paragonie/random_compat" }, - "time": "2020-10-15T10:06:57+00:00" + "time": "2020-10-15T08:29:30+00:00" }, { "name": "php-http/client-common", @@ -5254,21 +5251,21 @@ }, { "name": "phpseclib/phpseclib", - "version": "3.0.3", + "version": "3.0.4", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "97a5a270e4a9ebfc1a7e2f462e917cbce1a8e6d9" + "reference": "845a2275e886ba9fb386c8f59cb383dd9c8963e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/97a5a270e4a9ebfc1a7e2f462e917cbce1a8e6d9", - "reference": "97a5a270e4a9ebfc1a7e2f462e917cbce1a8e6d9", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/845a2275e886ba9fb386c8f59cb383dd9c8963e9", + "reference": "845a2275e886ba9fb386c8f59cb383dd9c8963e9", "shasum": "" }, "require": { "paragonie/constant_time_encoding": "^1|^2", - "paragonie/random_compat": "^1.4|^2.0", + "paragonie/random_compat": "^1.4|^2.0|^9.99.99", "php": ">=5.6.1" }, "require-dev": { @@ -5345,7 +5342,7 @@ ], "support": { "issues": "https://github.com/phpseclib/phpseclib/issues", - "source": "https://github.com/phpseclib/phpseclib/tree/3.0.3" + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.4" }, "funding": [ { @@ -5361,7 +5358,7 @@ "type": "tidelift" } ], - "time": "2021-01-16T17:35:19+00:00" + "time": "2021-01-25T19:02:05+00:00" }, { "name": "predis/predis", @@ -5977,16 +5974,16 @@ }, { "name": "ramsey/collection", - "version": "1.1.1", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/ramsey/collection.git", - "reference": "24d93aefb2cd786b7edd9f45b554aea20b28b9b1" + "reference": "28a5c4ab2f5111db6a60b2b4ec84057e0f43b9c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/collection/zipball/24d93aefb2cd786b7edd9f45b554aea20b28b9b1", - "reference": "24d93aefb2cd786b7edd9f45b554aea20b28b9b1", + "url": "https://api.github.com/repos/ramsey/collection/zipball/28a5c4ab2f5111db6a60b2b4ec84057e0f43b9c1", + "reference": "28a5c4ab2f5111db6a60b2b4ec84057e0f43b9c1", "shasum": "" }, "require": { @@ -5996,19 +5993,19 @@ "captainhook/captainhook": "^5.3", "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", "ergebnis/composer-normalize": "^2.6", - "fzaninotto/faker": "^1.5", + "fakerphp/faker": "^1.5", "hamcrest/hamcrest-php": "^2", - "jangregor/phpstan-prophecy": "^0.6", + "jangregor/phpstan-prophecy": "^0.8", "mockery/mockery": "^1.3", "phpstan/extension-installer": "^1", "phpstan/phpstan": "^0.12.32", "phpstan/phpstan-mockery": "^0.12.5", "phpstan/phpstan-phpunit": "^0.12.11", - "phpunit/phpunit": "^8.5", + "phpunit/phpunit": "^8.5 || ^9", "psy/psysh": "^0.10.4", "slevomat/coding-standard": "^6.3", "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^3.12.2" + "vimeo/psalm": "^4.4" }, "type": "library", "autoload": { @@ -6038,15 +6035,19 @@ ], "support": { "issues": "https://github.com/ramsey/collection/issues", - "source": "https://github.com/ramsey/collection/tree/1.1.1" + "source": "https://github.com/ramsey/collection/tree/1.1.3" }, "funding": [ { "url": "https://github.com/ramsey", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/collection", + "type": "tidelift" } ], - "time": "2020-09-10T20:58:17+00:00" + "time": "2021-01-21T17:40:04+00:00" }, { "name": "ramsey/uuid", @@ -6484,16 +6485,16 @@ }, { "name": "sentry/sentry", - "version": "3.1.2", + "version": "3.1.3", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-php.git", - "reference": "e9b2d45b248d75f4c79a9d166b13b947b72f01fa" + "reference": "db8a322f87983bb4f3cd8db01f9a9a593efe72a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/e9b2d45b248d75f4c79a9d166b13b947b72f01fa", - "reference": "e9b2d45b248d75f4c79a9d166b13b947b72f01fa", + "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/db8a322f87983bb4f3cd8db01f9a9a593efe72a3", + "reference": "db8a322f87983bb4f3cd8db01f9a9a593efe72a3", "shasum": "" }, "require": { @@ -6573,7 +6574,7 @@ ], "support": { "issues": "https://github.com/getsentry/sentry-php/issues", - "source": "https://github.com/getsentry/sentry-php/tree/3.1.2" + "source": "https://github.com/getsentry/sentry-php/tree/3.1.3" }, "funding": [ { @@ -6585,7 +6586,7 @@ "type": "custom" } ], - "time": "2021-01-07T18:51:44+00:00" + "time": "2021-01-25T08:47:45+00:00" }, { "name": "sentry/sentry-laravel", @@ -6675,16 +6676,16 @@ }, { "name": "stripe/stripe-php", - "version": "v7.68.0", + "version": "v7.69.0", "source": { "type": "git", "url": "https://github.com/stripe/stripe-php.git", - "reference": "36b10e1f0e9d973f00f802bbd098bce85d0438e4" + "reference": "6716cbc4ebf8cba7d45374a059c7c6e5bf53277d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/stripe/stripe-php/zipball/36b10e1f0e9d973f00f802bbd098bce85d0438e4", - "reference": "36b10e1f0e9d973f00f802bbd098bce85d0438e4", + "url": "https://api.github.com/repos/stripe/stripe-php/zipball/6716cbc4ebf8cba7d45374a059c7c6e5bf53277d", + "reference": "6716cbc4ebf8cba7d45374a059c7c6e5bf53277d", "shasum": "" }, "require": { @@ -6730,9 +6731,9 @@ ], "support": { "issues": "https://github.com/stripe/stripe-php/issues", - "source": "https://github.com/stripe/stripe-php/tree/v7.68.0" + "source": "https://github.com/stripe/stripe-php/tree/v7.69.0" }, - "time": "2021-01-15T00:38:28+00:00" + "time": "2021-01-22T03:21:13+00:00" }, { "name": "swiftmailer/swiftmailer", @@ -9461,16 +9462,16 @@ }, { "name": "vlucas/phpdotenv", - "version": "v5.2.0", + "version": "v5.3.0", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "fba64139db67123c7a57072e5f8d3db10d160b66" + "reference": "b3eac5c7ac896e52deab4a99068e3f4ab12d9e56" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/fba64139db67123c7a57072e5f8d3db10d160b66", - "reference": "fba64139db67123c7a57072e5f8d3db10d160b66", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/b3eac5c7ac896e52deab4a99068e3f4ab12d9e56", + "reference": "b3eac5c7ac896e52deab4a99068e3f4ab12d9e56", "shasum": "" }, "require": { @@ -9485,7 +9486,7 @@ "require-dev": { "bamarni/composer-bin-plugin": "^1.4.1", "ext-filter": "*", - "phpunit/phpunit": "^7.5.20 || ^8.5.2 || ^9.0" + "phpunit/phpunit": "^7.5.20 || ^8.5.14 || ^9.5.1" }, "suggest": { "ext-filter": "Required to use the boolean validator." @@ -9493,7 +9494,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.2-dev" + "dev-master": "5.3-dev" } }, "autoload": { @@ -9525,7 +9526,7 @@ ], "support": { "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/v5.2.0" + "source": "https://github.com/vlucas/phpdotenv/tree/v5.3.0" }, "funding": [ { @@ -9537,7 +9538,7 @@ "type": "tidelift" } ], - "time": "2020-09-14T15:57:31+00:00" + "time": "2021-01-20T15:23:13+00:00" }, { "name": "voku/portable-ascii", @@ -9618,12 +9619,12 @@ "version": "1.9.1", "source": { "type": "git", - "url": "https://github.com/webmozart/assert.git", + "url": "https://github.com/webmozarts/assert.git", "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", "shasum": "" }, @@ -9661,8 +9662,8 @@ "validate" ], "support": { - "issues": "https://github.com/webmozart/assert/issues", - "source": "https://github.com/webmozart/assert/tree/master" + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.9.1" }, "time": "2020-07-08T17:02:28+00:00" }, @@ -10100,6 +10101,86 @@ ], "time": "2021-01-06T14:21:44+00:00" }, + { + "name": "brianium/paratest", + "version": "v6.1.2", + "source": { + "type": "git", + "url": "https://github.com/paratestphp/paratest.git", + "reference": "235db99a43401d68fdc4495b20b49291ea2e767d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/235db99a43401d68fdc4495b20b49291ea2e767d", + "reference": "235db99a43401d68fdc4495b20b49291ea2e767d", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-simplexml": "*", + "php": "^7.3 || ^8.0", + "phpunit/php-code-coverage": "^9.2.5", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-timer": "^5.0.3", + "phpunit/phpunit": "^9.5.0", + "sebastian/environment": "^5.1.3", + "symfony/console": "^4.4 || ^5.2", + "symfony/process": "^4.4 || ^5.2" + }, + "require-dev": { + "doctrine/coding-standard": "^8.2.0", + "ekino/phpstan-banned-code": "^0.3.1", + "ergebnis/phpstan-rules": "^0.15.3", + "ext-posix": "*", + "infection/infection": "^0.18.2", + "phpstan/phpstan": "^0.12.58", + "phpstan/phpstan-deprecation-rules": "^0.12.5", + "phpstan/phpstan-phpunit": "^0.12.16", + "phpstan/phpstan-strict-rules": "^0.12.5", + "squizlabs/php_codesniffer": "^3.5.8", + "symfony/filesystem": "^5.2.0", + "thecodingmachine/phpstan-strict-rules": "^0.12.1", + "vimeo/psalm": "^4.3.1" + }, + "bin": [ + "bin/paratest" + ], + "type": "library", + "autoload": { + "psr-4": { + "ParaTest\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Scaturro", + "email": "scaturrob@gmail.com", + "homepage": "http://brianscaturro.com", + "role": "Lead" + } + ], + "description": "Parallel testing for PHP", + "homepage": "https://github.com/paratestphp/paratest", + "keywords": [ + "concurrent", + "parallel", + "phpunit", + "testing" + ], + "support": { + "issues": "https://github.com/paratestphp/paratest/issues", + "source": "https://github.com/paratestphp/paratest/tree/v6.1.2" + }, + "time": "2020-12-15T11:41:54+00:00" + }, { "name": "darkaonline/l5-swagger", "version": "8.0.4", @@ -10390,16 +10471,16 @@ }, { "name": "facade/ignition", - "version": "2.5.8", + "version": "2.5.9", "source": { "type": "git", "url": "https://github.com/facade/ignition.git", - "reference": "8e907d81244649c5ea746e2ec30c32c5f59df472" + "reference": "66b3138ecce38024723fb3bfc66ef8852a779ea9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/facade/ignition/zipball/8e907d81244649c5ea746e2ec30c32c5f59df472", - "reference": "8e907d81244649c5ea746e2ec30c32c5f59df472", + "url": "https://api.github.com/repos/facade/ignition/zipball/66b3138ecce38024723fb3bfc66ef8852a779ea9", + "reference": "66b3138ecce38024723fb3bfc66ef8852a779ea9", "shasum": "" }, "require": { @@ -10463,7 +10544,7 @@ "issues": "https://github.com/facade/ignition/issues", "source": "https://github.com/facade/ignition" }, - "time": "2020-12-29T09:12:55+00:00" + "time": "2021-01-26T14:45:19+00:00" }, { "name": "facade/ignition-contracts", @@ -10621,16 +10702,16 @@ }, { "name": "filp/whoops", - "version": "2.9.1", + "version": "2.9.2", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "307fb34a5ab697461ec4c9db865b20ff2fd40771" + "reference": "df7933820090489623ce0be5e85c7e693638e536" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/307fb34a5ab697461ec4c9db865b20ff2fd40771", - "reference": "307fb34a5ab697461ec4c9db865b20ff2fd40771", + "url": "https://api.github.com/repos/filp/whoops/zipball/df7933820090489623ce0be5e85c7e693638e536", + "reference": "df7933820090489623ce0be5e85c7e693638e536", "shasum": "" }, "require": { @@ -10680,22 +10761,28 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.9.1" + "source": "https://github.com/filp/whoops/tree/2.9.2" }, - "time": "2020-11-01T12:00:00+00:00" + "funding": [ + { + "url": "https://github.com/denis-sokolov", + "type": "github" + } + ], + "time": "2021-01-24T12:00:00+00:00" }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.18.0", + "version": "v2.18.2", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "cbc5b50bfa2688a1afca20e5a8c71f058e9ccbef" + "reference": "18f8c9d184ba777380794a389fabc179896ba913" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/cbc5b50bfa2688a1afca20e5a8c71f058e9ccbef", - "reference": "cbc5b50bfa2688a1afca20e5a8c71f058e9ccbef", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/18f8c9d184ba777380794a389fabc179896ba913", + "reference": "18f8c9d184ba777380794a389fabc179896ba913", "shasum": "" }, "require": { @@ -10777,7 +10864,7 @@ "description": "A tool to automatically fix PHP code style", "support": { "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", - "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.18.0" + "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.18.2" }, "funding": [ { @@ -10785,7 +10872,7 @@ "type": "github" } ], - "time": "2021-01-18T03:31:06+00:00" + "time": "2021-01-26T00:22:21+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -11086,16 +11173,16 @@ }, { "name": "nunomaduro/collision", - "version": "v5.2.0", + "version": "v5.3.0", "source": { "type": "git", "url": "https://github.com/nunomaduro/collision.git", - "reference": "aca954fd03414ba0dd85d7d8e42ba9b251893d1f" + "reference": "aca63581f380f63a492b1e3114604e411e39133a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/collision/zipball/aca954fd03414ba0dd85d7d8e42ba9b251893d1f", - "reference": "aca954fd03414ba0dd85d7d8e42ba9b251893d1f", + "url": "https://api.github.com/repos/nunomaduro/collision/zipball/aca63581f380f63a492b1e3114604e411e39133a", + "reference": "aca63581f380f63a492b1e3114604e411e39133a", "shasum": "" }, "require": { @@ -11170,7 +11257,7 @@ "type": "patreon" } ], - "time": "2021-01-13T10:00:08+00:00" + "time": "2021-01-25T15:34:13+00:00" }, { "name": "openlss/lib-array2xml", @@ -13064,32 +13151,94 @@ "time": "2020-11-24T11:46:24+00:00" }, { - "name": "spatie/laravel-ray", - "version": "1.8.0", + "name": "spatie/laravel-package-tools", + "version": "1.1.0", "source": { "type": "git", - "url": "https://github.com/spatie/laravel-ray.git", - "reference": "976e1501a5ffc2bd266c39cdc545c0c77c581f3d" + "url": "https://github.com/spatie/laravel-package-tools.git", + "reference": "40d0df6ef74f2478ed66cbaa821b4df0007daa15" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-ray/zipball/976e1501a5ffc2bd266c39cdc545c0c77c581f3d", - "reference": "976e1501a5ffc2bd266c39cdc545c0c77c581f3d", + "url": "https://api.github.com/repos/spatie/laravel-package-tools/zipball/40d0df6ef74f2478ed66cbaa821b4df0007daa15", + "reference": "40d0df6ef74f2478ed66cbaa821b4df0007daa15", "shasum": "" }, "require": { "illuminate/contracts": "^7.0|^8.0", - "illuminate/database": "^7.0|^8.13", - "illuminate/support": "^7.0|^8.13", + "mockery/mockery": "^1.4", + "php": "^7.4|^8.0" + }, + "require-dev": { + "orchestra/testbench": "^5.0|^6.0", + "phpunit/phpunit": "^9.3", + "spatie/test-time": "^1.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\LaravelPackageTools\\": "src", + "Spatie\\LaravelPackageTools\\Database\\Factories\\": "database/factories" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "role": "Developer" + } + ], + "description": "Tools for creating Laravel packages", + "homepage": "https://github.com/spatie/laravel-package-tools", + "keywords": [ + "laravel-package-tools", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/laravel-package-tools/issues", + "source": "https://github.com/spatie/laravel-package-tools/tree/1.1.0" + }, + "funding": [ + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2021-01-25T14:41:19+00:00" + }, + { + "name": "spatie/laravel-ray", + "version": "1.9.1", + "source": { + "type": "git", + "url": "https://github.com/spatie/laravel-ray.git", + "reference": "48ea89c80fdc155c2c6c20a7785fc8b484efa440" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/laravel-ray/zipball/48ea89c80fdc155c2c6c20a7785fc8b484efa440", + "reference": "48ea89c80fdc155c2c6c20a7785fc8b484efa440", + "shasum": "" + }, + "require": { + "illuminate/contracts": "^7.20|^8.0", + "illuminate/database": "^7.20|^8.13", + "illuminate/queue": "^7.20|^8.13", + "illuminate/support": "^7.20|^8.13", "php": "^7.4|^8.0", "spatie/backtrace": "^1.0", + "spatie/laravel-package-tools": "^1.0.1", "spatie/ray": "^1.13", "symfony/stopwatch": "4.2|^5.1", "zbateson/mail-mime-parser": "^1.3.1" }, "require-dev": { - "illuminate/mail": "^7.0|^8.19", - "illuminate/view": "^7.0|^8.19", + "illuminate/mail": "^7.20|^8.19", + "illuminate/view": "^7.20|^8.19", "orchestra/testbench": "^5.0|^6.0", "phpunit/phpunit": "^9.3", "spatie/phpunit-snapshot-assertions": "^4.2" @@ -13127,7 +13276,7 @@ ], "support": { "issues": "https://github.com/spatie/laravel-ray/issues", - "source": "https://github.com/spatie/laravel-ray/tree/1.8.0" + "source": "https://github.com/spatie/laravel-ray/tree/1.9.1" }, "funding": [ { @@ -13139,7 +13288,7 @@ "type": "other" } ], - "time": "2021-01-19T19:44:06+00:00" + "time": "2021-01-25T12:49:31+00:00" }, { "name": "spatie/macroable", @@ -13193,16 +13342,16 @@ }, { "name": "spatie/ray", - "version": "1.13.0", + "version": "1.17.0", "source": { "type": "git", "url": "https://github.com/spatie/ray.git", - "reference": "1df552d740f71f9866fa5b531ac7077726922f4e" + "reference": "d76c9e4b95292afdcfe59495a9fe9a6995da1c62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/ray/zipball/1df552d740f71f9866fa5b531ac7077726922f4e", - "reference": "1df552d740f71f9866fa5b531ac7077726922f4e", + "url": "https://api.github.com/repos/spatie/ray/zipball/d76c9e4b95292afdcfe59495a9fe9a6995da1c62", + "reference": "d76c9e4b95292afdcfe59495a9fe9a6995da1c62", "shasum": "" }, "require": { @@ -13251,7 +13400,7 @@ ], "support": { "issues": "https://github.com/spatie/ray/issues", - "source": "https://github.com/spatie/ray/tree/1.13.0" + "source": "https://github.com/spatie/ray/tree/1.17.0" }, "funding": [ { @@ -13263,7 +13412,7 @@ "type": "other" } ], - "time": "2021-01-19T19:28:53+00:00" + "time": "2021-01-25T11:17:00+00:00" }, { "name": "swagger-api/swagger-ui", diff --git a/tests/Integration/CompanyLedgerTest.php b/tests/Integration/CompanyLedgerTest.php index de2baed347b0..9ab4af695746 100644 --- a/tests/Integration/CompanyLedgerTest.php +++ b/tests/Integration/CompanyLedgerTest.php @@ -26,6 +26,7 @@ use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Schema; use Illuminate\Validation\ValidationException; +use Tests\MockAccountData; use Tests\TestCase; /** @test*/ @@ -50,6 +51,7 @@ class CompanyLedgerTest extends TestCase $this->withoutExceptionHandling(); + $this->artisan('db:seed'); /* Warm up the cache !*/ $cached_tables = config('ninja.cached_tables'); @@ -94,6 +96,7 @@ class CompanyLedgerTest extends TestCase $settings->country_id = '840'; $settings->vat_number = 'vat number'; $settings->id_number = 'id number'; + $settings->timezone_id = '1'; $this->company->settings = $settings; $this->company->save(); @@ -101,17 +104,17 @@ class CompanyLedgerTest extends TestCase $this->account->default_company_id = $this->company->id; $this->account->save(); - $this->user = User::whereEmail('user@example.com')->first(); + $user = User::whereEmail('user@example.com')->first(); - if (! $this->user) { - $this->user = User::factory()->create([ + if (! $user) { + $user = User::factory()->create([ 'account_id' => $this->account->id, 'password' => Hash::make('ALongAndBriliantPassword'), 'confirmation_code' => $this->createDbHash(config('database.default')), ]); } - $cu = CompanyUserFactory::create($this->user->id, $this->company->id, $this->account->id); + $cu = CompanyUserFactory::create($user->id, $this->company->id, $this->account->id); $cu->is_owner = true; $cu->is_admin = true; $cu->save(); @@ -119,7 +122,7 @@ class CompanyLedgerTest extends TestCase $this->token = \Illuminate\Support\Str::random(64); $company_token = new CompanyToken; - $company_token->user_id = $this->user->id; + $company_token->user_id = $user->id; $company_token->company_id = $this->company->id; $company_token->account_id = $this->account->id; $company_token->name = 'test token'; @@ -127,12 +130,12 @@ class CompanyLedgerTest extends TestCase $company_token->save(); $this->client = Client::factory()->create([ - 'user_id' => $this->user->id, + 'user_id' => $user->id, 'company_id' => $this->company->id, ]); ClientContact::factory()->create([ - 'user_id' => $this->user->id, + 'user_id' => $user->id, 'client_id' => $this->client->id, 'company_id' => $this->company->id, 'is_primary' => 1, @@ -266,5 +269,6 @@ class CompanyLedgerTest extends TestCase $invoice = Invoice::find($invoice->id); $this->assertEquals($refund, $invoice->balance); + } } diff --git a/tests/Integration/PaymentDrivers/AuthorizeTest.php b/tests/Integration/PaymentDrivers/AuthorizeTest.php index 46b232a1d8e2..54928a2beef2 100644 --- a/tests/Integration/PaymentDrivers/AuthorizeTest.php +++ b/tests/Integration/PaymentDrivers/AuthorizeTest.php @@ -51,7 +51,6 @@ class AuthorizeTest extends TestCase $this->markTestSkipped('authorize.net not configured'); } - $this->makeTestData(); } public function testUnpackingVars() diff --git a/tests/MockAccountData.php b/tests/MockAccountData.php index db300ab645e4..e0d04df28279 100644 --- a/tests/MockAccountData.php +++ b/tests/MockAccountData.php @@ -131,6 +131,8 @@ trait MockAccountData /* Warm up the cache !*/ $cached_tables = config('ninja.cached_tables'); + $this->artisan('db:seed'); + foreach ($cached_tables as $name => $class) { // check that the table exists in case the migration is pending @@ -176,6 +178,7 @@ trait MockAccountData $settings->vat_number = 'vat number'; $settings->id_number = 'id number'; $settings->use_credits_payment = 'always'; + $settings->timezone_id = '1'; $this->company->settings = $settings; $this->company->save(); @@ -183,19 +186,22 @@ trait MockAccountData $this->account->default_company_id = $this->company->id; $this->account->save(); - $this->user = User::whereEmail('user@example.com')->first(); + $user = User::whereEmail('user@example.com')->first(); - if (! $this->user) { - $this->user = User::factory()->create([ + if (! $user) { + $user = User::factory()->create([ 'account_id' => $this->account->id, 'confirmation_code' => $this->createDbHash(config('database.default')), 'email' => 'user@example.com', ]); } - $this->user->password = Hash::make('ALongAndBriliantPassword'); + $user->password = Hash::make('ALongAndBriliantPassword'); + + $user_id = $user->id; + $this->user = $user; - $this->cu = CompanyUserFactory::create($this->user->id, $this->company->id, $this->account->id); + $this->cu = CompanyUserFactory::create($user->id, $this->company->id, $this->account->id); $this->cu->is_owner = true; $this->cu->is_admin = true; $this->cu->save(); @@ -203,7 +209,7 @@ trait MockAccountData $this->token = \Illuminate\Support\Str::random(64); $company_token = new CompanyToken; - $company_token->user_id = $this->user->id; + $company_token->user_id = $user->id; $company_token->company_id = $this->company->id; $company_token->account_id = $this->account->id; $company_token->name = 'test token'; @@ -212,15 +218,15 @@ trait MockAccountData $company_token->save(); - //todo create one token withe token name TOKEN - use firstOrCreate + //todo create one token with token name TOKEN - use firstOrCreate Product::factory()->create([ - 'user_id' => $this->user->id, + 'user_id' => $user_id, 'company_id' => $this->company->id, ]); $this->client = Client::factory()->create([ - 'user_id' => $this->user->id, + 'user_id' => $user_id, 'company_id' => $this->company->id, ]); @@ -229,7 +235,7 @@ trait MockAccountData Storage::makeDirectory($this->company->company_key.'/'.$this->client->client_hash.'/quotes', 0755, true); $contact = ClientContact::factory()->create([ - 'user_id' => $this->user->id, + 'user_id' => $user_id, 'client_id' => $this->client->id, 'company_id' => $this->company->id, 'is_primary' => 1, @@ -238,20 +244,20 @@ trait MockAccountData $contact2 = ClientContact::factory()->create([ - 'user_id' => $this->user->id, + 'user_id' => $user_id, 'client_id' => $this->client->id, 'company_id' => $this->company->id, 'send_email' => true, ]); $this->vendor = Vendor::factory()->create([ - 'user_id' => $this->user->id, + 'user_id' => $user_id, 'company_id' => $this->company->id, ]); $vendor_contact = VendorContact::factory()->create([ - 'user_id' => $this->user->id, + 'user_id' => $user_id, 'vendor_id' => $this->vendor->id, 'company_id' => $this->company->id, 'is_primary' => 1, @@ -259,34 +265,34 @@ trait MockAccountData ]); $vendor_contact2 = VendorContact::factory()->create([ - 'user_id' => $this->user->id, + 'user_id' => $user_id, 'vendor_id' => $this->vendor->id, 'company_id' => $this->company->id, 'send_email' => true, ]); $this->project = Project::factory()->create([ - 'user_id' => $this->user->id, + 'user_id' => $user_id, 'company_id' => $this->company->id, ]); $this->expense = Expense::factory()->create([ - 'user_id' => $this->user->id, + 'user_id' => $user_id, 'company_id' => $this->company->id, ]); $this->task = Task::factory()->create([ - 'user_id' => $this->user->id, + 'user_id' => $user_id, 'company_id' => $this->company->id, ]); $this->expense_category = ExpenseCategory::factory()->create([ - 'user_id' => $this->user->id, + 'user_id' => $user_id, 'company_id' => $this->company->id, ]); $this->task_status = TaskStatus::factory()->create([ - 'user_id' => $this->user->id, + 'user_id' => $user_id, 'company_id' => $this->company->id, ]); @@ -303,7 +309,7 @@ trait MockAccountData $this->client->group_settings_id = $gs->id; $this->client->save(); - $this->invoice = InvoiceFactory::create($this->company->id, $this->user->id); //stub the company and user_id + $this->invoice = InvoiceFactory::create($this->company->id, $user_id); //stub the company and user_id $this->invoice->client_id = $this->client->id; $this->invoice->line_items = $this->buildLineItems(); @@ -321,17 +327,15 @@ trait MockAccountData $this->invoice->save(); - //$this->invoice->service()->createInvitations()->markSent(); - //$this->invoice->service()->createInvitations(); InvoiceInvitation::factory()->create([ - 'user_id' => $this->user->id, + 'user_id' => $this->invoice->user_id, 'company_id' => $this->company->id, 'client_contact_id' => $contact->id, 'invoice_id' => $this->invoice->id, ]); InvoiceInvitation::factory()->create([ - 'user_id' => $this->user->id, + 'user_id' => $this->invoice->user_id, 'company_id' => $this->company->id, 'client_contact_id' => $contact2->id, 'invoice_id' => $this->invoice->id, @@ -340,7 +344,7 @@ trait MockAccountData $this->invoice->service()->markSent(); $this->quote = Quote::factory()->create([ - 'user_id' => $this->user->id, + 'user_id' => $user_id, 'client_id' => $this->client->id, 'company_id' => $this->company->id, ]); @@ -361,14 +365,14 @@ trait MockAccountData //$this->quote->service()->createInvitations()->markSent(); QuoteInvitation::factory()->create([ - 'user_id' => $this->user->id, + 'user_id' => $user_id, 'company_id' => $this->company->id, 'client_contact_id' => $contact->id, 'quote_id' => $this->quote->id, ]); QuoteInvitation::factory()->create([ - 'user_id' => $this->user->id, + 'user_id' => $user_id, 'company_id' => $this->company->id, 'client_contact_id' => $contact2->id, 'quote_id' => $this->quote->id, @@ -379,7 +383,7 @@ trait MockAccountData $this->quote->save(); - $this->credit = CreditFactory::create($this->company->id, $this->user->id); + $this->credit = CreditFactory::create($this->company->id, $user_id); $this->credit->client_id = $this->client->id; $this->credit->line_items = $this->buildLineItems(); @@ -409,14 +413,14 @@ trait MockAccountData CreditInvitation::factory()->create([ - 'user_id' => $this->user->id, + 'user_id' => $user_id, 'company_id' => $this->company->id, 'client_contact_id' => $contact->id, 'credit_id' => $this->credit->id, ]); CreditInvitation::factory()->create([ - 'user_id' => $this->user->id, + 'user_id' => $user_id, 'company_id' => $this->company->id, 'client_contact_id' => $contact2->id, 'credit_id' => $this->credit->id, @@ -524,7 +528,7 @@ trait MockAccountData $gs = new GroupSetting; $gs->company_id = $this->company->id; - $gs->user_id = $this->user->id; + $gs->user_id = $user_id; $gs->settings = ClientSettings::buildClientSettings(CompanySettings::defaults(), ClientSettings::defaults()); $gs->name = 'Default Client Settings'; $gs->save(); @@ -544,7 +548,7 @@ trait MockAccountData $data[1]['fee_cap'] = ''; $cg = new CompanyGateway; $cg->company_id = $this->company->id; - $cg->user_id = $this->user->id; + $cg->user_id = $user_id; $cg->gateway_key = 'd14dd26a37cecc30fdd65700bfb55b23'; $cg->require_cvv = true; $cg->require_billing_address = true; @@ -556,7 +560,7 @@ trait MockAccountData $cg = new CompanyGateway; $cg->company_id = $this->company->id; - $cg->user_id = $this->user->id; + $cg->user_id = $user_id; $cg->gateway_key = 'd14dd26a37cecc30fdd65700bfb55b23'; $cg->require_cvv = true; $cg->require_billing_address = true;