diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..3882246 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,33 @@ +# PHP CircleCI 2.0 configuration file +# +# Check https://circleci.com/docs/2.0/language-php/ for more details +# +version: 2.1 + +commands: + build: + steps: + - checkout + - run: sudo apt update + - run: + name: Composer Install + command: | + composer install -n --prefer-dist --no-scripts + - run: + name: Run Tests + command: | + ./vendor/bin/phpunit + +jobs: + php81: + docker: + - image: cimg/php:8.1 + resource_class: small + steps: + - build + +workflows: + version: 2 + idempotency: + jobs: + - php81 diff --git a/.gitignore b/.gitignore index 71a5383..c2199f8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ /vendor composer.lock .phpunit.result.cache +.idea/ +.phpunit.cache/ diff --git a/.phpunit.result.cache b/.phpunit.result.cache index 90d9072..377ec1b 100644 --- a/.phpunit.result.cache +++ b/.phpunit.result.cache @@ -1 +1 @@ -{"version":1,"defects":{"SoapBox\\Idempotency\\Tests\\Unit\\Guzzle\\MiddlewareTest::it_applies_the_idempotency_header_for_post_requests":4,"SoapBox\\Idempotency\\Tests\\Unit\\Guzzle\\MiddlewareTest::it_applies_the_idempotency_header_for_patch_requests":4,"SoapBox\\Idempotency\\Tests\\Unit\\Guzzle\\MiddlewareTest::it_does_not_apply_the_idempotency_header_for_get_requests":4,"SoapBox\\Idempotency\\Tests\\Unit\\Guzzle\\MiddlewareTest::it_does_not_apply_the_idempotency_header_for_delete_requests":4,"SoapBox\\Idempotency\\Tests\\Unit\\Guzzle\\MiddlewareTest::it_applies_separate_idempotency_keys_to_each_request":4,"SoapBox\\Idempotency\\Tests\\Unit\\Laravel\\MiddlewareTest::it_will_not_return_a_cached_response_if_there_is_not_cached_response_for_the_provided_idempotency_key":4,"SoapBox\\Idempotency\\Tests\\Unit\\Laravel\\MiddlewareTest::it_will_not_cache_the_response_if_no_idempotency_key_is_provided":4,"SoapBox\\Idempotency\\Tests\\Unit\\Laravel\\MiddlewareTest::it_will_not_cache_the_response_for_a_get_request":4},"times":{"SoapBox\\Idempotency\\Tests\\Unit\\Guzzle\\MiddlewareTest::it_applies_the_idempotency_header_for_post_requests":0.146,"SoapBox\\Idempotency\\Tests\\Unit\\Guzzle\\MiddlewareTest::it_applies_the_idempotency_header_for_put_requests":0.02,"SoapBox\\Idempotency\\Tests\\Unit\\Guzzle\\MiddlewareTest::it_applies_the_idempotency_header_for_patch_requests":0.019,"SoapBox\\Idempotency\\Tests\\Unit\\Guzzle\\MiddlewareTest::it_does_not_apply_the_idempotency_header_for_get_requests":0.021,"SoapBox\\Idempotency\\Tests\\Unit\\Guzzle\\MiddlewareTest::it_does_not_apply_the_idempotency_header_for_delete_requests":0.021,"SoapBox\\Idempotency\\Tests\\Unit\\Guzzle\\MiddlewareTest::it_applies_separate_idempotency_keys_to_each_request":0.022,"SoapBox\\Idempotency\\Tests\\Unit\\Guzzle\\MiddlewareTest::it_works_when_previous_middleware_doesnt_pass_the_request_by_reference":0.021,"SoapBox\\Idempotency\\Tests\\Unit\\IdempotencyTest::adding_a_response_to_the_cache_caches_the_response_to_the_specified_store":0.03,"SoapBox\\Idempotency\\Tests\\Unit\\IdempotencyTest::adding_a_response_to_the_cache_prefixes_the_key_with_the_prefix":0.021,"SoapBox\\Idempotency\\Tests\\Unit\\IdempotencyTest::adding_a_response_to_the_cache_will_set_the_time_to_live_to_the_configured_amount":0.022,"SoapBox\\Idempotency\\Tests\\Unit\\IdempotencyTest::adding_a_response_to_the_cache_will_set_the_time_to_live_to_a_day_when_none_is_configured":0.021,"SoapBox\\Idempotency\\Tests\\Unit\\IdempotencyTest::it_returns_with_null_when_trying_to_get_a_response_for_a_key_that_is_not_in_the_cache":0.02,"SoapBox\\Idempotency\\Tests\\Unit\\IdempotencyTest::getting_a_response_from_the_cache_returns_an_equivalent_response":0.021,"SoapBox\\Idempotency\\Tests\\Unit\\IdempotencyTest::getting_a_response_from_the_cache_fetched_the_response_from_the_correct_store":0.021,"SoapBox\\Idempotency\\Tests\\Unit\\IdempotencyTest::getting_a_response_from_the_cache_will_prefix_the_key_with_the_prefix":0.02,"SoapBox\\Idempotency\\Tests\\Unit\\IdempotencyTest::getting_a_response_from_the_cache_returns_an_equivalent_response_after_serialization":0.022,"SoapBox\\Idempotency\\Tests\\Unit\\IdempotencyTest::getting_a_json_response_from_the_cache_returns_an_equivalent_response_after_serialization":0.022,"SoapBox\\Idempotency\\Tests\\Unit\\IdempotencyTest::getting_a_redirect_response_from_the_cache_returns_an_equivalent_response_after_serialization":0.022,"SoapBox\\Idempotency\\Tests\\Unit\\IdempotencyTest::it_correctly_serialized_a_response_that_has_an_exception_that_cannot_be_serialized_attached_to_it":0.033,"SoapBox\\Idempotency\\Tests\\Unit\\Laravel\\MiddlewareTest::it_will_return_the_cached_response_the_second_time_through_for_post_requests":0.021,"SoapBox\\Idempotency\\Tests\\Unit\\Laravel\\MiddlewareTest::it_will_return_the_cached_response_the_second_time_through_for_put_requests":0.021,"SoapBox\\Idempotency\\Tests\\Unit\\Laravel\\MiddlewareTest::it_will_return_the_cached_response_the_second_time_through_for_patch_requests":0.021,"SoapBox\\Idempotency\\Tests\\Unit\\Laravel\\MiddlewareTest::it_will_not_return_a_cached_response_if_there_is_not_cached_response_for_the_provided_idempotency_key":0.022,"SoapBox\\Idempotency\\Tests\\Unit\\Laravel\\MiddlewareTest::it_will_not_cache_the_response_if_no_idempotency_key_is_provided":0.02,"SoapBox\\Idempotency\\Tests\\Unit\\Laravel\\MiddlewareTest::it_will_not_cache_the_response_for_a_get_request":0.02,"SoapBox\\Idempotency\\Tests\\Unit\\Laravel\\MiddlewareTest::it_will_not_cache_the_response_for_a_delete_request":0.02,"SoapBox\\Idempotency\\Tests\\Unit\\Laravel\\MiddlewareTest::it_will_not_returned_the_cached_response_if_the_header_is_wrong":0.022,"SoapBox\\Idempotency\\Tests\\Unit\\Laravel\\MiddlewareTest::it_does_not_execute_the_next_middleware_when_it_returns_a_cached_response":0.022,"SoapBox\\Idempotency\\Tests\\Unit\\Laravel\\MiddlewareTest::it_executes_the_next_middleware_when_it_does_not_return_a_cached_response":0.02}} \ No newline at end of file +{"version":1,"defects":{"SoapBox\\Idempotency\\Tests\\Unit\\Guzzle\\MiddlewareTest::it_applies_the_idempotency_header_for_post_requests":4,"SoapBox\\Idempotency\\Tests\\Unit\\Guzzle\\MiddlewareTest::it_applies_the_idempotency_header_for_patch_requests":4,"SoapBox\\Idempotency\\Tests\\Unit\\Guzzle\\MiddlewareTest::it_does_not_apply_the_idempotency_header_for_get_requests":4,"SoapBox\\Idempotency\\Tests\\Unit\\Guzzle\\MiddlewareTest::it_does_not_apply_the_idempotency_header_for_delete_requests":4,"SoapBox\\Idempotency\\Tests\\Unit\\Guzzle\\MiddlewareTest::it_applies_separate_idempotency_keys_to_each_request":4,"SoapBox\\Idempotency\\Tests\\Unit\\Laravel\\MiddlewareTest::it_will_not_return_a_cached_response_if_there_is_not_cached_response_for_the_provided_idempotency_key":4,"SoapBox\\Idempotency\\Tests\\Unit\\Laravel\\MiddlewareTest::it_will_not_cache_the_response_if_no_idempotency_key_is_provided":4,"SoapBox\\Idempotency\\Tests\\Unit\\Laravel\\MiddlewareTest::it_will_not_cache_the_response_for_a_get_request":4},"times":{"SoapBox\\Idempotency\\Tests\\Unit\\Guzzle\\MiddlewareTest::it_applies_the_idempotency_header_for_post_requests":0.029,"SoapBox\\Idempotency\\Tests\\Unit\\Guzzle\\MiddlewareTest::it_applies_the_idempotency_header_for_put_requests":0,"SoapBox\\Idempotency\\Tests\\Unit\\Guzzle\\MiddlewareTest::it_applies_the_idempotency_header_for_patch_requests":0,"SoapBox\\Idempotency\\Tests\\Unit\\Guzzle\\MiddlewareTest::it_does_not_apply_the_idempotency_header_for_get_requests":0,"SoapBox\\Idempotency\\Tests\\Unit\\Guzzle\\MiddlewareTest::it_does_not_apply_the_idempotency_header_for_delete_requests":0,"SoapBox\\Idempotency\\Tests\\Unit\\Guzzle\\MiddlewareTest::it_applies_separate_idempotency_keys_to_each_request":0.001,"SoapBox\\Idempotency\\Tests\\Unit\\Guzzle\\MiddlewareTest::it_works_when_previous_middleware_doesnt_pass_the_request_by_reference":0,"SoapBox\\Idempotency\\Tests\\Unit\\IdempotencyTest::adding_a_response_to_the_cache_caches_the_response_to_the_specified_store":0.003,"SoapBox\\Idempotency\\Tests\\Unit\\IdempotencyTest::adding_a_response_to_the_cache_prefixes_the_key_with_the_prefix":0,"SoapBox\\Idempotency\\Tests\\Unit\\IdempotencyTest::adding_a_response_to_the_cache_will_set_the_time_to_live_to_the_configured_amount":0,"SoapBox\\Idempotency\\Tests\\Unit\\IdempotencyTest::adding_a_response_to_the_cache_will_set_the_time_to_live_to_a_day_when_none_is_configured":0,"SoapBox\\Idempotency\\Tests\\Unit\\IdempotencyTest::it_returns_with_null_when_trying_to_get_a_response_for_a_key_that_is_not_in_the_cache":0,"SoapBox\\Idempotency\\Tests\\Unit\\IdempotencyTest::getting_a_response_from_the_cache_returns_an_equivalent_response":0,"SoapBox\\Idempotency\\Tests\\Unit\\IdempotencyTest::getting_a_response_from_the_cache_fetched_the_response_from_the_correct_store":0,"SoapBox\\Idempotency\\Tests\\Unit\\IdempotencyTest::getting_a_response_from_the_cache_will_prefix_the_key_with_the_prefix":0,"SoapBox\\Idempotency\\Tests\\Unit\\IdempotencyTest::getting_a_response_from_the_cache_returns_an_equivalent_response_after_serialization":0.001,"SoapBox\\Idempotency\\Tests\\Unit\\IdempotencyTest::getting_a_json_response_from_the_cache_returns_an_equivalent_response_after_serialization":0.001,"SoapBox\\Idempotency\\Tests\\Unit\\IdempotencyTest::getting_a_redirect_response_from_the_cache_returns_an_equivalent_response_after_serialization":0.001,"SoapBox\\Idempotency\\Tests\\Unit\\IdempotencyTest::it_correctly_serialized_a_response_that_has_an_exception_that_cannot_be_serialized_attached_to_it":0.006,"SoapBox\\Idempotency\\Tests\\Unit\\Laravel\\MiddlewareTest::it_will_return_the_cached_response_the_second_time_through_for_post_requests":0,"SoapBox\\Idempotency\\Tests\\Unit\\Laravel\\MiddlewareTest::it_will_return_the_cached_response_the_second_time_through_for_put_requests":0,"SoapBox\\Idempotency\\Tests\\Unit\\Laravel\\MiddlewareTest::it_will_return_the_cached_response_the_second_time_through_for_patch_requests":0,"SoapBox\\Idempotency\\Tests\\Unit\\Laravel\\MiddlewareTest::it_will_not_return_a_cached_response_if_there_is_not_cached_response_for_the_provided_idempotency_key":0.001,"SoapBox\\Idempotency\\Tests\\Unit\\Laravel\\MiddlewareTest::it_will_not_cache_the_response_if_no_idempotency_key_is_provided":0,"SoapBox\\Idempotency\\Tests\\Unit\\Laravel\\MiddlewareTest::it_will_not_cache_the_response_for_a_get_request":0,"SoapBox\\Idempotency\\Tests\\Unit\\Laravel\\MiddlewareTest::it_will_not_cache_the_response_for_a_delete_request":0,"SoapBox\\Idempotency\\Tests\\Unit\\Laravel\\MiddlewareTest::it_will_not_returned_the_cached_response_if_the_header_is_wrong":0,"SoapBox\\Idempotency\\Tests\\Unit\\Laravel\\MiddlewareTest::it_does_not_execute_the_next_middleware_when_it_returns_a_cached_response":0,"SoapBox\\Idempotency\\Tests\\Unit\\Laravel\\MiddlewareTest::it_executes_the_next_middleware_when_it_does_not_return_a_cached_response":0}} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index bd45f54..0000000 --- a/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: php - -php: - - 7.3 - - 8.0 - -before_script: - - composer update --prefer-source --no-interaction - -script: - - vendor/bin/phpunit diff --git a/composer.json b/composer.json index 05c5a9f..b732486 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "require": { "ramsey/uuid": "^4.0", "guzzlehttp/psr7": "^1.4", - "illuminate/support": "^8.12" + "illuminate/support": "^10.48.11" }, "repositories": [ { @@ -25,9 +25,9 @@ } }, "require-dev": { - "phpunit/phpunit": "^9.3", - "orchestra/testbench": "^6.17", - "jshayes/fake-requests": "^5.0" + "phpunit/phpunit": "^10.5.20", + "orchestra/testbench": "^8.23.0", + "jshayes/fake-requests": "dev-php81" }, "extra": { "laravel": { diff --git a/phpunit.xml b/phpunit.xml index df6e3ae..b260a1b 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,15 +1,8 @@ - - - - ./tests/Unit - - + + + + ./tests/Unit + +