snipe-it/tests/Unit/CompanyTest.php

23 lines
456 B
PHP
Raw Normal View History

2016-03-25 01:18:05 -07:00
<?php
namespace Tests\Unit;
2016-03-25 01:18:05 -07:00
use App\Models\Company;
use App\Models\User;
2023-03-07 16:57:55 -08:00
use Tests\TestCase;
2016-03-25 01:18:05 -07:00
2023-03-07 16:57:55 -08:00
class CompanyTest extends TestCase
2016-03-25 01:18:05 -07:00
{
public function testACompanyCanHaveUsers()
{
$company = Company::factory()->create();
$user = User::factory()
->create(
[
'company_id'=> $company->id
]
);
$this->assertCount(1, $company->users);
}
2016-03-25 01:18:05 -07:00
}