2018-10-06 14:15:54 +02:00
|
|
|
<?php
|
|
|
|
|
2020-04-19 20:41:38 +02:00
|
|
|
namespace Engelsystem\Test\Unit\Models\User;
|
2018-10-06 14:15:54 +02:00
|
|
|
|
2019-11-03 00:25:35 +01:00
|
|
|
use Engelsystem\Models\BaseModel;
|
|
|
|
use Engelsystem\Models\User\UsesUserModel;
|
2018-10-06 14:15:54 +02:00
|
|
|
use Engelsystem\Test\Unit\HasDatabase;
|
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;
|
|
|
|
|
2019-11-03 00:25:35 +01:00
|
|
|
class UsesUserModelTest extends TestCase
|
2018-10-06 14:15:54 +02:00
|
|
|
{
|
|
|
|
use HasDatabase;
|
|
|
|
|
|
|
|
/**
|
2019-11-03 00:25:35 +01:00
|
|
|
* @covers \Engelsystem\Models\User\UsesUserModel::user
|
2018-10-06 14:15:54 +02:00
|
|
|
*/
|
|
|
|
public function testHasOneRelations()
|
|
|
|
{
|
2019-11-03 00:25:35 +01:00
|
|
|
/** @var UsesUserModel $contact */
|
|
|
|
$model = new class extends BaseModel
|
|
|
|
{
|
|
|
|
use UsesUserModel;
|
|
|
|
};
|
2018-10-06 14:15:54 +02:00
|
|
|
|
|
|
|
$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();
|
|
|
|
}
|
|
|
|
}
|