mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
3e832e5e94
This reverts commit 95516b0343
.
26 lines
614 B
PHP
26 lines
614 B
PHP
<?php
|
|
namespace Tests\Unit;
|
|
|
|
use App\Models\Asset;
|
|
use App\Models\Category;
|
|
use App\Models\AssetModel;
|
|
use Tests\TestCase;
|
|
|
|
class AssetModelTest extends TestCase
|
|
{
|
|
public function testAnAssetModelContainsAssets()
|
|
{
|
|
$category = Category::factory()->create([
|
|
'category_type' => 'asset'
|
|
]);
|
|
$model = AssetModel::factory()->create([
|
|
'category_id' => $category->id,
|
|
]);
|
|
|
|
$asset = Asset::factory()->create([
|
|
'model_id' => $model->id
|
|
]);
|
|
$this->assertEquals(1, $model->assets()->count());
|
|
}
|
|
}
|