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.
37 lines
995 B
37 lines
995 B
<?php
|
|
|
|
namespace Tests\Unit\Models;
|
|
|
|
use App\User;
|
|
use fullMstr;
|
|
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
use Tests\BrowserKitTest as TestCase;
|
|
|
|
class MasterTest extends TestCase
|
|
{
|
|
use DatabaseMigrations;
|
|
|
|
/** @test */
|
|
public function a_master_has_name_link_attribute()
|
|
{
|
|
$singleMstr = factory(Master::class)->create();
|
|
|
|
$this->assertEquals(
|
|
link_to_route('masters.show', $singleMstr->name, [$singleMstr], [
|
|
'title' => __(
|
|
'app.show_detail_title',
|
|
['name' => $singleMstr->name, 'type' => __('master.master')]
|
|
),
|
|
]), $singleMstr->name_link
|
|
);
|
|
}
|
|
|
|
/** @test */
|
|
public function a_master_has_belongs_to_creator_relation()
|
|
{
|
|
$singleMstr = factory(Master::class)->make();
|
|
|
|
$this->assertInstanceOf(User::class, $singleMstr->creator);
|
|
$this->assertEquals($singleMstr->creator_id, $singleMstr->creator->id);
|
|
}
|
|
}
|