add FOREIGN KEY direction and department

This commit is contained in:
aslan 2024-02-12 11:05:45 +03:00
parent c5abf73eb0
commit 07cb065e1c
1 changed files with 4 additions and 0 deletions

View File

@ -3,6 +3,7 @@
namespace Tests\Feature\admin\catalog; namespace Tests\Feature\admin\catalog;
use App\Models\Department; use App\Models\Department;
use App\Models\Direction;
use App\Models\EducationalInstitution; use App\Models\EducationalInstitution;
use App\Models\Faculty; use App\Models\Faculty;
use App\Models\User; use App\Models\User;
@ -28,6 +29,8 @@ class DepartmentTest extends TestCase
'faculty_id', 'faculty_id',
]); ]);
$this->direction = Direction::factory()->create();
$this->user = User::factory()->create([ $this->user = User::factory()->create([
'name' => 'admin', 'name' => 'admin',
'email' => 'test@example.com', 'email' => 'test@example.com',
@ -95,6 +98,7 @@ class DepartmentTest extends TestCase
public function testDestroyDepartment(): void public function testDestroyDepartment(): void
{ {
$this->direction->delete();
$response = $this->actingAs($this->user) $response = $this->actingAs($this->user)
->withSession(['banned' => false]) ->withSession(['banned' => false])
->delete(route('departments.destroy', $this->department)); ->delete(route('departments.destroy', $this->department));