mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-09 16:52:17 +01:00
Added basic models and factories
This commit is contained in:
26
tests/Unit/Model/ClientModelTest.php
Normal file
26
tests/Unit/Model/ClientModelTest.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Unit\Model;
|
||||
|
||||
use App\Models\Client;
|
||||
use App\Models\Team;
|
||||
|
||||
class ClientModelTest extends ModelTestAbstract
|
||||
{
|
||||
public function test_it_belongs_to_a_organization(): void
|
||||
{
|
||||
// Arrange
|
||||
$organization = Team::factory()->create();
|
||||
$client = Client::factory()->forOrganization($organization)->create();
|
||||
|
||||
// Act
|
||||
$client->refresh();
|
||||
$organizationRel = $client->organization;
|
||||
|
||||
// Assert
|
||||
$this->assertNotNull($organizationRel);
|
||||
$this->assertTrue($organizationRel->is($organization));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user