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.
31 lines
808 B
31 lines
808 B
<?php
|
|
|
|
namespace Tests\Unit;
|
|
|
|
use App\User;
|
|
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
use Tests\TestCase;
|
|
|
|
class UserTest extends TestCase
|
|
{
|
|
use DatabaseMigrations;
|
|
|
|
/** @test */
|
|
public function user_have_profile_link()
|
|
{
|
|
$user = factory(User::class)->create();
|
|
$this->assertEquals(link_to_route('users.show', $user->nickname, [$user->id]), $user->profileLink());
|
|
}
|
|
|
|
/** @test */
|
|
public function user_can_have_marriages()
|
|
{
|
|
$husband = factory(User::class)->states('male')->create();
|
|
$wife = factory(User::class)->states('female')->create();
|
|
$husband->addWife($wife);
|
|
|
|
$this->assertCount(1, $husband->wifes);
|
|
$this->assertCount(1, $wife->husbands);
|
|
$this->assertCount(1, $husband->marriages);
|
|
}
|
|
}
|