mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-05-07 20:32:26 +00:00
27 lines
623 B
PHP
27 lines
623 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Unit\Model;
|
|
|
|
use App\Models\Client;
|
|
use App\Models\Organization;
|
|
|
|
class ClientModelTest extends ModelTestAbstract
|
|
{
|
|
public function test_it_belongs_to_a_organization(): void
|
|
{
|
|
// Arrange
|
|
$organization = Organization::factory()->create();
|
|
$client = Client::factory()->forOrganization($organization)->create();
|
|
|
|
// Act
|
|
$client->refresh();
|
|
$organizationRel = $client->organization;
|
|
|
|
// Assert
|
|
$this->assertNotNull($organizationRel);
|
|
$this->assertTrue($organizationRel->is($organization));
|
|
}
|
|
}
|