summaryrefslogtreecommitdiff
path: root/tests/Unit/Models/User/UsesUserModelTest.php
blob: 0842d221067d83e6b4d3b61e9ba19a81638d5118 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php

namespace Engelsystem\Test\Unit\Models;

use Engelsystem\Models\BaseModel;
use Engelsystem\Models\User\UsesUserModel;
use Engelsystem\Test\Unit\HasDatabase;
use Engelsystem\Test\Unit\TestCase;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class UsesUserModelTest extends TestCase
{
    use HasDatabase;

    /**
     * @covers \Engelsystem\Models\User\UsesUserModel::user
     */
    public function testHasOneRelations()
    {
        /** @var UsesUserModel $contact */
        $model = new class extends BaseModel
        {
            use UsesUserModel;
        };

        $this->assertInstanceOf(BelongsTo::class, $model->user());
    }

    /**
     * Prepare test
     */
    protected function setUp(): void
    {
        parent::setUp();
        $this->initDatabase();
    }
}