snipe-it/tests/Unit/CompanyTest.php

35 lines
764 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 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;
2016-03-25 01:18:05 -07:00
class CompanyTest extends BaseTest
2016-03-25 01:18:05 -07:00
{
/**
* @var \UnitTester
*/
protected $tester;
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
}