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 @@ +<?php + +test('boot asaas gateway class', function () { + $phpay = \PHPay\PHPay::class; + $asaas = \PHPay\Asaas\AsaasGateway::class; + + expect(class_exists($asaas)) + ->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 @@ +<?php + +test('boot efi gateway class', function () { + $efi = PHPay\Efi\EfiGateway::class; + + expect(class_exists($efi)) + ->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 @@ +<?php + +use PHPay\Asaas\AsaasGateway; +use PHPay\Efi\EfiGateway; +use PHPay\PHPay; + +test('boot phpay class', function () { + $phpay = PHPay::class; + + expect(class_exists($phpay)) + ->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');