mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-09-03 19:24:59 +02:00
57 lines
1.2 KiB
PHP
57 lines
1.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Unit\Models\Billing;
|
|
|
|
use App\Enums\Models\Billing\BalanceFrequency;
|
|
use App\Enums\Models\Billing\Service;
|
|
use App\Models\Billing\Balance;
|
|
use Tests\TestCase;
|
|
|
|
/**
|
|
* Class BalanceTest.
|
|
*/
|
|
class BalanceTest extends TestCase
|
|
{
|
|
/**
|
|
* The service attribute of a balance shall be cast to a Service enum instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function testCastsServiceToEnum(): void
|
|
{
|
|
$balance = Balance::factory()->createOne();
|
|
|
|
$service = $balance->service;
|
|
|
|
static::assertInstanceOf(Service::class, $service);
|
|
}
|
|
|
|
/**
|
|
* The frequency attribute of a balance shall be cast to a Frequency enum instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function testCastsFrequencyToEnum(): void
|
|
{
|
|
$balance = Balance::factory()->createOne();
|
|
|
|
$frequency = $balance->frequency;
|
|
|
|
static::assertInstanceOf(BalanceFrequency::class, $frequency);
|
|
}
|
|
|
|
/**
|
|
* Balances shall be nameable.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function testNameable(): void
|
|
{
|
|
$balance = Balance::factory()->createOne();
|
|
|
|
static::assertIsString($balance->getName());
|
|
}
|
|
}
|