users and institutions route, tests fixed

This commit is contained in:
Giuseppe Naponiello
2026-06-23 12:29:02 +02:00
parent fe73662903
commit 032f6a08df
23 changed files with 346 additions and 287 deletions

View File

@@ -0,0 +1,37 @@
<?php
namespace Tests\Feature;
use App\Models\Lists\UserPosition;
use Database\Seeders\UserPositionSeeder;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class UserPositionSeederTest extends TestCase
{
use RefreshDatabase;
public function test_it_seeds_the_base_positions(): void
{
$this->seed(UserPositionSeeder::class);
$this->assertSame(5, UserPosition::count());
foreach ([
UserPosition::PROFESSOR,
UserPosition::RESEARCHER,
UserPosition::PHD,
UserPosition::STUDENT,
UserPosition::ADMINISTRATIVE,
] as $value) {
$this->assertDatabaseHas('user_positions', ['value' => $value]);
}
}
public function test_it_is_idempotent(): void
{
$this->seed(UserPositionSeeder::class);
$this->seed(UserPositionSeeder::class);
$this->assertSame(5, UserPosition::count());
}
}