Added basic models and factories

This commit is contained in:
Constantin Graf
2024-01-21 18:35:29 +01:00
parent 28f7b43577
commit 6377df1f44
29 changed files with 1476 additions and 116 deletions

View 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));
}
}