snipe-it/tests/Unit/CompanyTest.php
snipe 35ba28bff9 Continuing to refactor tests
Signed-off-by: snipe <snipe@snipe.net>
2021-12-02 16:14:45 -08:00

35 lines
755 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::factory()
->create(
[
'company_id'=>$company->id
]
);
$this->assertCount(1, $company->users);
}
}