39 lines
824 B
PHP
39 lines
824 B
PHP
<?php
|
|
|
|
namespace Tests\Unit\Models;
|
|
|
|
use App\Features\Games\Models\Game;
|
|
use App\Features\Games\Models\RomFile;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use PHPUnit\Framework\Attributes\Test;
|
|
use Tests\TestCase;
|
|
|
|
class RomFileTest extends TestCase
|
|
{
|
|
use RefreshDatabase;
|
|
|
|
#[Test]
|
|
public function it_belongs_to_a_game(): void
|
|
{
|
|
$romFile = RomFile::factory()->create();
|
|
|
|
$this->assertInstanceOf(Game::class, $romFile->game);
|
|
}
|
|
|
|
#[Test]
|
|
public function it_has_fillable_attributes(): void
|
|
{
|
|
$romFile = new RomFile();
|
|
|
|
$this->assertEquals([
|
|
'game_id',
|
|
'file_path',
|
|
'file_name',
|
|
'file_size',
|
|
'file_hash',
|
|
'region',
|
|
'language',
|
|
], $romFile->getFillable());
|
|
}
|
|
}
|