From 857cdab89b3b6395825f25554db71fed15847984 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rio=20Lucas?= Date: Thu, 27 Feb 2025 10:28:43 -0300 Subject: [PATCH] wip(tests): adding pest tests --- tests/AsaasGatewayTest.php | 29 +++++++++++++++++++++++++++++ tests/EfiGatewayTest.php | 14 ++++++++++++++ tests/PHPayTest.php | 21 +++++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 tests/AsaasGatewayTest.php create mode 100644 tests/EfiGatewayTest.php create mode 100644 tests/PHPayTest.php diff --git a/tests/AsaasGatewayTest.php b/tests/AsaasGatewayTest.php new file mode 100644 index 0000000..247c9ff --- /dev/null +++ b/tests/AsaasGatewayTest.php @@ -0,0 +1,29 @@ +toBe(true); + + expect($asaas) + ->toImplement(\PHPay\Contracts\GatewayInterface::class); + + expect($asaas) + ->toImplement(\PHPay\Asaas\Interface\AsaasGatewayInterface::class); + + $assasInstance = new $phpay(new $asaas('token-here')); + + expect($assasInstance->customer([])) + ->toBeObject() + ->toBeInstanceOf(\PHPay\Asaas\Resources\Customer\Customer::class); + + expect($assasInstance->charge()) + ->toBeObject() + ->toBeInstanceOf(\PHPay\Asaas\Resources\Charge\Charge::class); + + expect($assasInstance->webhook()) + ->toBeObject() + ->toBeInstanceOf(\PHPay\Asaas\Resources\Webhook\Webhook::class); +})->group('asaas'); diff --git a/tests/EfiGatewayTest.php b/tests/EfiGatewayTest.php new file mode 100644 index 0000000..9e96f90 --- /dev/null +++ b/tests/EfiGatewayTest.php @@ -0,0 +1,14 @@ +toBe(true); + + expect($efi) + ->toImplement(\PHPay\Contracts\GatewayInterface::class); + + expect($efi) + ->toImplement(\Efi\Interface\EfiGatewayInterface::class); +})->group('efi'); diff --git a/tests/PHPayTest.php b/tests/PHPayTest.php new file mode 100644 index 0000000..c2c36ed --- /dev/null +++ b/tests/PHPayTest.php @@ -0,0 +1,21 @@ +toBe(true); + + expect($phpay) + ->toImplement(\PHPay\Contracts\GatewayInterface::class); + + expect($phpay)->hasMethod('__construct'); + expect($phpay)->hasMethod('customer'); + expect($phpay)->hasMethod('charge'); + expect($phpay)->hasMethod('webhook'); + expect($phpay)->hasMethod('pix'); +})->group('phpay');