use the correct validator function to check for errors, add a test for ShowController

This commit is contained in:
Nicky De Maeyer
2025-10-11 23:02:54 +02:00
parent a3bf845851
commit 2a4a98dd10
6 changed files with 118 additions and 5 deletions

View File

@@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
namespace Database\Factories;
use FireflyIII\Enums\AccountTypeEnum;
use FireflyIII\Models\AccountType;
use Illuminate\Database\Eloquent\Factories\Factory;
class AccountFactory extends Factory
{
public function definition(): array
{
return [
'name' => $this->faker->name(),
'active' => true,
];
}
public function withType(AccountTypeEnum $type): static
{
return $this->for(AccountType::where('type', $type->value)->first());
}
}