feat(billing): renewals, coupons, VAT numbering, billing cycles and invoice payment tracking
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
ea9a53f742
commit
25f23d541e
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Helpers\OrderHelper;
|
||||
use App\Support\BillingCycleCatalog;
|
||||
use App\Support\ProductBillingCycles;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class CustomBillingCycleTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_custom_cycle_is_resolved_end_to_end(): void
|
||||
{
|
||||
$this->assertSame([], BillingCycleCatalog::customMonths());
|
||||
|
||||
BillingCycleCatalog::saveCustomMonths([60, 12, 60, 0, 9999]);
|
||||
|
||||
$this->assertSame([60], BillingCycleCatalog::customMonths());
|
||||
$this->assertContains('months_60', BillingCycleCatalog::codes());
|
||||
$this->assertSame(60, OrderHelper::cycleToMonths('months_60'));
|
||||
$this->assertSame('5 năm', BillingCycleCatalog::labelForCode('months_60'));
|
||||
$this->assertContains('months_60', ProductBillingCycles::forType('vps'));
|
||||
$this->assertSame(['annually'], ProductBillingCycles::forType('domain'));
|
||||
}
|
||||
|
||||
public function test_unknown_code_is_rejected(): void
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
OrderHelper::cycleToMonths('months_x');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user