|
|
|
@ -3,10 +3,12 @@ |
|
|
|
namespace Tests\Unit; |
|
|
|
|
|
|
|
use App\Couple; |
|
|
|
use App\FamilyConnection; |
|
|
|
use App\User; |
|
|
|
use Carbon\Carbon; |
|
|
|
use Illuminate\Foundation\Testing\RefreshDatabase; |
|
|
|
use Illuminate\Support\Collection; |
|
|
|
use Ramsey\Uuid\Uuid; |
|
|
|
use Tests\TestCase; |
|
|
|
|
|
|
|
class UserTest extends TestCase |
|
|
|
@ -266,4 +268,21 @@ class UserTest extends TestCase |
|
|
|
$customer->birthday_remaining |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
/** @test */ |
|
|
|
public function a_user_model_has_method_has_family_connection_request_to() |
|
|
|
{ |
|
|
|
$john = factory(User::class)->create(); |
|
|
|
$jane = factory(User::class)->create(); |
|
|
|
|
|
|
|
$this->assertFalse($john->hasFamilyConnectionRequestTo($jane)); |
|
|
|
|
|
|
|
FamilyConnection::create([ |
|
|
|
'id' => Uuid::uuid4()->toString(), |
|
|
|
'requester_id' => $john->id, |
|
|
|
'requested_id' => $jane->id, |
|
|
|
]); |
|
|
|
|
|
|
|
$this->assertTrue($john->hasFamilyConnectionRequestTo($jane)); |
|
|
|
} |
|
|
|
} |