mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-08 08:12:17 +01:00
Added trial and blocking to billing contract, fixed bug in running time tracker command
This commit is contained in:
committed by
Constantin Graf
parent
7c593f8f87
commit
5b7df869ad
31
tests/Unit/Model/OrganizationModelTest.php
Normal file
31
tests/Unit/Model/OrganizationModelTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Unit\Model;
|
||||
|
||||
use App\Models\Member;
|
||||
use App\Models\Organization;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\UsesClass;
|
||||
|
||||
#[CoversClass(Organization::class)]
|
||||
#[UsesClass(Organization::class)]
|
||||
class OrganizationModelTest extends ModelTestAbstract
|
||||
{
|
||||
public function test_it_has_many_members(): void
|
||||
{
|
||||
// Arrange
|
||||
$organization = Organization::factory()->create();
|
||||
$members = Member::factory()->forOrganization($organization)->createMany(3);
|
||||
|
||||
// Act
|
||||
$organization->refresh();
|
||||
$membersRel = $organization->members;
|
||||
|
||||
// Assert
|
||||
$this->assertNotNull($membersRel);
|
||||
$this->assertCount(3, $membersRel);
|
||||
$this->assertTrue($membersRel->first()->is($members->first()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user