diff --git a/tests/OrderBuilderTest.php b/tests/OrderBuilderTest.php index 2ed227d..cea6f00 100644 --- a/tests/OrderBuilderTest.php +++ b/tests/OrderBuilderTest.php @@ -2,12 +2,13 @@ namespace Tests; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Puntodev\Payments\OrderBuilder; class OrderBuilderTest extends TestCase { - /** @test */ + #[Test] public function create_order_with_int_amount() { $order = (new OrderBuilder()) diff --git a/tests/PayPalApiTest.php b/tests/PayPalApiTest.php index 3a5c435..f1c2fa7 100644 --- a/tests/PayPalApiTest.php +++ b/tests/PayPalApiTest.php @@ -6,6 +6,7 @@ use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Http\Client\RequestException; use Illuminate\Support\Facades\Log; +use PHPUnit\Framework\Attributes\Test; use Puntodev\Payments\OrderBuilder; use Puntodev\Payments\PayPalApi; @@ -32,7 +33,8 @@ protected function getEnvironmentSetUp($app) $app['config']->set('paypal.use_sandbox', env('SANDBOX_GATEWAYS')); } - public function testVerifyIpn() + #[Test] + public function verify_ipn() { $this->assertEquals('INVALID', $this->paypalApi->verifyIpn('saraza')); } @@ -41,7 +43,8 @@ public function testVerifyIpn() * @return void * @throws RequestException */ - public function testCreateOrder() + #[Test] + public function create_order() { $order = (new OrderBuilder()) ->externalId($this->faker->uuid) @@ -66,11 +69,13 @@ public function testCreateOrder() $this->assertStringStartsWith('https://www.sandbox.paypal.com/checkoutnow', $link['href']); } + /** * @return void * @throws Exception */ - public function testFindOrderByIdInvalid() + #[Test] + public function find_order_by_id_invalid() { $this->expectException(RequestException::class); $this->paypalApi->findOrderById('invalid-id'); @@ -80,7 +85,8 @@ public function testFindOrderByIdInvalid() * @return void * @throws Exception */ - public function testFindOrderById() + #[Test] + public function find_order_by_id() { $payment = $this->paypalApi->findOrderById('5KX43952KL513742C'); $this->assertIsArray($payment); @@ -90,7 +96,8 @@ public function testFindOrderById() * @return void * @throws Exception */ - public function testCaptureOrder() + #[Test] + public function capture_order() { $this->expectException(RequestException::class); diff --git a/tests/PaypalTest.php b/tests/PaypalTest.php index 8935401..6fcbc6b 100644 --- a/tests/PaypalTest.php +++ b/tests/PaypalTest.php @@ -2,19 +2,20 @@ namespace Tests; +use PHPUnit\Framework\Attributes\Test; use Puntodev\Payments\PayPal; use Puntodev\Payments\PayPalApi; class PaypalTest extends TestCase { - protected function getEnvironmentSetUp($app) + protected function getEnvironmentSetUp($app): void { $app['config']->set('paypal.client_id', 'PAYPAL_ID'); $app['config']->set('paypal.client_secret', 'PAYPAL_SECRET'); $app['config']->set('paypal.use_sandbox', 'true'); } - /** @test */ + #[Test] public function default_client() { /** @var PayPal $paypal */ @@ -25,7 +26,7 @@ public function default_client() $this->assertInstanceOf(PayPalApi::class, $client); } - /** @test */ + #[Test] public function with_credentials() { /** @var PayPal $paypal */ diff --git a/tests/TestCase.php b/tests/TestCase.php index efb5257..beafb83 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -7,7 +7,7 @@ abstract class TestCase extends Orchestra { - protected function getPackageProviders($app) + protected function getPackageProviders($app): array { return [ PayPalServiceProvider::class