ajout app
This commit is contained in:
22
SNIPE-IT/tests/Unit/Models/Company/CompanyTest.php
Normal file
22
SNIPE-IT/tests/Unit/Models/Company/CompanyTest.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
namespace Tests\Unit\Models\Company;
|
||||
|
||||
use App\Models\Company;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class CompanyTest extends TestCase
|
||||
{
|
||||
public function testACompanyCanHaveUsers()
|
||||
{
|
||||
$company = Company::factory()->create();
|
||||
$user = User::factory()
|
||||
->create(
|
||||
[
|
||||
'company_id'=> $company->id
|
||||
]
|
||||
);
|
||||
|
||||
$this->assertCount(1, $company->users);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user