mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-11 08:04:09 -08:00
390e8a6cc3
Signed-off-by: snipe <snipe@snipe.net>
35 lines
764 B
PHP
35 lines
764 B
PHP
<?php
|
|
namespace Tests\Unit;
|
|
|
|
use App\Models\Company;
|
|
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
|
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
|
use Tests\Unit\BaseTest;
|
|
use App\Models\Component;
|
|
use App\Models\Asset;
|
|
use App\Models\Consumable;
|
|
use App\Models\User;
|
|
|
|
class CompanyTest extends BaseTest
|
|
{
|
|
/**
|
|
* @var \UnitTester
|
|
*/
|
|
protected $tester;
|
|
|
|
|
|
public function testACompanyCanHaveUsers()
|
|
{
|
|
$company = Company::factory()->create();
|
|
$user = User::factory()
|
|
->create(
|
|
[
|
|
'company_id'=> $company->id
|
|
]
|
|
);
|
|
|
|
$this->assertCount(1, $company->users);
|
|
}
|
|
}
|