You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
821 B
32 lines
821 B
<?php
|
|
|
|
namespace Tests\Unit\Models;
|
|
|
|
use Tests\TestCase;
|
|
use App\Entities\Users\User;
|
|
use App\Entities\Projects\Issue;
|
|
use App\Entities\Projects\Project;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
|
|
class IssueTest extends TestCase
|
|
{
|
|
use RefreshDatabase;
|
|
|
|
/** @test */
|
|
public function an_issue_has_belongs_to_project_relation()
|
|
{
|
|
$issue = factory(Issue::class)->make();
|
|
|
|
$this->assertInstanceOf(Project::class, $issue->project);
|
|
$this->assertEquals($issue->project_id, $issue->project->id);
|
|
}
|
|
|
|
/** @test */
|
|
public function an_issue_has_belongs_to_creator_relation()
|
|
{
|
|
$issue = factory(Issue::class)->make();
|
|
|
|
$this->assertInstanceOf(User::class, $issue->creator);
|
|
$this->assertEquals($issue->creator_id, $issue->creator->id);
|
|
}
|
|
}
|