Files
ladill-meet/tests/Unit/MeetBillingServiceTest.php
T
isaaccladandCursor d0a3361f37
Deploy Ladill Meet / deploy (push) Successful in 41s
Separate webinars from meetings and add conference billing.
Add restart meeting actions, a dedicated webinar sidebar flow billed at GHS 0.30 per participant, and reserve speaker-line space with a placeholder to prevent layout shift.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-01 18:23:04 +00:00

53 lines
1.5 KiB
PHP

<?php
namespace Tests\Unit;
use App\Models\Session;
use App\Services\Meet\MeetBillingService;
use Tests\TestCase;
class MeetBillingServiceTest extends TestCase
{
public function test_streaming_hours_are_ceiled_with_minimum_one_hour(): void
{
$billing = app(MeetBillingService::class);
$session = new Session([
'started_at' => now()->subMinutes(10),
'ended_at' => now(),
]);
$this->assertSame(1.0, $billing->streamingHoursFor($session));
}
public function test_streaming_amount_minor_matches_hourly_rate(): void
{
config(['meet.billing.price_per_hour_ghs' => 0.30]);
$billing = app(MeetBillingService::class);
$this->assertSame(30, $billing->amountMinorForStreamingHours(1));
$this->assertSame(60, $billing->amountMinorForStreamingHours(2));
}
public function test_participant_amount_minor_matches_rate(): void
{
config(['meet.billing.price_per_participant_ghs' => 0.30]);
$billing = app(MeetBillingService::class);
$this->assertSame(30, $billing->amountMinorForParticipants(1));
$this->assertSame(90, $billing->amountMinorForParticipants(3));
}
public function test_storage_amount_minor_matches_gb_monthly_rate(): void
{
config(['meet.billing.price_per_gb_month_ghs' => 0.30]);
$billing = app(MeetBillingService::class);
$oneGb = 1073741824;
$this->assertSame(30, $billing->amountMinorForStorageBytes($oneGb));
}
}