You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
802 B
PHTML
38 lines
802 B
PHTML
6 years ago
|
<?php
|
||
|
|
||
|
namespace Engelsystem\Test\Unit\Models;
|
||
|
|
||
5 years ago
|
use Engelsystem\Models\BaseModel;
|
||
|
use Engelsystem\Models\User\UsesUserModel;
|
||
6 years ago
|
use Engelsystem\Test\Unit\HasDatabase;
|
||
5 years ago
|
use Engelsystem\Test\Unit\TestCase;
|
||
6 years ago
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||
|
|
||
5 years ago
|
class UsesUserModelTest extends TestCase
|
||
6 years ago
|
{
|
||
|
use HasDatabase;
|
||
|
|
||
|
/**
|
||
5 years ago
|
* @covers \Engelsystem\Models\User\UsesUserModel::user
|
||
6 years ago
|
*/
|
||
|
public function testHasOneRelations()
|
||
|
{
|
||
5 years ago
|
/** @var UsesUserModel $contact */
|
||
|
$model = new class extends BaseModel
|
||
|
{
|
||
|
use UsesUserModel;
|
||
|
};
|
||
6 years ago
|
|
||
|
$this->assertInstanceOf(BelongsTo::class, $model->user());
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Prepare test
|
||
|
*/
|
||
6 years ago
|
protected function setUp(): void
|
||
6 years ago
|
{
|
||
5 years ago
|
parent::setUp();
|
||
6 years ago
|
$this->initDatabase();
|
||
|
}
|
||
|
}
|