update tests

This commit is contained in:
root
2026-06-08 22:06:30 -04:00
parent 79024235ef
commit 60ecacb7f8
54 changed files with 13243 additions and 5561 deletions
@@ -2,6 +2,7 @@
namespace Tests\Unit\Services\Payments;
use App\Services\ApplicationUrlService;
use App\Services\Payments\PaypalPaymentService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
@@ -11,6 +12,11 @@ class PaypalPaymentServiceTest extends TestCase
{
use RefreshDatabase;
private function makeService(): PaypalPaymentService
{
return new PaypalPaymentService(new ApplicationUrlService());
}
public function test_create_payment_falls_back_to_hosted_when_sdk_missing(): void
{
DB::table('payments')->insert([
@@ -27,7 +33,7 @@ class PaypalPaymentServiceTest extends TestCase
'status' => 'Pending',
]);
$service = new PaypalPaymentService();
$service = $this->makeService();
$result = $service->createPayment(1);
$this->assertSame('hosted', $result['mode']);
@@ -36,7 +42,7 @@ class PaypalPaymentServiceTest extends TestCase
public function test_execute_payment_throws_when_sdk_missing(): void
{
$service = new PaypalPaymentService();
$service = $this->makeService();
$this->expectException(\RuntimeException::class);