2026-04-14 21:44:47 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
use App\Features\SocialAccountLimit;
|
2026-04-15 01:22:04 +00:00
|
|
|
use App\Models\Account;
|
2026-04-14 21:44:47 +00:00
|
|
|
use App\Models\Plan;
|
|
|
|
|
|
|
|
|
|
test('returns plan social account limit', function () {
|
|
|
|
|
$plan = new Plan(['social_account_limit' => 30]);
|
2026-04-15 01:22:04 +00:00
|
|
|
$account = new Account;
|
|
|
|
|
$account->setRelation('plan', $plan);
|
2026-04-14 21:44:47 +00:00
|
|
|
|
2026-04-15 01:22:04 +00:00
|
|
|
expect((new SocialAccountLimit)->resolve($account))->toBe(30);
|
2026-04-14 21:44:47 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('falls back to 5 when no plan', function () {
|
2026-04-15 01:22:04 +00:00
|
|
|
$account = new Account;
|
|
|
|
|
$account->setRelation('plan', null);
|
2026-04-14 21:44:47 +00:00
|
|
|
|
2026-04-15 01:22:04 +00:00
|
|
|
expect((new SocialAccountLimit)->resolve($account))->toBe(5);
|
2026-04-14 21:44:47 +00:00
|
|
|
});
|