snipe-it/tests/Unit/CompanyTest.php
snipe 390e8a6cc3 Fixed company unit test
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 16:43:03 -08:00

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