28 lines
824 B
PHP
28 lines
824 B
PHP
<?php
|
|
|
|
namespace Tests\Feature\Api\Tenant;
|
|
|
|
use App\Models\Package;
|
|
use App\Models\PackagePurchase;
|
|
use Tests\Feature\Tenant\TenantTestCase;
|
|
|
|
class BillingReceiptTest extends TenantTestCase
|
|
{
|
|
public function test_receipt_endpoint_returns_pdf(): void
|
|
{
|
|
$package = Package::factory()->create(['name' => 'Starter']);
|
|
$purchase = PackagePurchase::factory()->create([
|
|
'tenant_id' => $this->tenant->id,
|
|
'package_id' => $package->id,
|
|
'provider' => 'paypal',
|
|
'provider_id' => 'ORDER-123',
|
|
'price' => 49.0,
|
|
]);
|
|
|
|
$response = $this->authenticatedRequest('GET', '/api/v1/tenant/billing/transactions/'.$purchase->id.'/receipt');
|
|
|
|
$response->assertOk();
|
|
$response->assertHeader('Content-Type', 'application/pdf');
|
|
}
|
|
}
|