create(); Game::factory()->count(3)->create(['console_id' => $console->id]); $this->assertCount(3, $console->games); } #[Test] public function it_uses_slug_as_route_key(): void { $console = new Console(); $this->assertEquals('slug', $console->getRouteKeyName()); } #[Test] public function it_casts_rom_extensions_to_array(): void { $console = Console::factory()->create(['rom_extensions' => ['nes', 'sms']]); $this->assertIsArray($console->rom_extensions); $this->assertEquals(['nes', 'sms'], $console->rom_extensions); } #[Test] public function it_has_fillable_attributes(): void { $console = new Console(); $this->assertEquals([ 'name', 'slug', 'icon_path', 'rom_extensions', 'igdb_platform_id', 'tgdb_platform_id', ], $console->getFillable()); } }