fix(models): correct UserSetting import namespace and add test coverage
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?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());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user