From 66515307800887e0bf56845dbeb05b6d8c9e2eb0 Mon Sep 17 00:00:00 2001 From: Raza Mehdi Date: Tue, 18 Jun 2024 14:52:19 +0500 Subject: [PATCH] Start build from PHP 8.0. Signed-off-by: Raza Mehdi --- .github/workflows/static-analysis.yml | 2 +- .github/workflows/tests.yml | 2 +- .../AdapterBillingPlansPricingHelpersTest.php | 15 +- tests/Feature/AdapterConfigTest.php | 53 +- .../AdapterCreateSubscriptionHelpersTest.php | 87 +-- .../Feature/AdapterExperienceContextTest.php | 11 +- tests/Feature/AdapterFeatureTest.php | 511 +++++++++--------- tests/Feature/AdapterOrdersHelperTest.php | 11 +- .../AdapterPaymentMethodTokensHelpersTest.php | 27 +- tests/Unit/Adapter/BillingPlansTest.php | 29 +- tests/Unit/Adapter/CatalogProductsTest.php | 17 +- tests/Unit/Adapter/DisputeActionsTest.php | 13 +- tests/Unit/Adapter/DisputesTest.php | 13 +- tests/Unit/Adapter/IdentityTest.php | 5 +- tests/Unit/Adapter/InvoicesSearchTest.php | 9 +- tests/Unit/Adapter/InvoicesTemplatesTest.php | 21 +- tests/Unit/Adapter/InvoicesTest.php | 57 +- tests/Unit/Adapter/OrdersTest.php | 9 +- tests/Unit/Adapter/PartnerReferralsTest.php | 9 +- .../Adapter/PaymentAuthorizationsTest.php | 17 +- tests/Unit/Adapter/PaymentCapturesTest.php | 9 +- .../PaymentExperienceWebProfilesTest.php | 25 +- tests/Unit/Adapter/PaymentRefundsTest.php | 5 +- tests/Unit/Adapter/PayoutsTest.php | 17 +- tests/Unit/Adapter/ReferencedPayoutsTest.php | 17 +- tests/Unit/Adapter/ReportingTest.php | 9 +- tests/Unit/Adapter/SubscriptionsTest.php | 37 +- tests/Unit/Adapter/TrackersTest.php | 13 +- tests/Unit/Adapter/WebHooksEventsTest.php | 17 +- tests/Unit/Adapter/WebHooksTest.php | 25 +- .../Unit/Adapter/WebHooksVerificationTest.php | 5 +- tests/Unit/AdapterTest.php | 25 +- tests/Unit/Client/BillingPlansTest.php | 29 +- tests/Unit/Client/CatalogProductsTest.php | 17 +- tests/Unit/Client/DisputeActionsTest.php | 13 +- tests/Unit/Client/DisputesTest.php | 13 +- tests/Unit/Client/IdentityTest.php | 5 +- tests/Unit/Client/InvoicesSearchTest.php | 5 +- tests/Unit/Client/InvoicesTemplatesTest.php | 21 +- tests/Unit/Client/InvoicesTest.php | 57 +- tests/Unit/Client/OrdersTest.php | 5 +- tests/Unit/Client/PartnerReferralsTest.php | 9 +- .../Unit/Client/PaymentAuthorizationsTest.php | 17 +- tests/Unit/Client/PaymentCapturesTest.php | 9 +- .../PaymentExperienceWebProfilesTest.php | 25 +- tests/Unit/Client/PaymentRefundsTest.php | 5 +- tests/Unit/Client/PayoutsTest.php | 17 +- tests/Unit/Client/ReferencedPayoutsTest.php | 17 +- tests/Unit/Client/ReportingTest.php | 9 +- tests/Unit/Client/SubscriptionsTest.php | 37 +- tests/Unit/Client/TrackersTest.php | 13 +- tests/Unit/Client/WebHooksEventsTest.php | 17 +- tests/Unit/Client/WebHooksTest.php | 25 +- .../Unit/Client/WebHooksVerificationTest.php | 5 +- tests/Unit/ClientTest.php | 9 +- 55 files changed, 780 insertions(+), 721 deletions(-) diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index b2dfa1ac..fdb19c0a 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -7,7 +7,7 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] + php-versions: ['8.0', '8.1', '8.2', '8.3'] steps: - name: Checkout uses: actions/checkout@v2 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 61d1ac23..5f04e855 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,7 +7,7 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] + php-versions: ['8.0', '8.1', '8.2', '8.3'] steps: - name: Checkout uses: actions/checkout@v2 diff --git a/tests/Feature/AdapterBillingPlansPricingHelpersTest.php b/tests/Feature/AdapterBillingPlansPricingHelpersTest.php index bfd2967f..024b1a0a 100644 --- a/tests/Feature/AdapterBillingPlansPricingHelpersTest.php +++ b/tests/Feature/AdapterBillingPlansPricingHelpersTest.php @@ -2,6 +2,7 @@ namespace Srmklive\PayPal\Tests\Feature; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Services\PayPal as PayPalClient; use Srmklive\PayPal\Tests\MockClientClasses; @@ -13,10 +14,10 @@ class AdapterBillingPlansPricingHelpersTest extends TestCase use MockResponsePayloads; /** @var string */ - protected static $access_token = ''; + protected static string $access_token = ''; - /** @var \Srmklive\PayPal\Services\PayPal */ - protected $client; + /** @var PayPalClient */ + protected PayPalClient $client; protected function setUp(): void { @@ -34,8 +35,8 @@ protected function setUp(): void parent::setUp(); } - /** @test */ - public function it_can_update_pricing_schemes_for_a_billing_plan() + #[Test] + public function it_can_update_pricing_schemes_for_a_billing_plan(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -55,8 +56,8 @@ public function it_can_update_pricing_schemes_for_a_billing_plan() $this->assertEmpty($response); } - /** @test */ - public function it_can_set_custom_limits_when_listing_billing_plans() + #[Test] + public function it_can_set_custom_limits_when_listing_billing_plans(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, diff --git a/tests/Feature/AdapterConfigTest.php b/tests/Feature/AdapterConfigTest.php index 3e603175..6ee7d3e5 100644 --- a/tests/Feature/AdapterConfigTest.php +++ b/tests/Feature/AdapterConfigTest.php @@ -2,6 +2,7 @@ namespace Srmklive\PayPal\Tests\Feature; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Services\PayPal as PayPalClient; use Srmklive\PayPal\Tests\MockClientClasses; @@ -10,8 +11,8 @@ class AdapterConfigTest extends TestCase { use MockClientClasses; - /** @var \Srmklive\PayPal\Services\PayPal */ - protected $client; + /** @var PayPalClient */ + protected PayPalClient $client; protected function setUp(): void { @@ -20,8 +21,8 @@ protected function setUp(): void parent::setUp(); } - /** @test */ - public function it_throws_exception_if_invalid_credentials_are_provided() + #[Test] + public function it_throws_exception_if_invalid_credentials_are_provided(): void { $this->expectException(\RuntimeException::class); $this->expectExceptionMessage('Invalid configuration provided. Please provide valid configuration for PayPal API. You can also refer to the documentation at https://srmklive.github.io/laravel-paypal/docs.html to setup correct configuration.'); @@ -29,8 +30,8 @@ public function it_throws_exception_if_invalid_credentials_are_provided() $this->client = new PayPalClient([]); } - /** @test */ - public function it_throws_exception_if_invalid_mode_is_provided() + #[Test] + public function it_throws_exception_if_invalid_mode_is_provided(): void { $this->expectException(\RuntimeException::class); $this->expectExceptionMessage('Invalid configuration provided. Please provide valid configuration for PayPal API. You can also refer to the documentation at https://srmklive.github.io/laravel-paypal/docs.html to setup correct configuration.'); @@ -41,8 +42,8 @@ public function it_throws_exception_if_invalid_mode_is_provided() $this->client = new PayPalClient($credentials); } - /** @test */ - public function it_throws_exception_if_empty_credentials_are_provided() + #[Test] + public function it_throws_exception_if_empty_credentials_are_provided(): void { $this->expectException(\RuntimeException::class); $this->expectExceptionMessage('Invalid configuration provided. Please provide valid configuration for PayPal API. You can also refer to the documentation at https://srmklive.github.io/laravel-paypal/docs.html to setup correct configuration.'); @@ -53,8 +54,8 @@ public function it_throws_exception_if_empty_credentials_are_provided() $this->client = new PayPalClient($credentials); } - /** @test */ - public function it_throws_exception_if_credentials_items_are_not_provided() + #[Test] + public function it_throws_exception_if_credentials_items_are_not_provided(): void { $item = 'client_id'; @@ -67,30 +68,30 @@ public function it_throws_exception_if_credentials_items_are_not_provided() $client = new PayPalClient($credentials); } - /** @test */ - public function it_can_take_valid_credentials_and_return_the_client_instance() + #[Test] + public function it_can_take_valid_credentials_and_return_the_client_instance(): void { $this->assertInstanceOf(PayPalClient::class, $this->client); } - /** @test */ - public function it_throws_exception_if_invalid_credentials_are_provided_through_method() + #[Test] + public function it_throws_exception_if_invalid_credentials_are_provided_through_method(): void { $this->expectException(\RuntimeException::class); $this->client->setApiCredentials([]); } - /** @test */ - public function it_returns_the_client_instance_if_valid_credentials_are_provided_through_method() + #[Test] + public function it_returns_the_client_instance_if_valid_credentials_are_provided_through_method(): void { $this->client->setApiCredentials($this->getApiCredentials()); $this->assertInstanceOf(PayPalClient::class, $this->client); } - /** @test */ - public function it_throws_exception_if_invalid_currency_is_set() + #[Test] + public function it_throws_exception_if_invalid_currency_is_set(): void { $this->expectException(\RuntimeException::class); @@ -99,8 +100,8 @@ public function it_throws_exception_if_invalid_currency_is_set() $this->assertNotEquals('PKR', $this->client->getCurrency()); } - /** @test */ - public function it_can_set_a_valid_currency() + #[Test] + public function it_can_set_a_valid_currency(): void { $this->client->setCurrency('EUR'); @@ -108,8 +109,8 @@ public function it_can_set_a_valid_currency() $this->assertEquals('EUR', $this->client->getCurrency()); } - /** @test */ - public function it_can_set_a_request_header() + #[Test] + public function it_can_set_a_request_header(): void { $this->client->setRequestHeader('Prefer', 'return=representation'); @@ -117,8 +118,8 @@ public function it_can_set_a_request_header() $this->assertEquals($this->client->getRequestHeader('Prefer'), 'return=representation'); } - /** @test */ - public function it_can_set_multiple_request_headers() + #[Test] + public function it_can_set_multiple_request_headers(): void { $this->client->setRequestHeaders([ 'PayPal-Request-Id' => 'some-request-id', @@ -129,8 +130,8 @@ public function it_can_set_multiple_request_headers() $this->assertEquals($this->client->getRequestHeader('PayPal-Partner-Attribution-Id'), 'some-attribution-id'); } - /** @test */ - public function it_throws_exception_if_options_header_not_set() + #[Test] + public function it_throws_exception_if_options_header_not_set(): void { $this->expectException(\RuntimeException::class); $this->expectExceptionCode('0'); diff --git a/tests/Feature/AdapterCreateSubscriptionHelpersTest.php b/tests/Feature/AdapterCreateSubscriptionHelpersTest.php index 550fa520..47934d16 100644 --- a/tests/Feature/AdapterCreateSubscriptionHelpersTest.php +++ b/tests/Feature/AdapterCreateSubscriptionHelpersTest.php @@ -3,6 +3,7 @@ namespace Srmklive\PayPal\Tests\Feature; use Carbon\Carbon; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Services\PayPal as PayPalClient; use Srmklive\PayPal\Tests\MockClientClasses; @@ -14,10 +15,10 @@ class AdapterCreateSubscriptionHelpersTest extends TestCase use MockResponsePayloads; /** @var string */ - protected static $access_token = ''; + protected static string $access_token = ''; - /** @var \Srmklive\PayPal\Services\PayPal */ - protected $client; + /** @var PayPalClient */ + protected PayPalClient $client; protected function setUp(): void { @@ -35,8 +36,8 @@ protected function setUp(): void parent::setUp(); } - /** @test */ - public function it_can_create_a_monthly_subscription() + #[Test] + public function it_can_create_a_monthly_subscription(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -76,8 +77,8 @@ public function it_can_create_a_monthly_subscription() $this->assertArrayHasKey('plan_id', $response); } - /** @test */ - public function it_can_create_a_daily_subscription() + #[Test] + public function it_can_create_a_daily_subscription(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -117,8 +118,8 @@ public function it_can_create_a_daily_subscription() $this->assertArrayHasKey('plan_id', $response); } - /** @test */ - public function it_can_create_a_weekly_subscription() + #[Test] + public function it_can_create_a_weekly_subscription(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -158,8 +159,8 @@ public function it_can_create_a_weekly_subscription() $this->assertArrayHasKey('plan_id', $response); } - /** @test */ - public function it_can_create_an_annual_subscription() + #[Test] + public function it_can_create_an_annual_subscription(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -199,8 +200,8 @@ public function it_can_create_an_annual_subscription() $this->assertArrayHasKey('plan_id', $response); } - /** @test */ - public function it_can_create_a_subscription_with_custom_defined_interval() + #[Test] + public function it_can_create_a_subscription_with_custom_defined_interval(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -240,8 +241,8 @@ public function it_can_create_a_subscription_with_custom_defined_interval() $this->assertArrayHasKey('plan_id', $response); } - /** @test */ - public function it_throws_exception_when_invalid_interval_is_provided_for_creating_a_subscription() + #[Test] + public function it_throws_exception_when_invalid_interval_is_provided_for_creating_a_subscription(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -255,8 +256,8 @@ public function it_throws_exception_when_invalid_interval_is_provided_for_creati $this->client = $this->client->addCustomPlan('Demo Plan', 'Demo Plan', 100, 'MONTHLY', 3); } - /** @test */ - public function it_throws_exception_when_get_error_for_creating_a_billing_plan() + #[Test] + public function it_throws_exception_when_get_error_for_creating_a_billing_plan(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -282,8 +283,8 @@ public function it_throws_exception_when_get_error_for_creating_a_billing_plan() $this->client = $this->client->addMonthlyPlan('Demo Plan', 'Demo Plan', 100); } - /** @test */ - public function it_throws_exception_when_get_error_for_creating_a_product() + #[Test] + public function it_throws_exception_when_get_error_for_creating_a_product(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -301,8 +302,8 @@ public function it_throws_exception_when_get_error_for_creating_a_product() $this->client = $this->client->addProduct('Demo Product', 'Demo Product', 'SERVICE', 'SOFTWARE'); } - /** @test */ - public function it_can_create_a_subscription_without_trial() + #[Test] + public function it_can_create_a_subscription_without_trial(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -340,8 +341,8 @@ public function it_can_create_a_subscription_without_trial() $this->assertArrayHasKey('plan_id', $response); } - /** @test */ - public function it_can_create_a_subscription_by_existing_product_and_billing_plan() + #[Test] + public function it_can_create_a_subscription_by_existing_product_and_billing_plan(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -365,8 +366,8 @@ public function it_can_create_a_subscription_by_existing_product_and_billing_pla $this->assertArrayHasKey('plan_id', $response); } - /** @test */ - public function it_skips_product_and_billing_plan_creation_if_already_set_when_creating_a_daily_subscription() + #[Test] + public function it_skips_product_and_billing_plan_creation_if_already_set_when_creating_a_daily_subscription(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -393,8 +394,8 @@ public function it_skips_product_and_billing_plan_creation_if_already_set_when_c $this->assertArrayHasKey('plan_id', $response); } - /** @test */ - public function it_skips_product_and_billing_plan_creation_if_already_set_when_creating_a_weekly_subscription() + #[Test] + public function it_skips_product_and_billing_plan_creation_if_already_set_when_creating_a_weekly_subscription(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -421,8 +422,8 @@ public function it_skips_product_and_billing_plan_creation_if_already_set_when_c $this->assertArrayHasKey('plan_id', $response); } - /** @test */ - public function it_skips_product_and_billing_plan_creation_if_already_set_when_creating_a_monthly_subscription() + #[Test] + public function it_skips_product_and_billing_plan_creation_if_already_set_when_creating_a_monthly_subscription(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -449,8 +450,8 @@ public function it_skips_product_and_billing_plan_creation_if_already_set_when_c $this->assertArrayHasKey('plan_id', $response); } - /** @test */ - public function it_skips_product_and_billing_plan_creation_if_already_set_when_creating_an_annual_subscription() + #[Test] + public function it_skips_product_and_billing_plan_creation_if_already_set_when_creating_an_annual_subscription(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -477,8 +478,8 @@ public function it_skips_product_and_billing_plan_creation_if_already_set_when_c $this->assertArrayHasKey('plan_id', $response); } - /** @test */ - public function it_skips_product_and_billing_plan_creation_if_already_set_when_creating_a_subscription_with_custom_intervals() + #[Test] + public function it_skips_product_and_billing_plan_creation_if_already_set_when_creating_a_subscription_with_custom_intervals(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -505,8 +506,8 @@ public function it_skips_product_and_billing_plan_creation_if_already_set_when_c $this->assertArrayHasKey('plan_id', $response); } - /** @test */ - public function it_can_add_setup_fees_when_creating_subscription() + #[Test] + public function it_can_add_setup_fees_when_creating_subscription(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -533,8 +534,8 @@ public function it_can_add_setup_fees_when_creating_subscription() $this->assertArrayHasKey('plan_id', $response); } - /** @test */ - public function it_can_add_shipping_address_when_creating_subscription() + #[Test] + public function it_can_add_shipping_address_when_creating_subscription(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -560,8 +561,8 @@ public function it_can_add_shipping_address_when_creating_subscription() $this->assertArrayHasKey('plan_id', $response); } - /** @test */ - public function it_can_add_custom_payment_failure_threshold_value_when_creating_subscription() + #[Test] + public function it_can_add_custom_payment_failure_threshold_value_when_creating_subscription(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -588,8 +589,8 @@ public function it_can_add_custom_payment_failure_threshold_value_when_creating_ $this->assertArrayHasKey('plan_id', $response); } - /** @test */ - public function it_can_set_tax_percentage_when_creating_subscription() + #[Test] + public function it_can_set_tax_percentage_when_creating_subscription(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -616,8 +617,8 @@ public function it_can_set_tax_percentage_when_creating_subscription() $this->assertArrayHasKey('plan_id', $response); } - /** @test */ - public function it_can_create_a_subscription_with_fixed_installments() + #[Test] + public function it_can_create_a_subscription_with_fixed_installments(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, diff --git a/tests/Feature/AdapterExperienceContextTest.php b/tests/Feature/AdapterExperienceContextTest.php index 7018e2f3..9615cbf0 100644 --- a/tests/Feature/AdapterExperienceContextTest.php +++ b/tests/Feature/AdapterExperienceContextTest.php @@ -5,6 +5,7 @@ namespace Srmklive\PayPal\Tests\Feature; use Carbon\Carbon; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Services\PayPal as PayPalClient; use Srmklive\PayPal\Tests\MockClientClasses; @@ -18,10 +19,10 @@ class AdapterExperienceContextTest extends TestCase use MockResponsePayloads; /** @var string */ - protected static $access_token = ''; + protected static string $access_token = ''; - /** @var \Srmklive\PayPal\Services\PayPal */ - protected $client; + /** @var PayPalClient */ + protected PayPalClient $client; protected function setUp(): void { @@ -39,8 +40,8 @@ protected function setUp(): void parent::setUp(); } - /** @test */ - public function it_can_set_payment_experience_context_before_performing_api_call() + #[Test] + public function it_can_set_payment_experience_context_before_performing_api_call(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, diff --git a/tests/Feature/AdapterFeatureTest.php b/tests/Feature/AdapterFeatureTest.php index a22750c6..e4b04600 100644 --- a/tests/Feature/AdapterFeatureTest.php +++ b/tests/Feature/AdapterFeatureTest.php @@ -3,6 +3,7 @@ namespace Srmklive\PayPal\Tests\Feature; use Carbon\Carbon; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Services\PayPal as PayPalClient; use Srmklive\PayPal\Tests\MockClientClasses; @@ -16,23 +17,26 @@ class AdapterFeatureTest extends TestCase use MockResponsePayloads; /** @var string */ - protected static $access_token = ''; + protected static string $access_token = ''; /** @var string */ - protected static $product_id = ''; + protected static string $product_id = ''; - /** @var \Srmklive\PayPal\Services\PayPal */ - protected $client; + /** @var PayPalClient */ + protected PayPalClient $client; protected function setUp(): void { - $this->client = new PayPalClient($this->getApiCredentials()); + try { + $this->client = new PayPalClient($this->getApiCredentials()); + } catch (\Exception $e) { + } parent::setUp(); } - /** @test */ - public function it_returns_error_if_invalid_credentials_are_used_to_get_access_token() + #[Test] + public function it_returns_error_if_invalid_credentials_are_used_to_get_access_token(): void { $this->client = new PayPalClient($this->getMockCredentials()); $response = $this->client->getAccessToken(); @@ -41,8 +45,8 @@ public function it_returns_error_if_invalid_credentials_are_used_to_get_access_t $this->assertArrayHasKey('error', $response); } - /** @test */ - public function it_can_get_access_token() + #[Test] + public function it_can_get_access_token(): void { $this->client->setClient( $this->mock_http_client( @@ -57,8 +61,8 @@ public function it_can_get_access_token() $this->assertNotEmpty($response['access_token']); } - /** @test */ - public function it_can_create_a_billing_plan() + #[Test] + public function it_can_create_a_billing_plan(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -73,14 +77,17 @@ public function it_can_create_a_billing_plan() $expectedParams = $this->createPlanParams(); - $response = $this->client->setRequestHeader('PayPal-Request-Id', 'some-request-id')->createPlan($expectedParams); + try { + $response = $this->client->setRequestHeader('PayPal-Request-Id', 'some-request-id')->createPlan($expectedParams); + } catch (\Throwable $e) { + } $this->assertNotEmpty($response); $this->assertArrayHasKey('id', $response); } - /** @test */ - public function it_can_list_billing_plans() + #[Test] + public function it_can_list_billing_plans(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -99,8 +106,8 @@ public function it_can_list_billing_plans() $this->assertArrayHasKey('plans', $response); } - /** @test */ - public function it_can_update_a_billing_plan() + #[Test] + public function it_can_update_a_billing_plan(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -118,8 +125,8 @@ public function it_can_update_a_billing_plan() $this->assertEmpty($response); } - /** @test */ - public function it_can_show_details_for_a_billing_plan() + #[Test] + public function it_can_show_details_for_a_billing_plan(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -138,8 +145,8 @@ public function it_can_show_details_for_a_billing_plan() $this->assertArrayHasKey('id', $response); } - /** @test */ - public function it_can_activate_a_billing_plan() + #[Test] + public function it_can_activate_a_billing_plan(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -155,8 +162,8 @@ public function it_can_activate_a_billing_plan() $this->assertEmpty($response); } - /** @test */ - public function it_can_deactivate_a_billing_plan() + #[Test] + public function it_can_deactivate_a_billing_plan(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -172,8 +179,8 @@ public function it_can_deactivate_a_billing_plan() $this->assertEmpty($response); } - /** @test */ - public function it_can_update_pricing_for_a_billing_plan() + #[Test] + public function it_can_update_pricing_for_a_billing_plan(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -191,8 +198,8 @@ public function it_can_update_pricing_for_a_billing_plan() $this->assertEmpty($response); } - /** @test */ - public function it_can_list_products() + #[Test] + public function it_can_list_products(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -211,8 +218,8 @@ public function it_can_list_products() $this->assertArrayHasKey('products', $response); } - /** @test */ - public function it_can_create_a_product() + #[Test] + public function it_can_create_a_product(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -235,8 +242,8 @@ public function it_can_create_a_product() $this->assertArrayHasKey('id', $response); } - /** @test */ - public function it_can_update_a_product() + #[Test] + public function it_can_update_a_product(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -254,8 +261,8 @@ public function it_can_update_a_product() $this->assertEmpty($response); } - /** @test */ - public function it_can_get_details_for_a_product() + #[Test] + public function it_can_get_details_for_a_product(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -274,8 +281,8 @@ public function it_can_get_details_for_a_product() $this->assertArrayHasKey('id', $response); } - /** @test */ - public function it_can_acknowledge_item_is_returned_for_raised_dispute() + #[Test] + public function it_can_acknowledge_item_is_returned_for_raised_dispute(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -298,8 +305,8 @@ public function it_can_acknowledge_item_is_returned_for_raised_dispute() $this->assertArrayHasKey('links', $response); } - /** @test */ - public function it_can_list_disputes() + #[Test] + public function it_can_list_disputes(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -318,8 +325,8 @@ public function it_can_list_disputes() $this->assertArrayHasKey('items', $response); } - /** @test */ - public function it_can_partially_update_a_dispute() + #[Test] + public function it_can_partially_update_a_dispute(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -337,8 +344,8 @@ public function it_can_partially_update_a_dispute() $this->assertEmpty($response); } - /** @test */ - public function it_can_get_details_for_a_dispute() + #[Test] + public function it_can_get_details_for_a_dispute(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -357,8 +364,8 @@ public function it_can_get_details_for_a_dispute() $this->assertArrayHasKey('dispute_id', $response); } - /** @test */ - public function it_can_provide_evidence_for_a_dispute_claim() + #[Test] + public function it_can_provide_evidence_for_a_dispute_claim(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -388,8 +395,8 @@ public function it_can_provide_evidence_for_a_dispute_claim() $this->markTestIncomplete('Skipping the test'); } - /** @test */ - public function it_throws_exception_if_invalid_file_as_evidence_is_provided_for_a_dispute_claim() + #[Test] + public function it_throws_exception_if_invalid_file_as_evidence_is_provided_for_a_dispute_claim(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -417,8 +424,8 @@ public function it_throws_exception_if_invalid_file_as_evidence_is_provided_for_ ); } - /** @test */ - public function it_throws_exception_if_file_size_as_evidence_exceeds_per_file_limit_for_a_dispute_claim() + #[Test] + public function it_throws_exception_if_file_size_as_evidence_exceeds_per_file_limit_for_a_dispute_claim(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -445,8 +452,8 @@ public function it_throws_exception_if_file_size_as_evidence_exceeds_per_file_li ); } - /** @test */ - public function it_throws_exception_if_file_size_as_evidence_exceeds_overall_limit_for_a_dispute_claim() + #[Test] + public function it_throws_exception_if_file_size_as_evidence_exceeds_overall_limit_for_a_dispute_claim(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -473,8 +480,8 @@ public function it_throws_exception_if_file_size_as_evidence_exceeds_overall_lim ); } - /** @test */ - public function it_can_offer_to_resolve_dispute_claim() + #[Test] + public function it_can_offer_to_resolve_dispute_claim(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -498,8 +505,8 @@ public function it_can_offer_to_resolve_dispute_claim() $this->assertArrayHasKey('links', $response); } - /** @test */ - public function it_can_escalate_dispute_claim() + #[Test] + public function it_can_escalate_dispute_claim(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -521,8 +528,8 @@ public function it_can_escalate_dispute_claim() $this->assertArrayHasKey('links', $response); } - /** @test */ - public function it_can_accept_dispute_claim() + #[Test] + public function it_can_accept_dispute_claim(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -544,8 +551,8 @@ public function it_can_accept_dispute_claim() $this->assertArrayHasKey('links', $response); } - /** @test */ - public function it_can_accept_dispute_offer_resolution() + #[Test] + public function it_can_accept_dispute_offer_resolution(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -567,8 +574,8 @@ public function it_can_accept_dispute_offer_resolution() $this->assertArrayHasKey('links', $response); } - /** @test */ - public function it_can_update_dispute_status() + #[Test] + public function it_can_update_dispute_status(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -590,8 +597,8 @@ public function it_can_update_dispute_status() $this->assertArrayHasKey('links', $response); } - /** @test */ - public function it_can_settle_dispute() + #[Test] + public function it_can_settle_dispute(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -613,8 +620,8 @@ public function it_can_settle_dispute() $this->assertArrayHasKey('links', $response); } - /** @test */ - public function it_can_decline_dispute_offer_resolution() + #[Test] + public function it_can_decline_dispute_offer_resolution(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -636,8 +643,8 @@ public function it_can_decline_dispute_offer_resolution() $this->assertArrayHasKey('links', $response); } - /** @test */ - public function it_can_generate_unique_invoice_number() + #[Test] + public function it_can_generate_unique_invoice_number(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -656,8 +663,8 @@ public function it_can_generate_unique_invoice_number() $this->assertArrayHasKey('invoice_number', $response); } - /** @test */ - public function it_can_create_a_draft_invoice() + #[Test] + public function it_can_create_a_draft_invoice(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -678,8 +685,8 @@ public function it_can_create_a_draft_invoice() $this->assertArrayHasKey('id', $response); } - /** @test */ - public function it_can_list_invoices() + #[Test] + public function it_can_list_invoices(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -698,8 +705,8 @@ public function it_can_list_invoices() $this->assertArrayHasKey('total_items', $response); } - /** @test */ - public function it_can_delete_an_invoice() + #[Test] + public function it_can_delete_an_invoice(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -715,8 +722,8 @@ public function it_can_delete_an_invoice() $this->assertEmpty($response); } - /** @test */ - public function it_can_update_an_invoice() + #[Test] + public function it_can_update_an_invoice(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -737,8 +744,8 @@ public function it_can_update_an_invoice() $this->assertArrayHasKey('id', $response); } - /** @test */ - public function it_can_show_details_for_an_invoice() + #[Test] + public function it_can_show_details_for_an_invoice(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -757,8 +764,8 @@ public function it_can_show_details_for_an_invoice() $this->assertArrayHasKey('id', $response); } - /** @test */ - public function it_can_cancel_an_invoice() + #[Test] + public function it_can_cancel_an_invoice(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -786,8 +793,8 @@ public function it_can_cancel_an_invoice() $this->assertEmpty($response); } - /** @test */ - public function it_can_generate_qr_code_for_invoice() + #[Test] + public function it_can_generate_qr_code_for_invoice(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -805,8 +812,8 @@ public function it_can_generate_qr_code_for_invoice() $this->assertNotEmpty($response); } - /** @test */ - public function it_can_register_payment_for_invoice() + #[Test] + public function it_can_register_payment_for_invoice(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -825,8 +832,8 @@ public function it_can_register_payment_for_invoice() $this->assertArrayHasKey('payment_id', $response); } - /** @test */ - public function it_can_delete_payment_for_invoice() + #[Test] + public function it_can_delete_payment_for_invoice(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -842,8 +849,8 @@ public function it_can_delete_payment_for_invoice() $this->assertEmpty($response); } - /** @test */ - public function it_can_refund_payment_for_invoice() + #[Test] + public function it_can_refund_payment_for_invoice(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -862,8 +869,8 @@ public function it_can_refund_payment_for_invoice() $this->assertArrayHasKey('refund_id', $response); } - /** @test */ - public function it_can_delete_refund_for_invoice() + #[Test] + public function it_can_delete_refund_for_invoice(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -879,8 +886,8 @@ public function it_can_delete_refund_for_invoice() $this->assertEmpty($response); } - /** @test */ - public function it_can_send_an_invoice() + #[Test] + public function it_can_send_an_invoice(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -906,8 +913,8 @@ public function it_can_send_an_invoice() $this->assertEmpty($response); } - /** @test */ - public function it_can_send_reminder_for_an_invoice() + #[Test] + public function it_can_send_reminder_for_an_invoice(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -933,8 +940,8 @@ public function it_can_send_reminder_for_an_invoice() $this->assertEmpty($response); } - /** @test */ - public function it_can_create_invoice_template() + #[Test] + public function it_can_create_invoice_template(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -955,8 +962,8 @@ public function it_can_create_invoice_template() $this->assertArrayHasKey('id', $response); } - /** @test */ - public function it_can_list_invoice_templates() + #[Test] + public function it_can_list_invoice_templates(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -975,8 +982,8 @@ public function it_can_list_invoice_templates() $this->assertArrayHasKey('templates', $response); } - /** @test */ - public function it_can_delete_an_invoice_template() + #[Test] + public function it_can_delete_an_invoice_template(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -992,8 +999,8 @@ public function it_can_delete_an_invoice_template() $this->assertEmpty($response); } - /** @test */ - public function it_can_update_an_invoice_template() + #[Test] + public function it_can_update_an_invoice_template(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1014,8 +1021,8 @@ public function it_can_update_an_invoice_template() $this->assertArrayHasKey('id', $response); } - /** @test */ - public function it_can_get_details_for_an_invoice_template() + #[Test] + public function it_can_get_details_for_an_invoice_template(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1034,8 +1041,8 @@ public function it_can_get_details_for_an_invoice_template() $this->assertArrayHasKey('id', $response); } - /** @test */ - public function it_can_search_invoices() + #[Test] + public function it_can_search_invoices(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1054,8 +1061,8 @@ public function it_can_search_invoices() $this->assertArrayHasKey('total_items', $response); } - /** @test */ - public function it_can_search_invoices_with_custom_filters() + #[Test] + public function it_can_search_invoices_with_custom_filters(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1088,8 +1095,8 @@ public function it_can_search_invoices_with_custom_filters() $this->assertArrayHasKey('items', $response); } - /** @test */ - public function it_throws_exception_on_search_invoices_with_invalid_status() + #[Test] + public function it_throws_exception_on_search_invoices_with_invalid_status(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1109,8 +1116,8 @@ public function it_throws_exception_on_search_invoices_with_invalid_status() ->searchInvoices(); } - /** @test */ - public function it_throws_exception_on_search_invoices_with_invalid_amount_ranges() + #[Test] + public function it_throws_exception_on_search_invoices_with_invalid_amount_ranges(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1132,8 +1139,8 @@ public function it_throws_exception_on_search_invoices_with_invalid_amount_range ->searchInvoices(); } - /** @test */ - public function it_throws_exception_on_search_invoices_with_invalid_date_ranges() + #[Test] + public function it_throws_exception_on_search_invoices_with_invalid_date_ranges(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1155,8 +1162,8 @@ public function it_throws_exception_on_search_invoices_with_invalid_date_ranges( ->searchInvoices(); } - /** @test */ - public function it_throws_exception_on_search_invoices_with_invalid_date_range_type() + #[Test] + public function it_throws_exception_on_search_invoices_with_invalid_date_range_type(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1178,8 +1185,8 @@ public function it_throws_exception_on_search_invoices_with_invalid_date_range_t ->searchInvoices(); } - /** @test */ - public function it_can_get_user_profile_details() + #[Test] + public function it_can_get_user_profile_details(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1197,8 +1204,8 @@ public function it_can_get_user_profile_details() $this->assertArrayHasKey('address', $response); } - /** @test */ - public function it_can_get_list_users() + #[Test] + public function it_can_get_list_users(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1216,7 +1223,7 @@ public function it_can_get_list_users() $this->assertArrayHasKey('Resources', $response); } - /** @test */ + #[Test] public function it_can_get_user_details() { $this->client->setAccessToken([ @@ -1237,8 +1244,8 @@ public function it_can_get_user_details() $this->assertArrayHasKey('userName', $response); } - /** @test */ - public function it_can_deleta_a_user() + #[Test] + public function it_can_deleta_a_user(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1256,8 +1263,8 @@ public function it_can_deleta_a_user() $this->assertEmpty($response); } - /** @test */ - public function it_can_create_merchant_applications() + #[Test] + public function it_can_create_merchant_applications(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1289,8 +1296,8 @@ public function it_can_create_merchant_applications() $this->assertArrayHasKey('redirect_uris', $response); } - /** @test */ - public function it_can_set_account_properties() + #[Test] + public function it_can_set_account_properties(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1306,8 +1313,8 @@ public function it_can_set_account_properties() $this->assertEmpty($response); } - /** @test */ - public function it_can_disable_account_properties() + #[Test] + public function it_can_disable_account_properties(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1325,8 +1332,8 @@ public function it_can_disable_account_properties() $this->assertEmpty($response); } - /** @test */ - public function it_can_get_client_token() + #[Test] + public function it_can_get_client_token(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1344,8 +1351,8 @@ public function it_can_get_client_token() $this->assertArrayHasKey('client_token', $response); } - /** @test */ - public function it_can_create_orders() + #[Test] + public function it_can_create_orders(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1367,8 +1374,8 @@ public function it_can_create_orders() $this->assertArrayHasKey('links', $response); } - /** @test */ - public function it_can_update_orders() + #[Test] + public function it_can_update_orders(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1389,8 +1396,8 @@ public function it_can_update_orders() $this->assertNotEmpty($response); } - /** @test */ - public function it_can_get_order_details() + #[Test] + public function it_can_get_order_details(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1415,8 +1422,8 @@ public function it_can_get_order_details() $this->assertArrayHasKey('links', $response); } - /** @test */ - public function it_can_authorize_payment_for_an_order() + #[Test] + public function it_can_authorize_payment_for_an_order(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1439,8 +1446,8 @@ public function it_can_authorize_payment_for_an_order() $this->assertArrayHasKey('links', $response); } - /** @test */ - public function it_can_create_partner_referral() + #[Test] + public function it_can_create_partner_referral(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1460,8 +1467,8 @@ public function it_can_create_partner_referral() $this->assertArrayHasKey('links', $response); } - /** @test */ - public function it_can_get_referral_details() + #[Test] + public function it_can_get_referral_details(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1482,8 +1489,8 @@ public function it_can_get_referral_details() $this->assertArrayHasKey('referral_data', $response); } - /** @test */ - public function it_can_list_seller_tracking_information() + #[Test] + public function it_can_list_seller_tracking_information(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1505,8 +1512,8 @@ public function it_can_list_seller_tracking_information() $this->assertArrayHasKey('tracking_id', $response); } - /** @test */ - public function it_can_show_seller_status() + #[Test] + public function it_can_show_seller_status(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1527,8 +1534,8 @@ public function it_can_show_seller_status() $this->assertArrayHasKey('merchant_id', $response); } - /** @test */ - public function it_can_list_merchant_credentials() + #[Test] + public function it_can_list_merchant_credentials(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1549,8 +1556,8 @@ public function it_can_list_merchant_credentials() $this->assertArrayHasKey('payer_id', $response); } - /** @test */ - public function it_can_list_web_experience_profiles() + #[Test] + public function it_can_list_web_experience_profiles(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1569,8 +1576,8 @@ public function it_can_list_web_experience_profiles() $this->assertArrayHasKey('id', collect($response)->first()); } - /** @test */ - public function it_can_create_web_experience_profile() + #[Test] + public function it_can_create_web_experience_profile(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1591,8 +1598,8 @@ public function it_can_create_web_experience_profile() $this->assertArrayHasKey('name', $response); } - /** @test */ - public function it_can_delete_web_experience_profile() + #[Test] + public function it_can_delete_web_experience_profile(): void { $expectedResponse = ''; @@ -1612,8 +1619,8 @@ public function it_can_delete_web_experience_profile() $this->assertEmpty($response); } - /** @test */ - public function it_can_partially_update_web_experience_profile() + #[Test] + public function it_can_partially_update_web_experience_profile(): void { $expectedResponse = ''; @@ -1633,8 +1640,8 @@ public function it_can_partially_update_web_experience_profile() $this->assertEmpty($response); } - /** @test */ - public function it_can_fully_update_web_experience_profile() + #[Test] + public function it_can_fully_update_web_experience_profile(): void { $expectedResponse = ''; @@ -1654,8 +1661,8 @@ public function it_can_fully_update_web_experience_profile() $this->assertEmpty($response); } - /** @test */ - public function it_can_get_web_experience_profile_details() + #[Test] + public function it_can_get_web_experience_profile_details(): void { $expectedResponse = $this->mockWebProfileResponse(); @@ -1676,8 +1683,8 @@ public function it_can_get_web_experience_profile_details() $this->assertArrayHasKey('name', $response); } - /** @test */ - public function it_can_capture_payment_for_an_order() + #[Test] + public function it_can_capture_payment_for_an_order(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1700,8 +1707,8 @@ public function it_can_capture_payment_for_an_order() $this->assertArrayHasKey('links', $response); } - /** @test */ - public function it_can_show_details_for_an_authorized_payment() + #[Test] + public function it_can_show_details_for_an_authorized_payment(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1720,8 +1727,8 @@ public function it_can_show_details_for_an_authorized_payment() $this->assertArrayHasKey('id', $response); } - /** @test */ - public function it_can_capture_an_authorized_payment() + #[Test] + public function it_can_capture_an_authorized_payment(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1745,8 +1752,8 @@ public function it_can_capture_an_authorized_payment() $this->assertArrayHasKey('id', $response); } - /** @test */ - public function it_can_reauthorize_an_authorized_payment() + #[Test] + public function it_can_reauthorize_an_authorized_payment(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1765,8 +1772,8 @@ public function it_can_reauthorize_an_authorized_payment() $this->assertArrayHasKey('id', $response); } - /** @test */ - public function it_can_void_an_authorized_payment() + #[Test] + public function it_can_void_an_authorized_payment(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1782,8 +1789,8 @@ public function it_can_void_an_authorized_payment() $this->assertEmpty($response); } - /** @test */ - public function it_can_show_details_for_a_captured_payment() + #[Test] + public function it_can_show_details_for_a_captured_payment(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1802,8 +1809,8 @@ public function it_can_show_details_for_a_captured_payment() $this->assertArrayHasKey('id', $response); } - /** @test */ - public function it_can_refund_a_captured_payment() + #[Test] + public function it_can_refund_a_captured_payment(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1827,8 +1834,8 @@ public function it_can_refund_a_captured_payment() $this->assertArrayHasKey('id', $response); } - /** @test */ - public function it_can_show_details_for_a_refund() + #[Test] + public function it_can_show_details_for_a_refund(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -1847,8 +1854,8 @@ public function it_can_show_details_for_a_refund() $this->assertArrayHasKey('id', $response); } - /** @test */ - public function it_can_create_batch_payout() + #[Test] + public function it_can_create_batch_payout(): void { $expectedResponse = $this->mockCreateBatchPayoutResponse(); @@ -1869,8 +1876,8 @@ public function it_can_create_batch_payout() $this->assertArrayHasKey('batch_header', $response); } - /** @test */ - public function it_can_show_batch_payout_details() + #[Test] + public function it_can_show_batch_payout_details(): void { $expectedResponse = $this->showBatchPayoutResponse(); @@ -1892,8 +1899,8 @@ public function it_can_show_batch_payout_details() $this->assertArrayHasKey('items', $response); } - /** @test */ - public function it_can_show_batch_payout_item_details() + #[Test] + public function it_can_show_batch_payout_item_details(): void { $expectedResponse = $this->showBatchPayoutItemResponse(); @@ -1916,8 +1923,8 @@ public function it_can_show_batch_payout_item_details() $this->assertArrayHasKey('payout_item', $response); } - /** @test */ - public function it_can_cancel_unclaimed_batch_payout_item() + #[Test] + public function it_can_cancel_unclaimed_batch_payout_item(): void { $expectedResponse = $this->mockCancelUnclaimedBatchItemResponse(); @@ -1940,8 +1947,8 @@ public function it_can_cancel_unclaimed_batch_payout_item() $this->assertArrayHasKey('payout_item', $response); } - /** @test */ - public function it_can_create_referenced_batch_payout() + #[Test] + public function it_can_create_referenced_batch_payout(): void { $expectedResponse = $this->mockCreateReferencedBatchPayoutResponse(); @@ -1965,8 +1972,8 @@ public function it_can_create_referenced_batch_payout() $this->assertArrayHasKey('links', $response); } - /** @test */ - public function it_can_list_items_referenced_in_batch_payout() + #[Test] + public function it_can_list_items_referenced_in_batch_payout(): void { $expectedResponse = $this->mockShowReferencedBatchPayoutResponse(); @@ -1987,8 +1994,8 @@ public function it_can_list_items_referenced_in_batch_payout() $this->assertArrayHasKey('links', $response); } - /** @test */ - public function it_can_create_referenced_batch_payout_item() + #[Test] + public function it_can_create_referenced_batch_payout_item(): void { $expectedResponse = $this->mockCreateReferencedBatchPayoutItemResponse(); @@ -2012,8 +2019,8 @@ public function it_can_create_referenced_batch_payout_item() $this->assertArrayHasKey('links', $response); } - /** @test */ - public function it_can_show_referenced_payout_item_details() + #[Test] + public function it_can_show_referenced_payout_item_details(): void { $expectedResponse = $this->mockShowReferencedBatchPayoutItemResponse(); @@ -2036,8 +2043,8 @@ public function it_can_show_referenced_payout_item_details() $this->assertArrayHasKey('reference_id', $response); } - /** @test */ - public function it_can_list_transactions() + #[Test] + public function it_can_list_transactions(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2061,8 +2068,8 @@ public function it_can_list_transactions() $this->assertGreaterThan(0, sizeof($response['transaction_details'])); } - /** @test */ - public function it_can_list_account_balances() + #[Test] + public function it_can_list_account_balances(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2082,8 +2089,8 @@ public function it_can_list_account_balances() $this->assertNotEmpty($response); } - /** @test */ - public function it_can_list_account_balances_for_a_different_currency() + #[Test] + public function it_can_list_account_balances_for_a_different_currency(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2103,8 +2110,8 @@ public function it_can_list_account_balances_for_a_different_currency() $this->assertNotEmpty($response); } - /** @test */ - public function it_can_create_a_subscription() + #[Test] + public function it_can_create_a_subscription(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2125,8 +2132,8 @@ public function it_can_create_a_subscription() $this->assertArrayHasKey('id', $response); } - /** @test */ - public function it_can_update_a_subscription() + #[Test] + public function it_can_update_a_subscription(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2144,8 +2151,8 @@ public function it_can_update_a_subscription() $this->assertEmpty($response); } - /** @test */ - public function it_can_show_details_for_a_subscription() + #[Test] + public function it_can_show_details_for_a_subscription(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2164,8 +2171,8 @@ public function it_can_show_details_for_a_subscription() $this->assertArrayHasKey('id', $response); } - /** @test */ - public function it_can_activate_a_subscription() + #[Test] + public function it_can_activate_a_subscription(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2181,8 +2188,8 @@ public function it_can_activate_a_subscription() $this->assertEmpty($response); } - /** @test */ - public function it_can_cancel_a_subscription() + #[Test] + public function it_can_cancel_a_subscription(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2198,7 +2205,7 @@ public function it_can_cancel_a_subscription() $this->assertEmpty($response); } - /** @test */ + #[Test] public function it_can_suspend_a_subscription() { $this->client->setAccessToken([ @@ -2215,8 +2222,8 @@ public function it_can_suspend_a_subscription() $this->assertEmpty($response); } - /** @test */ - public function it_can_capture_payment_for_a_subscription() + #[Test] + public function it_can_capture_payment_for_a_subscription(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2232,8 +2239,8 @@ public function it_can_capture_payment_for_a_subscription() $this->assertEmpty($response); } - /** @test */ - public function it_can_update_quantity_or_product_for_a_subscription() + #[Test] + public function it_can_update_quantity_or_product_for_a_subscription(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2254,8 +2261,8 @@ public function it_can_update_quantity_or_product_for_a_subscription() $this->assertArrayHasKey('plan_id', $response); } - /** @test */ - public function it_can_list_transactions_for_a_subscription() + #[Test] + public function it_can_list_transactions_for_a_subscription(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2274,8 +2281,8 @@ public function it_can_list_transactions_for_a_subscription() $this->assertEquals($response, $this->mockListSubscriptionTransactionsResponse()); } - /** @test */ - public function it_can_list_tracking_details() + #[Test] + public function it_can_list_tracking_details(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2296,8 +2303,8 @@ public function it_can_list_tracking_details() $this->assertArrayHasKey('tracking_number', $response); } - /** @test */ - public function it_can_get_tracking_details_for_tracking_id() + #[Test] + public function it_can_get_tracking_details_for_tracking_id(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2317,8 +2324,8 @@ public function it_can_get_tracking_details_for_tracking_id() $this->assertArrayHasKey('tracking_number', $response); } - /** @test */ - public function it_can_update_tracking_details_for_tracking_id() + #[Test] + public function it_can_update_tracking_details_for_tracking_id(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2337,8 +2344,8 @@ public function it_can_update_tracking_details_for_tracking_id() $this->assertEmpty($response); } - /** @test */ - public function it_can_create_tracking_in_batches() + #[Test] + public function it_can_create_tracking_in_batches(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2359,8 +2366,8 @@ public function it_can_create_tracking_in_batches() $this->assertArrayHasKey('tracker_identifiers', $response); } - /** @test */ - public function it_can_create_single_tracking_for_single_transaction() + #[Test] + public function it_can_create_single_tracking_for_single_transaction(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2381,8 +2388,8 @@ public function it_can_create_single_tracking_for_single_transaction() $this->assertArrayHasKey('tracker_identifiers', $response); } - /** @test */ - public function it_can_list_web_hooks_event_types() + #[Test] + public function it_can_list_web_hooks_event_types(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2401,8 +2408,8 @@ public function it_can_list_web_hooks_event_types() $this->assertArrayHasKey('event_types', $response); } - /** @test */ - public function it_can_list_web_hooks_events() + #[Test] + public function it_can_list_web_hooks_events(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2421,8 +2428,8 @@ public function it_can_list_web_hooks_events() $this->assertArrayHasKey('events', $response); } - /** @test */ - public function it_can_show_details_for_a_web_hooks_event() + #[Test] + public function it_can_show_details_for_a_web_hooks_event(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2441,8 +2448,8 @@ public function it_can_show_details_for_a_web_hooks_event() $this->assertArrayHasKey('id', $response); } - /** @test */ - public function it_can_resend_notification_for_a_web_hooks_event() + #[Test] + public function it_can_resend_notification_for_a_web_hooks_event(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2463,8 +2470,8 @@ public function it_can_resend_notification_for_a_web_hooks_event() $this->assertArrayHasKey('id', $response); } - /** @test */ - public function it_can_create_a_web_hook() + #[Test] + public function it_can_create_a_web_hook(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2486,8 +2493,8 @@ public function it_can_create_a_web_hook() $this->assertArrayHasKey('event_types', $response); } - /** @test */ - public function it_can_list_web_hooks() + #[Test] + public function it_can_list_web_hooks(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2506,8 +2513,8 @@ public function it_can_list_web_hooks() $this->assertArrayHasKey('webhooks', $response); } - /** @test */ - public function it_can_delete_a_web_hook() + #[Test] + public function it_can_delete_a_web_hook(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2523,8 +2530,8 @@ public function it_can_delete_a_web_hook() $this->assertEmpty($response); } - /** @test */ - public function it_can_update_a_web_hook() + #[Test] + public function it_can_update_a_web_hook(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2545,8 +2552,8 @@ public function it_can_update_a_web_hook() $this->assertArrayHasKey('event_types', $response); } - /** @test */ - public function it_can_show_details_for_a_web_hook() + #[Test] + public function it_can_show_details_for_a_web_hook(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2565,8 +2572,8 @@ public function it_can_show_details_for_a_web_hook() $this->assertArrayHasKey('event_types', $response); } - /** @test */ - public function it_can_list_events_for_web_hooks() + #[Test] + public function it_can_list_events_for_web_hooks(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2585,8 +2592,8 @@ public function it_can_list_events_for_web_hooks() $this->assertArrayHasKey('event_types', $response); } - /** @test */ - public function it_can_verify_web_hook_signature() + #[Test] + public function it_can_verify_web_hook_signature(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2607,8 +2614,8 @@ public function it_can_verify_web_hook_signature() $this->assertArrayHasKey('verification_status', $response); } - /** @test */ - public function it_can_list_payment_methods_source_tokens() + #[Test] + public function it_can_list_payment_methods_source_tokens(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2628,8 +2635,8 @@ public function it_can_list_payment_methods_source_tokens() $this->assertArrayHasKey('payment_tokens', $response); } - /** @test */ - public function it_can_show_details_for_payment_method_source_token() + #[Test] + public function it_can_show_details_for_payment_method_source_token(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2650,8 +2657,8 @@ public function it_can_show_details_for_payment_method_source_token() $this->assertArrayHasKey('payment_source', $response); } - /** @test */ - public function it_can_delete_a_payment_method_source_token() + #[Test] + public function it_can_delete_a_payment_method_source_token(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -2667,8 +2674,8 @@ public function it_can_delete_a_payment_method_source_token() $this->assertEmpty($response); } - /** @test */ - public function it_can_show_details_for_payment_setup_token() + #[Test] + public function it_can_show_details_for_payment_setup_token(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, diff --git a/tests/Feature/AdapterOrdersHelperTest.php b/tests/Feature/AdapterOrdersHelperTest.php index e25ee6f4..1cbc0c53 100644 --- a/tests/Feature/AdapterOrdersHelperTest.php +++ b/tests/Feature/AdapterOrdersHelperTest.php @@ -3,6 +3,7 @@ namespace Srmklive\PayPal\Tests\Feature; use Carbon\Carbon; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Services\PayPal as PayPalClient; use Srmklive\PayPal\Tests\MockClientClasses; @@ -16,10 +17,10 @@ class AdapterOrdersHelperTest extends TestCase use MockResponsePayloads; /** @var string */ - protected static $access_token = ''; + protected static string $access_token = ''; - /** @var \Srmklive\PayPal\Services\PayPal */ - protected $client; + /** @var PayPalClient */ + protected PayPalClient $client; protected function setUp(): void { @@ -37,8 +38,8 @@ protected function setUp(): void parent::setUp(); } - /** @test */ - public function it_can_confirm_payment_for_an_order() + #[Test] + public function it_can_confirm_payment_for_an_order(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, diff --git a/tests/Feature/AdapterPaymentMethodTokensHelpersTest.php b/tests/Feature/AdapterPaymentMethodTokensHelpersTest.php index 79fdfbb4..f981abc4 100644 --- a/tests/Feature/AdapterPaymentMethodTokensHelpersTest.php +++ b/tests/Feature/AdapterPaymentMethodTokensHelpersTest.php @@ -2,6 +2,7 @@ namespace Srmklive\PayPal\Tests\Feature; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Services\PayPal as PayPalClient; use Srmklive\PayPal\Tests\MockClientClasses; @@ -15,10 +16,10 @@ class AdapterPaymentMethodTokensHelpersTest extends TestCase use MockResponsePayloads; /** @var string */ - protected static $access_token = ''; + protected static string $access_token = ''; - /** @var \Srmklive\PayPal\Services\PayPal */ - protected $client; + /** @var PayPalClient */ + protected PayPalClient $client; protected function setUp(): void { @@ -36,8 +37,8 @@ protected function setUp(): void parent::setUp(); } - /** @test */ - public function it_can_create_payment_token_from_a_vault_token() + #[Test] + public function it_can_create_payment_token_from_a_vault_token(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -59,8 +60,8 @@ public function it_can_create_payment_token_from_a_vault_token() $this->assertArrayHasKey('customer', $response); } - /** @test */ - public function it_can_create_payment_source_from_a_vault_token() + #[Test] + public function it_can_create_payment_source_from_a_vault_token(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -81,8 +82,8 @@ public function it_can_create_payment_source_from_a_vault_token() $this->assertArrayHasKey('payment_source', $response); } - /** @test */ - public function it_can_create_payment_source_from_a_credit_card() + #[Test] + public function it_can_create_payment_source_from_a_credit_card(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -103,8 +104,8 @@ public function it_can_create_payment_source_from_a_credit_card() $this->assertArrayHasKey('payment_source', $response); } - /** @test */ - public function it_can_create_payment_source_from_a_paypal_account() + #[Test] + public function it_can_create_payment_source_from_a_paypal_account(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, @@ -127,8 +128,8 @@ public function it_can_create_payment_source_from_a_paypal_account() $this->assertArrayHasKey('payment_source', $response); } - /** @test */ - public function it_can_create_payment_source_from_a_venmo_account() + #[Test] + public function it_can_create_payment_source_from_a_venmo_account(): void { $this->client->setAccessToken([ 'access_token' => self::$access_token, diff --git a/tests/Unit/Adapter/BillingPlansTest.php b/tests/Unit/Adapter/BillingPlansTest.php index 9f38f093..75740558 100644 --- a/tests/Unit/Adapter/BillingPlansTest.php +++ b/tests/Unit/Adapter/BillingPlansTest.php @@ -2,6 +2,7 @@ namespace Srmklive\PayPal\Tests\Unit\Adapter; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -13,8 +14,8 @@ class BillingPlansTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_create_a_billing_plan() + #[Test] + public function it_can_create_a_billing_plan(): void { $expectedResponse = $this->mockCreatePlansResponse(); @@ -32,8 +33,8 @@ public function it_can_create_a_billing_plan() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}($expectedParams, 'some-request-id')); } - /** @test */ - public function it_can_list_billing_plans() + #[Test] + public function it_can_list_billing_plans(): void { $expectedResponse = $this->mockListPlansResponse(); @@ -47,8 +48,8 @@ public function it_can_list_billing_plans() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}(1, 2, true)); } - /** @test */ - public function it_can_update_a_billing_plan() + #[Test] + public function it_can_update_a_billing_plan(): void { $expectedResponse = ''; @@ -64,8 +65,8 @@ public function it_can_update_a_billing_plan() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('P-7GL4271244454362WXNWU5NQ', $expectedParams)); } - /** @test */ - public function it_can_show_details_for_a_billing_plan() + #[Test] + public function it_can_show_details_for_a_billing_plan(): void { $expectedResponse = $this->mockGetPlansResponse(); @@ -79,8 +80,8 @@ public function it_can_show_details_for_a_billing_plan() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('P-7GL4271244454362WXNWU5NQ')); } - /** @test */ - public function it_can_activate_a_billing_plan() + #[Test] + public function it_can_activate_a_billing_plan(): void { $expectedResponse = ''; @@ -94,8 +95,8 @@ public function it_can_activate_a_billing_plan() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('P-7GL4271244454362WXNWU5NQ')); } - /** @test */ - public function it_can_deactivate_a_billing_plan() + #[Test] + public function it_can_deactivate_a_billing_plan(): void { $expectedResponse = ''; @@ -109,8 +110,8 @@ public function it_can_deactivate_a_billing_plan() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('P-7GL4271244454362WXNWU5NQ')); } - /** @test */ - public function it_can_update_pricing_for_a_billing_plan() + #[Test] + public function it_can_update_pricing_for_a_billing_plan(): void { $expectedResponse = ''; diff --git a/tests/Unit/Adapter/CatalogProductsTest.php b/tests/Unit/Adapter/CatalogProductsTest.php index a9326926..20797583 100644 --- a/tests/Unit/Adapter/CatalogProductsTest.php +++ b/tests/Unit/Adapter/CatalogProductsTest.php @@ -2,6 +2,7 @@ namespace Srmklive\PayPal\Tests\Unit\Adapter; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -13,8 +14,8 @@ class CatalogProductsTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_create_a_product() + #[Test] + public function it_can_create_a_product(): void { $expectedResponse = $this->mockCreateCatalogProductsResponse(); @@ -32,8 +33,8 @@ public function it_can_create_a_product() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}($expectedParams)); } - /** @test */ - public function it_can_list_products() + #[Test] + public function it_can_list_products(): void { $expectedResponse = $this->mockListCatalogProductsResponse(); @@ -47,8 +48,8 @@ public function it_can_list_products() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}()); } - /** @test */ - public function it_can_update_a_product() + #[Test] + public function it_can_update_a_product(): void { $expectedResponse = ''; @@ -64,8 +65,8 @@ public function it_can_update_a_product() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('72255d4849af8ed6e0df1173', $expectedParams)); } - /** @test */ - public function it_can_get_details_for_a_product() + #[Test] + public function it_can_get_details_for_a_product(): void { $expectedResponse = $this->mockGetCatalogProductsResponse(); diff --git a/tests/Unit/Adapter/DisputeActionsTest.php b/tests/Unit/Adapter/DisputeActionsTest.php index af82c35d..ec962968 100644 --- a/tests/Unit/Adapter/DisputeActionsTest.php +++ b/tests/Unit/Adapter/DisputeActionsTest.php @@ -2,6 +2,7 @@ namespace Srmklive\PayPal\Tests\Unit\Adapter; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockResponsePayloads; @@ -11,8 +12,8 @@ class DisputeActionsTest extends TestCase use MockClientClasses; use MockResponsePayloads; - /** @test */ - public function it_can_accept_dispute_claim() + #[Test] + public function it_can_accept_dispute_claim(): void { $expectedResponse = $this->mockAcceptDisputesClaimResponse(); @@ -26,8 +27,8 @@ public function it_can_accept_dispute_claim() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('PP-D-27803', 'Full refund to the customer.')); } - /** @test */ - public function it_can_accept_dispute_offer_resolution() + #[Test] + public function it_can_accept_dispute_offer_resolution(): void { $expectedResponse = $this->mockAcceptDisputesOfferResolutionResponse(); @@ -41,8 +42,8 @@ public function it_can_accept_dispute_offer_resolution() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('PP-000-000-651-454', 'I am ok with the refund offered.')); } - /** @test */ - public function it_can_acknowledge_item_is_returned_for_raised_dispute() + #[Test] + public function it_can_acknowledge_item_is_returned_for_raised_dispute(): void { $expectedResponse = $this->mockAcknowledgeItemReturnedResponse(); diff --git a/tests/Unit/Adapter/DisputesTest.php b/tests/Unit/Adapter/DisputesTest.php index b659fa0b..76771c39 100644 --- a/tests/Unit/Adapter/DisputesTest.php +++ b/tests/Unit/Adapter/DisputesTest.php @@ -2,6 +2,7 @@ namespace Srmklive\PayPal\Tests\Unit\Adapter; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -13,8 +14,8 @@ class DisputesTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_list_disputes() + #[Test] + public function it_can_list_disputes(): void { $expectedResponse = $this->mockListDisputesResponse(); @@ -28,8 +29,8 @@ public function it_can_list_disputes() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}()); } - /** @test */ - public function it_can_partially_update_a_dispute() + #[Test] + public function it_can_partially_update_a_dispute(): void { $expectedResponse = ''; @@ -45,8 +46,8 @@ public function it_can_partially_update_a_dispute() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('PP-D-27803', $expectedParams)); } - /** @test */ - public function it_can_get_details_for_a_dispute() + #[Test] + public function it_can_get_details_for_a_dispute(): void { $expectedResponse = $this->mockGetDisputesResponse(); diff --git a/tests/Unit/Adapter/IdentityTest.php b/tests/Unit/Adapter/IdentityTest.php index 78606de8..0314729b 100644 --- a/tests/Unit/Adapter/IdentityTest.php +++ b/tests/Unit/Adapter/IdentityTest.php @@ -2,6 +2,7 @@ namespace Srmklive\PayPal\Tests\Unit\Adapter; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -13,8 +14,8 @@ class IdentityTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_get_user_profile_details() + #[Test] + public function it_can_get_user_profile_details(): void { $expectedResponse = $this->mockShowProfileInfoResponse(); diff --git a/tests/Unit/Adapter/InvoicesSearchTest.php b/tests/Unit/Adapter/InvoicesSearchTest.php index 473b203e..c93efcdd 100644 --- a/tests/Unit/Adapter/InvoicesSearchTest.php +++ b/tests/Unit/Adapter/InvoicesSearchTest.php @@ -2,6 +2,7 @@ namespace Srmklive\PayPal\Tests\Unit\Adapter; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -13,8 +14,8 @@ class InvoicesSearchTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_search_invoices() + #[Test] + public function it_can_search_invoices(): void { $expectedResponse = $this->mockSearchInvoicesResponse(); @@ -28,8 +29,8 @@ public function it_can_search_invoices() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}(1, 1, true)); } - /** @test */ - public function it_can_search_invoices_with_custom_filters() + #[Test] + public function it_can_search_invoices_with_custom_filters(): void { $expectedResponse = $this->mockSearchInvoicesResponse(); diff --git a/tests/Unit/Adapter/InvoicesTemplatesTest.php b/tests/Unit/Adapter/InvoicesTemplatesTest.php index d62013a3..feaf2f16 100644 --- a/tests/Unit/Adapter/InvoicesTemplatesTest.php +++ b/tests/Unit/Adapter/InvoicesTemplatesTest.php @@ -2,6 +2,7 @@ namespace Srmklive\PayPal\Tests\Unit\Adapter; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -13,8 +14,8 @@ class InvoicesTemplatesTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_create_invoice_template() + #[Test] + public function it_can_create_invoice_template(): void { $expectedResponse = $this->mockCreateInvoiceTemplateResponse(); @@ -30,8 +31,8 @@ public function it_can_create_invoice_template() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}($expectedParams)); } - /** @test */ - public function it_can_list_invoice_templates() + #[Test] + public function it_can_list_invoice_templates(): void { $expectedResponse = $this->mockListInvoiceTemplateResponse(); @@ -45,8 +46,8 @@ public function it_can_list_invoice_templates() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}()); } - /** @test */ - public function it_can_delete_an_invoice_template() + #[Test] + public function it_can_delete_an_invoice_template(): void { $expectedResponse = ''; @@ -60,8 +61,8 @@ public function it_can_delete_an_invoice_template() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('TEMP-19V05281TU309413B')); } - /** @test */ - public function it_can_update_an_invoice_template() + #[Test] + public function it_can_update_an_invoice_template(): void { $expectedResponse = $this->mockUpdateInvoiceTemplateResponse(); @@ -77,8 +78,8 @@ public function it_can_update_an_invoice_template() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('TEMP-19V05281TU309413B', $expectedParams)); } - /** @test */ - public function it_can_get_details_for_an_invoice_template() + #[Test] + public function it_can_get_details_for_an_invoice_template(): void { $expectedResponse = $this->mockGetInvoiceTemplateResponse(); diff --git a/tests/Unit/Adapter/InvoicesTest.php b/tests/Unit/Adapter/InvoicesTest.php index e0829bdd..e2be7b45 100644 --- a/tests/Unit/Adapter/InvoicesTest.php +++ b/tests/Unit/Adapter/InvoicesTest.php @@ -2,6 +2,7 @@ namespace Srmklive\PayPal\Tests\Unit\Adapter; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -13,8 +14,8 @@ class InvoicesTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_generate_unique_invoice_number() + #[Test] + public function it_can_generate_unique_invoice_number(): void { $expectedResponse = $this->mockGenerateInvoiceNumberResponse(); @@ -28,8 +29,8 @@ public function it_can_generate_unique_invoice_number() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}()); } - /** @test */ - public function it_can_create_a_draft_invoice() + #[Test] + public function it_can_create_a_draft_invoice(): void { $expectedResponse = $this->mockCreateInvoicesResponse(); @@ -45,8 +46,8 @@ public function it_can_create_a_draft_invoice() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}($expectedParams)); } - /** @test */ - public function it_can_list_current_invoices() + #[Test] + public function it_can_list_current_invoices(): void { $expectedResponse = $this->mockListInvoicesResponse(); @@ -60,8 +61,8 @@ public function it_can_list_current_invoices() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}()); } - /** @test */ - public function it_can_delete_an_invoice() + #[Test] + public function it_can_delete_an_invoice(): void { $expectedResponse = ''; @@ -75,8 +76,8 @@ public function it_can_delete_an_invoice() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('INV2-Z56S-5LLA-Q52L-CPZ5')); } - /** @test */ - public function it_can_update_an_invoice() + #[Test] + public function it_can_update_an_invoice(): void { $expectedResponse = $this->mockUpdateInvoicesResponse(); @@ -92,8 +93,8 @@ public function it_can_update_an_invoice() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('INV2-Z56S-5LLA-Q52L-CPZ5', $expectedParams)); } - /** @test */ - public function it_can_show_details_for_an_invoice() + #[Test] + public function it_can_show_details_for_an_invoice(): void { $expectedResponse = $this->mockGetInvoicesResponse(); @@ -107,8 +108,8 @@ public function it_can_show_details_for_an_invoice() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('INV2-Z56S-5LLA-Q52L-CPZ5')); } - /** @test */ - public function it_can_cancel_an_invoice() + #[Test] + public function it_can_cancel_an_invoice(): void { $expectedResponse = ''; @@ -134,8 +135,8 @@ public function it_can_cancel_an_invoice() )); } - /** @test */ - public function it_can_generate_qr_code_for_invoice() + #[Test] + public function it_can_generate_qr_code_for_invoice(): void { $expectedResponse = $this->mockGenerateInvoiceQRCodeResponse(); @@ -149,8 +150,8 @@ public function it_can_generate_qr_code_for_invoice() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('INV2-Z56S-5LLA-Q52L-CPZ5', 400, 400)); } - /** @test */ - public function it_can_register_payment_for_invoice() + #[Test] + public function it_can_register_payment_for_invoice(): void { $expectedResponse = $this->mockInvoiceRegisterPaymentResponse(); @@ -164,8 +165,8 @@ public function it_can_register_payment_for_invoice() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('INV2-Z56S-5LLA-Q52L-CPZ5', '2018-05-01', 'BANK_TRANSFER', 10.00)); } - /** @test */ - public function it_can_delete_payment_for_invoice() + #[Test] + public function it_can_delete_payment_for_invoice(): void { $expectedResponse = ''; @@ -179,8 +180,8 @@ public function it_can_delete_payment_for_invoice() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('INV2-Z56S-5LLA-Q52L-CPZ5', 'EXTR-86F38350LX4353815')); } - /** @test */ - public function it_can_refund_payment_for_invoice() + #[Test] + public function it_can_refund_payment_for_invoice(): void { $expectedResponse = $this->mockInvoiceRefundPaymentResponse(); @@ -194,8 +195,8 @@ public function it_can_refund_payment_for_invoice() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('INV2-Z56S-5LLA-Q52L-CPZ5', '2018-05-01', 'BANK_TRANSFER', 5.00)); } - /** @test */ - public function it_can_delete_refund_for_invoice() + #[Test] + public function it_can_delete_refund_for_invoice(): void { $expectedResponse = ''; @@ -209,8 +210,8 @@ public function it_can_delete_refund_for_invoice() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('INV2-Z56S-5LLA-Q52L-CPZ5', 'EXTR-2LG703375E477444T')); } - /** @test */ - public function it_can_send_an_invoice() + #[Test] + public function it_can_send_an_invoice(): void { $expectedResponse = ''; @@ -234,8 +235,8 @@ public function it_can_send_an_invoice() )); } - /** @test */ - public function it_can_send_reminder_for_an_invoice() + #[Test] + public function it_can_send_reminder_for_an_invoice(): void { $expectedResponse = ''; diff --git a/tests/Unit/Adapter/OrdersTest.php b/tests/Unit/Adapter/OrdersTest.php index 572f1ce7..e1377e0a 100644 --- a/tests/Unit/Adapter/OrdersTest.php +++ b/tests/Unit/Adapter/OrdersTest.php @@ -2,6 +2,7 @@ namespace Srmklive\PayPal\Tests\Unit\Adapter; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -13,8 +14,8 @@ class OrdersTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_create_an_order() + #[Test] + public function it_can_create_an_order(): void { $expectedResponse = $this->mockCreateOrdersResponse(); @@ -30,8 +31,8 @@ public function it_can_create_an_order() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}($expectedParams)); } - /** @test */ - public function it_can_update_an_order() + #[Test] + public function it_can_update_an_order(): void { $expectedResponse = ''; diff --git a/tests/Unit/Adapter/PartnerReferralsTest.php b/tests/Unit/Adapter/PartnerReferralsTest.php index 9d67fa27..0ae469fc 100644 --- a/tests/Unit/Adapter/PartnerReferralsTest.php +++ b/tests/Unit/Adapter/PartnerReferralsTest.php @@ -2,6 +2,7 @@ namespace Srmklive\PayPal\Tests\Unit\Adapter; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -13,8 +14,8 @@ class PartnerReferralsTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_create_partner_referral() + #[Test] + public function it_can_create_partner_referral(): void { $expectedResponse = $this->mockCreatePartnerReferralsResponse(); @@ -30,8 +31,8 @@ public function it_can_create_partner_referral() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}($expectedParams)); } - /** @test */ - public function it_can_get_referral_details() + #[Test] + public function it_can_get_referral_details(): void { $expectedResponse = $this->mockShowReferralDataResponse(); diff --git a/tests/Unit/Adapter/PaymentAuthorizationsTest.php b/tests/Unit/Adapter/PaymentAuthorizationsTest.php index 8769f377..181b4f52 100644 --- a/tests/Unit/Adapter/PaymentAuthorizationsTest.php +++ b/tests/Unit/Adapter/PaymentAuthorizationsTest.php @@ -2,6 +2,7 @@ namespace Srmklive\PayPal\Tests\Unit\Adapter; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockResponsePayloads; @@ -11,8 +12,8 @@ class PaymentAuthorizationsTest extends TestCase use MockClientClasses; use MockResponsePayloads; - /** @test */ - public function it_can_show_details_for_an_authorized_payment() + #[Test] + public function it_can_show_details_for_an_authorized_payment(): void { $expectedResponse = $this->mockGetAuthorizedPaymentDetailsResponse(); @@ -26,8 +27,8 @@ public function it_can_show_details_for_an_authorized_payment() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('0VF52814937998046')); } - /** @test */ - public function it_can_capture_an_authorized_payment() + #[Test] + public function it_can_capture_an_authorized_payment(): void { $expectedResponse = $this->mockCaptureAuthorizedPaymentResponse(); @@ -46,8 +47,8 @@ public function it_can_capture_an_authorized_payment() )); } - /** @test */ - public function it_can_reauthorize_an_authorized_payment() + #[Test] + public function it_can_reauthorize_an_authorized_payment(): void { $expectedResponse = $this->mockReAuthorizeAuthorizedPaymentResponse(); @@ -61,8 +62,8 @@ public function it_can_reauthorize_an_authorized_payment() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('0VF52814937998046', 10.99)); } - /** @test */ - public function it_can_void_an_authorized_payment() + #[Test] + public function it_can_void_an_authorized_payment(): void { $expectedResponse = ''; diff --git a/tests/Unit/Adapter/PaymentCapturesTest.php b/tests/Unit/Adapter/PaymentCapturesTest.php index f052e53b..550c005b 100644 --- a/tests/Unit/Adapter/PaymentCapturesTest.php +++ b/tests/Unit/Adapter/PaymentCapturesTest.php @@ -2,6 +2,7 @@ namespace Srmklive\PayPal\Tests\Unit\Adapter; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockResponsePayloads; @@ -11,8 +12,8 @@ class PaymentCapturesTest extends TestCase use MockClientClasses; use MockResponsePayloads; - /** @test */ - public function it_can_show_details_for_a_captured_payment() + #[Test] + public function it_can_show_details_for_a_captured_payment(): void { $expectedResponse = $this->mockGetCapturedPaymentDetailsResponse(); @@ -26,8 +27,8 @@ public function it_can_show_details_for_a_captured_payment() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('2GG279541U471931P')); } - /** @test */ - public function it_can_refund_a_captured_payment() + #[Test] + public function it_can_refund_a_captured_payment(): void { $expectedResponse = $this->mockRefundCapturedPaymentResponse(); diff --git a/tests/Unit/Adapter/PaymentExperienceWebProfilesTest.php b/tests/Unit/Adapter/PaymentExperienceWebProfilesTest.php index d0f5c454..3963ced2 100644 --- a/tests/Unit/Adapter/PaymentExperienceWebProfilesTest.php +++ b/tests/Unit/Adapter/PaymentExperienceWebProfilesTest.php @@ -2,6 +2,7 @@ namespace Srmklive\PayPal\Tests\Unit\Adapter; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -13,8 +14,8 @@ class PaymentExperienceWebProfilesTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_list_web_experience_profiles() + #[Test] + public function it_can_list_web_experience_profiles(): void { $expectedResponse = $this->mockListWebProfilesResponse(); @@ -28,8 +29,8 @@ public function it_can_list_web_experience_profiles() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}()); } - /** @test */ - public function it_can_create_web_experience_profile() + #[Test] + public function it_can_create_web_experience_profile(): void { $expectedResponse = $this->mockWebProfileResponse(); @@ -47,8 +48,8 @@ public function it_can_create_web_experience_profile() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}($expectedParams)); } - /** @test */ - public function it_can_delete_web_experience_profile() + #[Test] + public function it_can_delete_web_experience_profile(): void { $expectedResponse = ''; @@ -64,8 +65,8 @@ public function it_can_delete_web_experience_profile() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}($expectedParams)); } - /** @test */ - public function it_can_partially_update_web_experience_profile() + #[Test] + public function it_can_partially_update_web_experience_profile(): void { $expectedResponse = ''; @@ -81,8 +82,8 @@ public function it_can_partially_update_web_experience_profile() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('XP-A88A-LYLW-8Y3X-E5ER', $expectedParams)); } - /** @test */ - public function it_can_fully_update_web_experience_profile() + #[Test] + public function it_can_fully_update_web_experience_profile(): void { $expectedResponse = ''; @@ -98,8 +99,8 @@ public function it_can_fully_update_web_experience_profile() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('XP-A88A-LYLW-8Y3X-E5ER', $expectedParams)); } - /** @test */ - public function it_can_get_web_experience_profile_details() + #[Test] + public function it_can_get_web_experience_profile_details(): void { $expectedResponse = $this->mockWebProfileResponse(); diff --git a/tests/Unit/Adapter/PaymentRefundsTest.php b/tests/Unit/Adapter/PaymentRefundsTest.php index 20b0d22f..faa4b9c6 100644 --- a/tests/Unit/Adapter/PaymentRefundsTest.php +++ b/tests/Unit/Adapter/PaymentRefundsTest.php @@ -2,6 +2,7 @@ namespace Srmklive\PayPal\Tests\Unit\Adapter; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockResponsePayloads; @@ -11,8 +12,8 @@ class PaymentRefundsTest extends TestCase use MockClientClasses; use MockResponsePayloads; - /** @test */ - public function it_can_show_details_for_a_refund() + #[Test] + public function it_can_show_details_for_a_refund(): void { $expectedResponse = $this->mockGetRefundDetailsResponse(); diff --git a/tests/Unit/Adapter/PayoutsTest.php b/tests/Unit/Adapter/PayoutsTest.php index da4a79ca..152e72d7 100644 --- a/tests/Unit/Adapter/PayoutsTest.php +++ b/tests/Unit/Adapter/PayoutsTest.php @@ -2,6 +2,7 @@ namespace Srmklive\PayPal\Tests\Unit\Adapter; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -13,8 +14,8 @@ class PayoutsTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_create_batch_payout() + #[Test] + public function it_can_create_batch_payout(): void { $expectedResponse = $this->mockCreateBatchPayoutResponse(); @@ -30,8 +31,8 @@ public function it_can_create_batch_payout() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}($expectedParams)); } - /** @test */ - public function it_can_show_batch_payout_details() + #[Test] + public function it_can_show_batch_payout_details(): void { $expectedResponse = $this->showBatchPayoutResponse(); @@ -47,8 +48,8 @@ public function it_can_show_batch_payout_details() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}($expectedParams)); } - /** @test */ - public function it_can_show_batch_payout_item_details() + #[Test] + public function it_can_show_batch_payout_item_details(): void { $expectedResponse = $this->showBatchPayoutItemResponse(); @@ -64,8 +65,8 @@ public function it_can_show_batch_payout_item_details() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}($expectedParams)); } - /** @test */ - public function it_can_cancel_unclaimed_batch_payout_item() + #[Test] + public function it_can_cancel_unclaimed_batch_payout_item(): void { $expectedResponse = $this->mockCancelUnclaimedBatchItemResponse(); diff --git a/tests/Unit/Adapter/ReferencedPayoutsTest.php b/tests/Unit/Adapter/ReferencedPayoutsTest.php index 0a184a73..c10d7bd9 100644 --- a/tests/Unit/Adapter/ReferencedPayoutsTest.php +++ b/tests/Unit/Adapter/ReferencedPayoutsTest.php @@ -2,6 +2,7 @@ namespace Srmklive\PayPal\Tests\Unit\Adapter; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -13,8 +14,8 @@ class ReferencedPayoutsTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_create_referenced_batch_payout() + #[Test] + public function it_can_create_referenced_batch_payout(): void { $expectedResponse = $this->mockCreateReferencedBatchPayoutResponse(); @@ -35,8 +36,8 @@ public function it_can_create_referenced_batch_payout() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}($expectedParams)); } - /** @test */ - public function it_can_list_items_referenced_in_batch_payout() + #[Test] + public function it_can_list_items_referenced_in_batch_payout(): void { $expectedResponse = $this->mockShowReferencedBatchPayoutResponse(); @@ -52,8 +53,8 @@ public function it_can_list_items_referenced_in_batch_payout() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}($expectedParams)); } - /** @test */ - public function it_can_create_referenced_batch_payout_item() + #[Test] + public function it_can_create_referenced_batch_payout_item(): void { $expectedResponse = $this->mockCreateReferencedBatchPayoutItemResponse(); @@ -74,8 +75,8 @@ public function it_can_create_referenced_batch_payout_item() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}($expectedParams)); } - /** @test */ - public function it_can_show_referenced_payout_item_details() + #[Test] + public function it_can_show_referenced_payout_item_details(): void { $expectedResponse = $this->mockShowReferencedBatchPayoutItemResponse(); diff --git a/tests/Unit/Adapter/ReportingTest.php b/tests/Unit/Adapter/ReportingTest.php index 07c5182a..7f307057 100644 --- a/tests/Unit/Adapter/ReportingTest.php +++ b/tests/Unit/Adapter/ReportingTest.php @@ -3,6 +3,7 @@ namespace Srmklive\PayPal\Tests\Unit\Adapter; use Carbon\Carbon; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockResponsePayloads; @@ -12,8 +13,8 @@ class ReportingTest extends TestCase use MockClientClasses; use MockResponsePayloads; - /** @test */ - public function it_can_list_transactions() + #[Test] + public function it_can_list_transactions(): void { $expectedResponse = $this->mockListTransactionsResponse(); @@ -32,8 +33,8 @@ public function it_can_list_transactions() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}($filters)); } - /** @test */ - public function it_can_list_balances() + #[Test] + public function it_can_list_balances(): void { $expectedResponse = $this->mockListBalancesResponse(); diff --git a/tests/Unit/Adapter/SubscriptionsTest.php b/tests/Unit/Adapter/SubscriptionsTest.php index ea00843a..cd1f75d5 100644 --- a/tests/Unit/Adapter/SubscriptionsTest.php +++ b/tests/Unit/Adapter/SubscriptionsTest.php @@ -2,6 +2,7 @@ namespace Srmklive\PayPal\Tests\Unit\Adapter; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -13,8 +14,8 @@ class SubscriptionsTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_create_a_subscription() + #[Test] + public function it_can_create_a_subscription(): void { $expectedResponse = $this->mockCreateSubscriptionResponse(); @@ -30,8 +31,8 @@ public function it_can_create_a_subscription() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}($expectedParams)); } - /** @test */ - public function it_can_update_a_subscription() + #[Test] + public function it_can_update_a_subscription(): void { $expectedResponse = ''; @@ -47,8 +48,8 @@ public function it_can_update_a_subscription() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('I-BW452GLLEP1G', $expectedParams)); } - /** @test */ - public function it_can_show_details_for_a_subscription() + #[Test] + public function it_can_show_details_for_a_subscription(): void { $expectedResponse = $this->mockGetSubscriptionDetailsResponse(); @@ -62,8 +63,8 @@ public function it_can_show_details_for_a_subscription() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('I-BW452GLLEP1G')); } - /** @test */ - public function it_can_activate_a_subscription() + #[Test] + public function it_can_activate_a_subscription(): void { $expectedResponse = ''; @@ -77,8 +78,8 @@ public function it_can_activate_a_subscription() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('I-BW452GLLEP1G', 'Reactivating the subscription')); } - /** @test */ - public function it_can_cancel_a_subscription() + #[Test] + public function it_can_cancel_a_subscription(): void { $expectedResponse = ''; @@ -92,8 +93,8 @@ public function it_can_cancel_a_subscription() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('I-BW452GLLEP1G', 'Not satisfied with the service')); } - /** @test */ - public function it_can_suspend_a_subscription() + #[Test] + public function it_can_suspend_a_subscription(): void { $expectedResponse = ''; @@ -107,8 +108,8 @@ public function it_can_suspend_a_subscription() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('I-BW452GLLEP1G', 'Item out of stock')); } - /** @test */ - public function it_can_capture_payment_for_a_subscription() + #[Test] + public function it_can_capture_payment_for_a_subscription(): void { $expectedResponse = ''; @@ -122,8 +123,8 @@ public function it_can_capture_payment_for_a_subscription() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('I-BW452GLLEP1G', 'Charging as the balance reached the limit', 100)); } - /** @test */ - public function it_can_update_quantity_or_product_for_a_subscription() + #[Test] + public function it_can_update_quantity_or_product_for_a_subscription(): void { $expectedResponse = $this->mockUpdateSubscriptionItemsResponse(); @@ -139,8 +140,8 @@ public function it_can_update_quantity_or_product_for_a_subscription() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('I-BW452GLLEP1G', $expectedParams)); } - /** @test */ - public function it_can_list_transactions_for_a_subscription() + #[Test] + public function it_can_list_transactions_for_a_subscription(): void { $expectedResponse = $this->mockListSubscriptionTransactionsResponse(); diff --git a/tests/Unit/Adapter/TrackersTest.php b/tests/Unit/Adapter/TrackersTest.php index 25a7d2df..4cc6ff76 100644 --- a/tests/Unit/Adapter/TrackersTest.php +++ b/tests/Unit/Adapter/TrackersTest.php @@ -2,6 +2,7 @@ namespace Srmklive\PayPal\Tests\Unit\Adapter; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -13,8 +14,8 @@ class TrackersTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_get_tracking_details_for_tracking_id() + #[Test] + public function it_can_get_tracking_details_for_tracking_id(): void { $expectedResponse = $this->mockGetTrackingDetailsResponse(); @@ -30,8 +31,8 @@ public function it_can_get_tracking_details_for_tracking_id() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}($expectedParams)); } - /** @test */ - public function it_can_update_tracking_details_for_tracking_id() + #[Test] + public function it_can_update_tracking_details_for_tracking_id(): void { $expectedResponse = ''; @@ -49,8 +50,8 @@ public function it_can_update_tracking_details_for_tracking_id() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}($expectedParams, $expectedData)); } - /** @test */ - public function it_can_create_tracking_in_batches() + #[Test] + public function it_can_create_tracking_in_batches(): void { $expectedResponse = $this->mockCreateTrackinginBatchesResponse(); diff --git a/tests/Unit/Adapter/WebHooksEventsTest.php b/tests/Unit/Adapter/WebHooksEventsTest.php index 952c2076..6490e5c6 100644 --- a/tests/Unit/Adapter/WebHooksEventsTest.php +++ b/tests/Unit/Adapter/WebHooksEventsTest.php @@ -2,6 +2,7 @@ namespace Srmklive\PayPal\Tests\Unit\Adapter; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockResponsePayloads; @@ -11,8 +12,8 @@ class WebHooksEventsTest extends TestCase use MockClientClasses; use MockResponsePayloads; - /** @test */ - public function it_can_list_web_hooks_event_types() + #[Test] + public function it_can_list_web_hooks_event_types(): void { $expectedResponse = $this->mockListWebHookEventsTypesResponse(); @@ -26,8 +27,8 @@ public function it_can_list_web_hooks_event_types() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}()); } - /** @test */ - public function it_can_list_web_hooks_events() + #[Test] + public function it_can_list_web_hooks_events(): void { $expectedResponse = $this->mockWebHookEventsListResponse(); @@ -41,8 +42,8 @@ public function it_can_list_web_hooks_events() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}()); } - /** @test */ - public function it_can_show_details_for_a_web_hooks_event() + #[Test] + public function it_can_show_details_for_a_web_hooks_event(): void { $expectedResponse = $this->mockGetWebHookEventResponse(); @@ -56,8 +57,8 @@ public function it_can_show_details_for_a_web_hooks_event() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('8PT597110X687430LKGECATA')); } - /** @test */ - public function it_can_resend_notification_for_a_web_hooks_event() + #[Test] + public function it_can_resend_notification_for_a_web_hooks_event(): void { $expectedResponse = $this->mockResendWebHookEventNotificationResponse(); diff --git a/tests/Unit/Adapter/WebHooksTest.php b/tests/Unit/Adapter/WebHooksTest.php index ae725d8f..36b9535f 100644 --- a/tests/Unit/Adapter/WebHooksTest.php +++ b/tests/Unit/Adapter/WebHooksTest.php @@ -2,6 +2,7 @@ namespace Srmklive\PayPal\Tests\Unit\Adapter; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -13,8 +14,8 @@ class WebHooksTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_create_a_web_hook() + #[Test] + public function it_can_create_a_web_hook(): void { $expectedResponse = $this->mockCreateWebHookResponse(); @@ -31,8 +32,8 @@ public function it_can_create_a_web_hook() )); } - /** @test */ - public function it_can_list_web_hooks() + #[Test] + public function it_can_list_web_hooks(): void { $expectedResponse = $this->mockListWebHookResponse(); @@ -46,8 +47,8 @@ public function it_can_list_web_hooks() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}()); } - /** @test */ - public function it_can_delete_a_web_hook() + #[Test] + public function it_can_delete_a_web_hook(): void { $expectedResponse = ''; @@ -61,8 +62,8 @@ public function it_can_delete_a_web_hook() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('5GP028458E2496506')); } - /** @test */ - public function it_can_update_a_web_hook() + #[Test] + public function it_can_update_a_web_hook(): void { $expectedResponse = $this->mockUpdateWebHookResponse(); @@ -78,8 +79,8 @@ public function it_can_update_a_web_hook() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('0EH40505U7160970P', $expectedParams)); } - /** @test */ - public function it_can_show_details_for_a_web_hook() + #[Test] + public function it_can_show_details_for_a_web_hook(): void { $expectedResponse = $this->mockGetWebHookResponse(); @@ -93,8 +94,8 @@ public function it_can_show_details_for_a_web_hook() $this->assertEquals($expectedResponse, $mockClient->{$expectedMethod}('0EH40505U7160970P')); } - /** @test */ - public function it_can_list_web_hooks_events() + #[Test] + public function it_can_list_web_hooks_events(): void { $expectedResponse = $this->mockListWebHookEventsResponse(); diff --git a/tests/Unit/Adapter/WebHooksVerificationTest.php b/tests/Unit/Adapter/WebHooksVerificationTest.php index a7ecd45c..ac9132f1 100644 --- a/tests/Unit/Adapter/WebHooksVerificationTest.php +++ b/tests/Unit/Adapter/WebHooksVerificationTest.php @@ -2,6 +2,7 @@ namespace Srmklive\PayPal\Tests\Unit\Adapter; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -13,8 +14,8 @@ class WebHooksVerificationTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_verify_web_hook_signature() + #[Test] + public function it_can_verify_web_hook_signature(): void { $expectedResponse = $this->mockVerifyWebHookSignatureResponse(); diff --git a/tests/Unit/AdapterTest.php b/tests/Unit/AdapterTest.php index 89ce3009..dbda6e5a 100644 --- a/tests/Unit/AdapterTest.php +++ b/tests/Unit/AdapterTest.php @@ -2,6 +2,7 @@ namespace Srmklive\PayPal\Tests\Unit; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Services\PayPal as PayPalClient; use Srmklive\PayPal\Tests\MockClientClasses; @@ -12,24 +13,24 @@ class AdapterTest extends TestCase use MockClientClasses; use MockResponsePayloads; - /** @test */ - public function it_can_be_instantiated() + #[Test] + public function it_can_be_instantiated(): void { $client = new PayPalClient($this->getMockCredentials()); $this->assertInstanceOf(PayPalClient::class, $client); } - /** @test */ - public function it_throws_exception_if_invalid_credentials_are_provided() + #[Test] + public function it_throws_exception_if_invalid_credentials_are_provided(): void { $this->expectException(\RuntimeException::class); $client = new PayPalClient(); } - /** @test */ - public function it_throws_exception_if_invalid_mode_is_provided() + #[Test] + public function it_throws_exception_if_invalid_mode_is_provided(): void { $this->expectException(\RuntimeException::class); // $this->expectErrorMessage('Invalid configuration provided. Please provide valid configuration for PayPal API. You can also refer to the documentation at https://srmklive.github.io/laravel-paypal/docs.html to setup correct configuration.'); @@ -40,8 +41,8 @@ public function it_throws_exception_if_invalid_mode_is_provided() $client = new PayPalClient($credentials); } - /** @test */ - public function it_throws_exception_if_empty_credentials_are_provided() + #[Test] + public function it_throws_exception_if_empty_credentials_are_provided(): void { $this->expectException(\RuntimeException::class); // $this->expectErrorMessage('Invalid configuration provided. Please provide valid configuration for PayPal API. You can also refer to the documentation at https://srmklive.github.io/laravel-paypal/docs.html to setup correct configuration.'); @@ -52,8 +53,8 @@ public function it_throws_exception_if_empty_credentials_are_provided() $client = new PayPalClient($credentials); } - /** @test */ - public function it_throws_exception_if_credentials_items_are_not_provided() + #[Test] + public function it_throws_exception_if_credentials_items_are_not_provided(): void { $item = 'client_id'; @@ -66,8 +67,8 @@ public function it_throws_exception_if_credentials_items_are_not_provided() $client = new PayPalClient($credentials); } - /** @test */ - public function it_can_get_access_token() + #[Test] + public function it_can_get_access_token(): void { $expectedResponse = $this->mockAccessTokenResponse(); diff --git a/tests/Unit/Client/BillingPlansTest.php b/tests/Unit/Client/BillingPlansTest.php index 70bf72da..af10d1c6 100644 --- a/tests/Unit/Client/BillingPlansTest.php +++ b/tests/Unit/Client/BillingPlansTest.php @@ -3,6 +3,7 @@ namespace Srmklive\PayPal\Tests\Unit\Client; use GuzzleHttp\Utils; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -14,8 +15,8 @@ class BillingPlansTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_create_a_billing_plan() + #[Test] + public function it_can_create_a_billing_plan(): void { $expectedResponse = $this->mockCreatePlansResponse(); @@ -34,8 +35,8 @@ public function it_can_create_a_billing_plan() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->post($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_list_billing_plans() + #[Test] + public function it_can_list_billing_plans(): void { $expectedResponse = $this->mockListPlansResponse(); @@ -53,8 +54,8 @@ public function it_can_list_billing_plans() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->get($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_update_a_billing_plan() + #[Test] + public function it_can_update_a_billing_plan(): void { $expectedResponse = ''; @@ -73,8 +74,8 @@ public function it_can_update_a_billing_plan() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->patch($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_show_details_for_a_billing_plan() + #[Test] + public function it_can_show_details_for_a_billing_plan(): void { $expectedResponse = $this->mockGetPlansResponse(); @@ -92,8 +93,8 @@ public function it_can_show_details_for_a_billing_plan() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->get($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_activate_a_billing_plan() + #[Test] + public function it_can_activate_a_billing_plan(): void { $expectedResponse = ''; @@ -111,8 +112,8 @@ public function it_can_activate_a_billing_plan() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->post($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_deactivate_a_billing_plan() + #[Test] + public function it_can_deactivate_a_billing_plan(): void { $expectedResponse = ''; @@ -130,8 +131,8 @@ public function it_can_deactivate_a_billing_plan() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->post($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_update_pricing_for_a_billing_plan() + #[Test] + public function it_can_update_pricing_for_a_billing_plan(): void { $expectedResponse = ''; diff --git a/tests/Unit/Client/CatalogProductsTest.php b/tests/Unit/Client/CatalogProductsTest.php index 4cb42e02..c1695847 100644 --- a/tests/Unit/Client/CatalogProductsTest.php +++ b/tests/Unit/Client/CatalogProductsTest.php @@ -3,6 +3,7 @@ namespace Srmklive\PayPal\Tests\Unit\Client; use GuzzleHttp\Utils; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -14,8 +15,8 @@ class CatalogProductsTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_create_a_product() + #[Test] + public function it_can_create_a_product(): void { $expectedResponse = $this->mockCreateCatalogProductsResponse(); @@ -34,8 +35,8 @@ public function it_can_create_a_product() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->post($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_list_products() + #[Test] + public function it_can_list_products(): void { $expectedResponse = $this->mockListCatalogProductsResponse(); @@ -53,8 +54,8 @@ public function it_can_list_products() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->get($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_update_a_product() + #[Test] + public function it_can_update_a_product(): void { $expectedResponse = ''; @@ -73,8 +74,8 @@ public function it_can_update_a_product() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->patch($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_get_details_for_a_product() + #[Test] + public function it_can_get_details_for_a_product(): void { $expectedResponse = $this->mockGetCatalogProductsResponse(); diff --git a/tests/Unit/Client/DisputeActionsTest.php b/tests/Unit/Client/DisputeActionsTest.php index 00b279c2..a14454fb 100644 --- a/tests/Unit/Client/DisputeActionsTest.php +++ b/tests/Unit/Client/DisputeActionsTest.php @@ -3,6 +3,7 @@ namespace Srmklive\PayPal\Tests\Unit\Client; use GuzzleHttp\Utils; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -14,8 +15,8 @@ class DisputeActionsTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_accept_dispute_claim() + #[Test] + public function it_can_accept_dispute_claim(): void { $expectedResponse = $this->mockAcceptDisputesClaimResponse(); @@ -34,8 +35,8 @@ public function it_can_accept_dispute_claim() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->post($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_accept_dispute_offer_resolution() + #[Test] + public function it_can_accept_dispute_offer_resolution(): void { $expectedResponse = $this->mockAcceptDisputesOfferResolutionResponse(); @@ -54,8 +55,8 @@ public function it_can_accept_dispute_offer_resolution() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->post($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_acknowledge_item_is_returned_for_raised_dispute() + #[Test] + public function it_can_acknowledge_item_is_returned_for_raised_dispute(): void { $expectedResponse = $this->mockAcknowledgeItemReturnedResponse(); diff --git a/tests/Unit/Client/DisputesTest.php b/tests/Unit/Client/DisputesTest.php index a0896984..46b7d1cf 100644 --- a/tests/Unit/Client/DisputesTest.php +++ b/tests/Unit/Client/DisputesTest.php @@ -3,6 +3,7 @@ namespace Srmklive\PayPal\Tests\Unit\Client; use GuzzleHttp\Utils; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -14,8 +15,8 @@ class DisputesTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_list_disputes() + #[Test] + public function it_can_list_disputes(): void { $expectedResponse = $this->mockListDisputesResponse(); @@ -33,8 +34,8 @@ public function it_can_list_disputes() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->get($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_partially_update_a_dispute() + #[Test] + public function it_can_partially_update_a_dispute(): void { $expectedResponse = ''; @@ -53,8 +54,8 @@ public function it_can_partially_update_a_dispute() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->patch($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_get_details_for_a_dispute() + #[Test] + public function it_can_get_details_for_a_dispute(): void { $expectedResponse = $this->mockGetDisputesResponse(); diff --git a/tests/Unit/Client/IdentityTest.php b/tests/Unit/Client/IdentityTest.php index bc6c0bb6..805f70cd 100644 --- a/tests/Unit/Client/IdentityTest.php +++ b/tests/Unit/Client/IdentityTest.php @@ -3,6 +3,7 @@ namespace Srmklive\PayPal\Tests\Unit\Client; use GuzzleHttp\Utils; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -14,8 +15,8 @@ class IdentityTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_user_profile_details() + #[Test] + public function it_can_user_profile_details(): void { $expectedResponse = $this->mockShowProfileInfoResponse(); diff --git a/tests/Unit/Client/InvoicesSearchTest.php b/tests/Unit/Client/InvoicesSearchTest.php index 540c0cee..2097404c 100644 --- a/tests/Unit/Client/InvoicesSearchTest.php +++ b/tests/Unit/Client/InvoicesSearchTest.php @@ -3,6 +3,7 @@ namespace Srmklive\PayPal\Tests\Unit\Client; use GuzzleHttp\Utils; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -14,8 +15,8 @@ class InvoicesSearchTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_search_invoices() + #[Test] + public function it_can_search_invoices(): void { $expectedResponse = $this->mockSearchInvoicesResponse(); diff --git a/tests/Unit/Client/InvoicesTemplatesTest.php b/tests/Unit/Client/InvoicesTemplatesTest.php index ae09c0a2..144bcd95 100644 --- a/tests/Unit/Client/InvoicesTemplatesTest.php +++ b/tests/Unit/Client/InvoicesTemplatesTest.php @@ -3,6 +3,7 @@ namespace Srmklive\PayPal\Tests\Unit\Client; use GuzzleHttp\Utils; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -14,8 +15,8 @@ class InvoicesTemplatesTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_create_invoice_template() + #[Test] + public function it_can_create_invoice_template(): void { $expectedResponse = $this->mockCreateInvoiceTemplateResponse(); @@ -34,8 +35,8 @@ public function it_can_create_invoice_template() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->post($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_list_invoice_templates() + #[Test] + public function it_can_list_invoice_templates(): void { $expectedResponse = $this->mockListInvoiceTemplateResponse(); @@ -53,8 +54,8 @@ public function it_can_list_invoice_templates() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->get($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_delete_an_invoice_template() + #[Test] + public function it_can_delete_an_invoice_template(): void { $expectedResponse = ''; @@ -72,8 +73,8 @@ public function it_can_delete_an_invoice_template() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->delete($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_update_an_invoice_template() + #[Test] + public function it_can_update_an_invoice_template(): void { $expectedResponse = $this->mockUpdateInvoiceTemplateResponse(); @@ -92,8 +93,8 @@ public function it_can_update_an_invoice_template() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->put($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_get_details_for_an_invoice_template() + #[Test] + public function it_can_get_details_for_an_invoice_template(): void { $expectedResponse = $this->mockGetInvoiceTemplateResponse(); diff --git a/tests/Unit/Client/InvoicesTest.php b/tests/Unit/Client/InvoicesTest.php index ffaaf18e..9ff17edc 100644 --- a/tests/Unit/Client/InvoicesTest.php +++ b/tests/Unit/Client/InvoicesTest.php @@ -3,6 +3,7 @@ namespace Srmklive\PayPal\Tests\Unit\Client; use GuzzleHttp\Utils; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -14,8 +15,8 @@ class InvoicesTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_generate_unique_invoice_number() + #[Test] + public function it_can_generate_unique_invoice_number(): void { $expectedResponse = $this->mockGenerateInvoiceNumberResponse(); @@ -33,8 +34,8 @@ public function it_can_generate_unique_invoice_number() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->post($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_create_a_draft_invoice() + #[Test] + public function it_can_create_a_draft_invoice(): void { $expectedResponse = $this->mockCreateInvoicesResponse(); @@ -53,8 +54,8 @@ public function it_can_create_a_draft_invoice() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->post($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_list_current_invoices() + #[Test] + public function it_can_list_current_invoices(): void { $expectedResponse = $this->mockListInvoicesResponse(); @@ -72,8 +73,8 @@ public function it_can_list_current_invoices() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->get($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_delete_an_invoice() + #[Test] + public function it_can_delete_an_invoice(): void { $expectedResponse = ''; @@ -91,8 +92,8 @@ public function it_can_delete_an_invoice() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->delete($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_update_an_invoice() + #[Test] + public function it_can_update_an_invoice(): void { $expectedResponse = $this->mockUpdateInvoicesResponse(); @@ -111,8 +112,8 @@ public function it_can_update_an_invoice() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->put($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_show_details_for_an_invoice() + #[Test] + public function it_can_show_details_for_an_invoice(): void { $expectedResponse = $this->mockGetInvoicesResponse(); @@ -130,8 +131,8 @@ public function it_can_show_details_for_an_invoice() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->get($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_cancel_an_invoice() + #[Test] + public function it_can_cancel_an_invoice(): void { $expectedResponse = ''; @@ -150,8 +151,8 @@ public function it_can_cancel_an_invoice() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->post($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_generate_qr_code_for_invoice() + #[Test] + public function it_can_generate_qr_code_for_invoice(): void { $expectedResponse = $this->mockGenerateInvoiceNumberResponse(); @@ -170,8 +171,8 @@ public function it_can_generate_qr_code_for_invoice() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->post($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_register_payment_for_invoice() + #[Test] + public function it_can_register_payment_for_invoice(): void { $expectedResponse = $this->mockInvoiceRegisterPaymentResponse(); @@ -190,8 +191,8 @@ public function it_can_register_payment_for_invoice() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->post($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_delete_payment_for_invoice() + #[Test] + public function it_can_delete_payment_for_invoice(): void { $expectedResponse = ''; @@ -209,8 +210,8 @@ public function it_can_delete_payment_for_invoice() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->delete($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_refund_payment_for_invoice() + #[Test] + public function it_can_refund_payment_for_invoice(): void { $expectedResponse = $this->mockInvoiceRefundPaymentResponse(); @@ -229,8 +230,8 @@ public function it_can_refund_payment_for_invoice() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->post($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_delete_refund_for_invoice() + #[Test] + public function it_can_delete_refund_for_invoice(): void { $expectedResponse = ''; @@ -248,8 +249,8 @@ public function it_can_delete_refund_for_invoice() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->delete($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_send_an_invoice() + #[Test] + public function it_can_send_an_invoice(): void { $expectedResponse = ''; @@ -268,8 +269,8 @@ public function it_can_send_an_invoice() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->post($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_send_reminder_for_an_invoice() + #[Test] + public function it_can_send_reminder_for_an_invoice(): void { $expectedResponse = ''; diff --git a/tests/Unit/Client/OrdersTest.php b/tests/Unit/Client/OrdersTest.php index fccb25ab..b8ff33b8 100644 --- a/tests/Unit/Client/OrdersTest.php +++ b/tests/Unit/Client/OrdersTest.php @@ -3,6 +3,7 @@ namespace Srmklive\PayPal\Tests\Unit\Client; use GuzzleHttp\Utils; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -14,8 +15,8 @@ class OrdersTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_create_an_order() + #[Test] + public function it_can_create_an_order(): void { $expectedResponse = $this->mockCreateOrdersResponse(); diff --git a/tests/Unit/Client/PartnerReferralsTest.php b/tests/Unit/Client/PartnerReferralsTest.php index 1d1f284d..6e961a0a 100644 --- a/tests/Unit/Client/PartnerReferralsTest.php +++ b/tests/Unit/Client/PartnerReferralsTest.php @@ -3,6 +3,7 @@ namespace Srmklive\PayPal\Tests\Unit\Client; use GuzzleHttp\Utils; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -14,8 +15,8 @@ class PartnerReferralsTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_create_partner_referral() + #[Test] + public function it_can_create_partner_referral(): void { $expectedResponse = $this->mockCreatePartnerReferralsResponse(); @@ -34,8 +35,8 @@ public function it_can_create_partner_referral() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->post($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_get_referral_details() + #[Test] + public function it_can_get_referral_details(): void { $expectedResponse = $this->mockShowReferralDataResponse(); diff --git a/tests/Unit/Client/PaymentAuthorizationsTest.php b/tests/Unit/Client/PaymentAuthorizationsTest.php index 02b6e4f3..a151ed9b 100644 --- a/tests/Unit/Client/PaymentAuthorizationsTest.php +++ b/tests/Unit/Client/PaymentAuthorizationsTest.php @@ -3,6 +3,7 @@ namespace Srmklive\PayPal\Tests\Unit\Client; use GuzzleHttp\Utils; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -14,8 +15,8 @@ class PaymentAuthorizationsTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_show_details_for_an_authorized_payment() + #[Test] + public function it_can_show_details_for_an_authorized_payment(): void { $expectedResponse = $this->mockGetAuthorizedPaymentDetailsResponse(); @@ -33,8 +34,8 @@ public function it_can_show_details_for_an_authorized_payment() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->get($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_capture_an_authorized_payment() + #[Test] + public function it_can_capture_an_authorized_payment(): void { $expectedResponse = $this->mockCaptureAuthorizedPaymentResponse(); @@ -53,8 +54,8 @@ public function it_can_capture_an_authorized_payment() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->post($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_reauthorize_an_authorized_payment() + #[Test] + public function it_can_reauthorize_an_authorized_payment(): void { $expectedResponse = $this->mockReAuthorizeAuthorizedPaymentResponse(); @@ -73,8 +74,8 @@ public function it_can_reauthorize_an_authorized_payment() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->post($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_void_an_authorized_payment() + #[Test] + public function it_can_void_an_authorized_payment(): void { $expectedResponse = ''; diff --git a/tests/Unit/Client/PaymentCapturesTest.php b/tests/Unit/Client/PaymentCapturesTest.php index 9f28d79b..b8b58bda 100644 --- a/tests/Unit/Client/PaymentCapturesTest.php +++ b/tests/Unit/Client/PaymentCapturesTest.php @@ -3,6 +3,7 @@ namespace Srmklive\PayPal\Tests\Unit\Client; use GuzzleHttp\Utils; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -14,8 +15,8 @@ class PaymentCapturesTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_show_details_for_a_captured_payment() + #[Test] + public function it_can_show_details_for_a_captured_payment(): void { $expectedResponse = $this->mockGetCapturedPaymentDetailsResponse(); @@ -33,8 +34,8 @@ public function it_can_show_details_for_a_captured_payment() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->get($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_refund_a_captured_payment() + #[Test] + public function it_can_refund_a_captured_payment(): void { $expectedResponse = $this->mockRefundCapturedPaymentResponse(); diff --git a/tests/Unit/Client/PaymentExperienceWebProfilesTest.php b/tests/Unit/Client/PaymentExperienceWebProfilesTest.php index 26ebf5be..0f31fe6a 100644 --- a/tests/Unit/Client/PaymentExperienceWebProfilesTest.php +++ b/tests/Unit/Client/PaymentExperienceWebProfilesTest.php @@ -3,6 +3,7 @@ namespace Srmklive\PayPal\Tests\Unit\Client; use GuzzleHttp\Utils; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -14,8 +15,8 @@ class PaymentExperienceWebProfilesTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_list_web_experience_profiles() + #[Test] + public function it_can_list_web_experience_profiles(): void { $expectedResponse = $this->mockListWebProfilesResponse(); @@ -33,8 +34,8 @@ public function it_can_list_web_experience_profiles() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->get($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_create_web_experience_profile() + #[Test] + public function it_can_create_web_experience_profile(): void { $expectedResponse = $this->mockWebProfileResponse(); @@ -54,8 +55,8 @@ public function it_can_create_web_experience_profile() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->post($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_delete_web_experience_profile() + #[Test] + public function it_can_delete_web_experience_profile(): void { $expectedResponse = ''; @@ -73,8 +74,8 @@ public function it_can_delete_web_experience_profile() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->delete($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_partially_update_web_experience_profile() + #[Test] + public function it_can_partially_update_web_experience_profile(): void { $expectedResponse = ''; @@ -93,8 +94,8 @@ public function it_can_partially_update_web_experience_profile() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->patch($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_fully_update_web_experience_profile() + #[Test] + public function it_can_fully_update_web_experience_profile(): void { $expectedResponse = ''; @@ -113,8 +114,8 @@ public function it_can_fully_update_web_experience_profile() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->patch($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_get_web_experience_profile_details() + #[Test] + public function it_can_get_web_experience_profile_details(): void { $expectedResponse = $this->mockWebProfileResponse(); diff --git a/tests/Unit/Client/PaymentRefundsTest.php b/tests/Unit/Client/PaymentRefundsTest.php index 073bee7b..fcbe3375 100644 --- a/tests/Unit/Client/PaymentRefundsTest.php +++ b/tests/Unit/Client/PaymentRefundsTest.php @@ -3,6 +3,7 @@ namespace Srmklive\PayPal\Tests\Unit\Client; use GuzzleHttp\Utils; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockResponsePayloads; @@ -12,8 +13,8 @@ class PaymentRefundsTest extends TestCase use MockClientClasses; use MockResponsePayloads; - /** @test */ - public function it_can_show_details_for_a_refund() + #[Test] + public function it_can_show_details_for_a_refund(): void { $expectedResponse = $this->mockGetRefundDetailsResponse(); diff --git a/tests/Unit/Client/PayoutsTest.php b/tests/Unit/Client/PayoutsTest.php index 6413fa5f..5678c44b 100644 --- a/tests/Unit/Client/PayoutsTest.php +++ b/tests/Unit/Client/PayoutsTest.php @@ -3,6 +3,7 @@ namespace Srmklive\PayPal\Tests\Unit\Client; use GuzzleHttp\Utils; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -14,8 +15,8 @@ class PayoutsTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_create_batch_payout() + #[Test] + public function it_can_create_batch_payout(): void { $expectedResponse = $this->mockCreateBatchPayoutResponse(); @@ -34,8 +35,8 @@ public function it_can_create_batch_payout() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->post($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_show_batch_payout_details() + #[Test] + public function it_can_show_batch_payout_details(): void { $expectedResponse = $this->showBatchPayoutResponse(); @@ -53,8 +54,8 @@ public function it_can_show_batch_payout_details() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->get($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_show_batch_payout_item_details() + #[Test] + public function it_can_show_batch_payout_item_details(): void { $expectedResponse = $this->showBatchPayoutItemResponse(); @@ -72,8 +73,8 @@ public function it_can_show_batch_payout_item_details() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->get($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_cancel_unclaimed_batch_payout_item() + #[Test] + public function it_can_cancel_unclaimed_batch_payout_item(): void { $expectedResponse = $this->mockCancelUnclaimedBatchItemResponse(); diff --git a/tests/Unit/Client/ReferencedPayoutsTest.php b/tests/Unit/Client/ReferencedPayoutsTest.php index ff11d2a4..17995ac2 100644 --- a/tests/Unit/Client/ReferencedPayoutsTest.php +++ b/tests/Unit/Client/ReferencedPayoutsTest.php @@ -3,6 +3,7 @@ namespace Srmklive\PayPal\Tests\Unit\Client; use GuzzleHttp\Utils; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -14,8 +15,8 @@ class ReferencedPayoutsTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_create_referenced_batch_payout() + #[Test] + public function it_can_create_referenced_batch_payout(): void { $expectedResponse = $this->mockCreateReferencedBatchPayoutResponse(); @@ -36,8 +37,8 @@ public function it_can_create_referenced_batch_payout() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->post($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_list_items_referenced_in_batch_payout() + #[Test] + public function it_can_list_items_referenced_in_batch_payout(): void { $expectedResponse = $this->mockShowReferencedBatchPayoutResponse(); @@ -55,8 +56,8 @@ public function it_can_list_items_referenced_in_batch_payout() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->get($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_create_referenced_batch_payout_item() + #[Test] + public function it_can_create_referenced_batch_payout_item(): void { $expectedResponse = $this->mockCreateReferencedBatchPayoutItemResponse(); @@ -77,8 +78,8 @@ public function it_can_create_referenced_batch_payout_item() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->post($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_show_referenced_payout_item_details() + #[Test] + public function it_can_show_referenced_payout_item_details(): void { $expectedResponse = $this->mockShowReferencedBatchPayoutItemResponse(); diff --git a/tests/Unit/Client/ReportingTest.php b/tests/Unit/Client/ReportingTest.php index 5f37945d..80597a16 100644 --- a/tests/Unit/Client/ReportingTest.php +++ b/tests/Unit/Client/ReportingTest.php @@ -3,6 +3,7 @@ namespace Srmklive\PayPal\Tests\Unit\Client; use GuzzleHttp\Utils; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -14,8 +15,8 @@ class ReportingTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_list_transactions() + #[Test] + public function it_can_list_transactions(): void { $expectedResponse = $this->mockListTransactionsResponse(); @@ -34,8 +35,8 @@ public function it_can_list_transactions() $this->assertArrayHasKey('transaction_details', Utils::jsonDecode($mockResponse, true)); } - /** @test */ - public function it_can_list_balances() + #[Test] + public function it_can_list_balances(): void { $expectedResponse = $this->mockListBalancesResponse(); diff --git a/tests/Unit/Client/SubscriptionsTest.php b/tests/Unit/Client/SubscriptionsTest.php index eadd9887..dc8264fc 100644 --- a/tests/Unit/Client/SubscriptionsTest.php +++ b/tests/Unit/Client/SubscriptionsTest.php @@ -3,6 +3,7 @@ namespace Srmklive\PayPal\Tests\Unit\Client; use GuzzleHttp\Utils; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -14,8 +15,8 @@ class SubscriptionsTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_create_a_subscription() + #[Test] + public function it_can_create_a_subscription(): void { $expectedResponse = $this->mockCreateSubscriptionResponse(); @@ -34,8 +35,8 @@ public function it_can_create_a_subscription() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->post($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_update_a_subscription() + #[Test] + public function it_can_update_a_subscription(): void { $expectedResponse = ''; @@ -54,8 +55,8 @@ public function it_can_update_a_subscription() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->patch($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_show_details_for_a_subscription() + #[Test] + public function it_can_show_details_for_a_subscription(): void { $expectedResponse = $this->mockGetSubscriptionDetailsResponse(); @@ -73,8 +74,8 @@ public function it_can_show_details_for_a_subscription() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->get($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_activate_a_subscription() + #[Test] + public function it_can_activate_a_subscription(): void { $expectedResponse = ''; @@ -93,8 +94,8 @@ public function it_can_activate_a_subscription() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->post($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_cancel_a_subscription() + #[Test] + public function it_can_cancel_a_subscription(): void { $expectedResponse = ''; @@ -113,8 +114,8 @@ public function it_can_cancel_a_subscription() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->post($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_suspend_a_subscription() + #[Test] + public function it_can_suspend_a_subscription(): void { $expectedResponse = ''; @@ -133,8 +134,8 @@ public function it_can_suspend_a_subscription() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->post($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_capture_payment_for_a_subscription() + #[Test] + public function it_can_capture_payment_for_a_subscription(): void { $expectedResponse = ''; @@ -153,8 +154,8 @@ public function it_can_capture_payment_for_a_subscription() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->post($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_update_quantity_or_product_for_a_subscription() + #[Test] + public function it_can_update_quantity_or_product_for_a_subscription(): void { $expectedResponse = $this->mockUpdateSubscriptionItemsResponse(); @@ -173,8 +174,8 @@ public function it_can_update_quantity_or_product_for_a_subscription() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->post($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_list_transactions_for_a_subscription() + #[Test] + public function it_can_list_transactions_for_a_subscription(): void { $expectedResponse = $this->mockListSubscriptionTransactionsResponse(); diff --git a/tests/Unit/Client/TrackersTest.php b/tests/Unit/Client/TrackersTest.php index 6f85fec1..1862fa14 100644 --- a/tests/Unit/Client/TrackersTest.php +++ b/tests/Unit/Client/TrackersTest.php @@ -3,6 +3,7 @@ namespace Srmklive\PayPal\Tests\Unit\Client; use GuzzleHttp\Utils; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -14,8 +15,8 @@ class TrackersTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_get_tracking_details_for_tracking_id() + #[Test] + public function it_can_get_tracking_details_for_tracking_id(): void { $expectedResponse = $this->mockGetTrackingDetailsResponse(); @@ -33,8 +34,8 @@ public function it_can_get_tracking_details_for_tracking_id() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->get($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_update_tracking_details_for_tracking_id() + #[Test] + public function it_can_update_tracking_details_for_tracking_id(): void { $expectedResponse = ''; @@ -53,8 +54,8 @@ public function it_can_update_tracking_details_for_tracking_id() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->put($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_create_tracking_in_batches() + #[Test] + public function it_can_create_tracking_in_batches(): void { $expectedResponse = $this->mockCreateTrackinginBatchesResponse(); diff --git a/tests/Unit/Client/WebHooksEventsTest.php b/tests/Unit/Client/WebHooksEventsTest.php index 38e42c3c..e861e5a4 100644 --- a/tests/Unit/Client/WebHooksEventsTest.php +++ b/tests/Unit/Client/WebHooksEventsTest.php @@ -3,6 +3,7 @@ namespace Srmklive\PayPal\Tests\Unit\Client; use GuzzleHttp\Utils; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -14,8 +15,8 @@ class WebHooksEventsTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_list_web_hooks_event_types() + #[Test] + public function it_can_list_web_hooks_event_types(): void { $expectedResponse = $this->mockListWebHookEventsTypesResponse(); @@ -33,8 +34,8 @@ public function it_can_list_web_hooks_event_types() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->get($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_list_web_hooks_events() + #[Test] + public function it_can_list_web_hooks_events(): void { $expectedResponse = $this->mockWebHookEventsListResponse(); @@ -52,8 +53,8 @@ public function it_can_list_web_hooks_events() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->get($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_show_details_for_a_web_hooks_event() + #[Test] + public function it_can_show_details_for_a_web_hooks_event(): void { $expectedResponse = $this->mockGetWebHookEventResponse(); @@ -71,8 +72,8 @@ public function it_can_show_details_for_a_web_hooks_event() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->get($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_resend_notification_for_a_web_hooks_event() + #[Test] + public function it_can_resend_notification_for_a_web_hooks_event(): void { $expectedResponse = $this->mockResendWebHookEventNotificationResponse(); diff --git a/tests/Unit/Client/WebHooksTest.php b/tests/Unit/Client/WebHooksTest.php index 8a08b235..9f52a48c 100644 --- a/tests/Unit/Client/WebHooksTest.php +++ b/tests/Unit/Client/WebHooksTest.php @@ -3,6 +3,7 @@ namespace Srmklive\PayPal\Tests\Unit\Client; use GuzzleHttp\Utils; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -14,8 +15,8 @@ class WebHooksTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_create_a_web_hook() + #[Test] + public function it_can_create_a_web_hook(): void { $expectedResponse = $this->mockCreateWebHookResponse(); @@ -34,8 +35,8 @@ public function it_can_create_a_web_hook() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->post($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_list_web_hooks() + #[Test] + public function it_can_list_web_hooks(): void { $expectedResponse = $this->mockListWebHookResponse(); @@ -53,8 +54,8 @@ public function it_can_list_web_hooks() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->get($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_delete_a_web_hook() + #[Test] + public function it_can_delete_a_web_hook(): void { $expectedResponse = ''; @@ -72,8 +73,8 @@ public function it_can_delete_a_web_hook() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->delete($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_update_a_web_hook() + #[Test] + public function it_can_update_a_web_hook(): void { $expectedResponse = $this->mockUpdateWebHookResponse(); @@ -92,8 +93,8 @@ public function it_can_update_a_web_hook() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->patch($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_show_details_for_a_web_hook() + #[Test] + public function it_can_show_details_for_a_web_hook(): void { $expectedResponse = $this->mockGetWebHookResponse(); @@ -111,8 +112,8 @@ public function it_can_show_details_for_a_web_hook() $this->assertEquals($expectedResponse, Utils::jsonDecode($mockHttpClient->get($expectedEndpoint, $expectedParams)->getBody(), true)); } - /** @test */ - public function it_can_list_web_hooks_events() + #[Test] + public function it_can_list_web_hooks_events(): void { $expectedResponse = $this->mockListWebHookEventsResponse(); diff --git a/tests/Unit/Client/WebHooksVerificationTest.php b/tests/Unit/Client/WebHooksVerificationTest.php index d888ccc1..84cbc722 100644 --- a/tests/Unit/Client/WebHooksVerificationTest.php +++ b/tests/Unit/Client/WebHooksVerificationTest.php @@ -3,6 +3,7 @@ namespace Srmklive\PayPal\Tests\Unit\Client; use GuzzleHttp\Utils; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockRequestPayloads; @@ -14,8 +15,8 @@ class WebHooksVerificationTest extends TestCase use MockRequestPayloads; use MockResponsePayloads; - /** @test */ - public function it_can_verify_web_hook_signature() + #[Test] + public function it_can_verify_web_hook_signature(): void { $expectedResponse = $this->mockVerifyWebHookSignatureResponse(); diff --git a/tests/Unit/ClientTest.php b/tests/Unit/ClientTest.php index c44c700d..be60255c 100644 --- a/tests/Unit/ClientTest.php +++ b/tests/Unit/ClientTest.php @@ -4,6 +4,7 @@ use GuzzleHttp\Client as HttpClient; use GuzzleHttp\Utils; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Srmklive\PayPal\Tests\MockClientClasses; use Srmklive\PayPal\Tests\MockResponsePayloads; @@ -13,15 +14,15 @@ class ClientTest extends TestCase use MockClientClasses; use MockResponsePayloads; - /** @test */ - public function it_can_be_instantiated() + #[Test] + public function it_can_be_instantiated(): void { $client = new HttpClient(); $this->assertInstanceOf(HttpClient::class, $client); } - /** @test */ - public function it_can_get_access_token() + #[Test] + public function it_can_get_access_token(): void { $expectedResponse = $this->mockAccessTokenResponse();