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.
urlhub/tests/Unit/Models/UserTest.php

37 lines
632 B

<?php
namespace Tests\Unit\Models;
use App\Models\Url;
use App\Models\User;
use Tests\TestCase;
class UserTest extends TestCase
{
/**
* @test
* @group u-model
*/
public function hasManyUrl()
{
$user = User::factory()->create();
Url::factory()->create([
'user_id' => $user->id,
]);
$this->assertTrue($user->url()->exists());
}
/**
* The number of guests is calculated based on a unique IP.
*
* @test
* @group u-model
*/
public function guestCount()
{
$this->assertSame(0, (new User)->guestCount());
}
}