2018-10-06 14:15:54 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Engelsystem\Test\Unit\Models;
|
|
|
|
|
|
|
|
use Engelsystem\Models\User\HasUserModel;
|
|
|
|
use Engelsystem\Test\Unit\HasDatabase;
|
|
|
|
use Engelsystem\Test\Unit\Models\User\Stub\HasUserModelImplementation;
|
2019-10-08 13:57:50 +02:00
|
|
|
use Engelsystem\Test\Unit\TestCase;
|
2018-10-06 14:15:54 +02:00
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
|
|
|
|
class HasUserModelTest extends TestCase
|
|
|
|
{
|
|
|
|
use HasDatabase;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @covers \Engelsystem\Models\User\HasUserModel::user
|
|
|
|
*/
|
|
|
|
public function testHasOneRelations()
|
|
|
|
{
|
|
|
|
/** @var HasUserModel $contact */
|
|
|
|
$model = new HasUserModelImplementation();
|
|
|
|
|
|
|
|
$this->assertInstanceOf(BelongsTo::class, $model->user());
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Prepare test
|
|
|
|
*/
|
2019-04-24 10:45:00 +02:00
|
|
|
protected function setUp(): void
|
2018-10-06 14:15:54 +02:00
|
|
|
{
|
2019-10-08 13:57:50 +02:00
|
|
|
parent::setUp();
|
2018-10-06 14:15:54 +02:00
|
|
|
$this->initDatabase();
|
|
|
|
}
|
|
|
|
}
|