38 lines
957 B
PHP
38 lines
957 B
PHP
<?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());
|
|
}
|
|
}
|