mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -08:00
Unit test fix. Cleaner this way.
This commit is contained in:
parent
05187eb27f
commit
9520ccae47
|
@ -87,11 +87,11 @@ class BaseTest extends \Codeception\TestCase\Test
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function createValidAsset($overrides = [], $qty = 1)
|
protected function createValidAsset($overrides = [])
|
||||||
{
|
{
|
||||||
$locId = $this->createValidLocation()->id;
|
$locId = $this->createValidLocation()->id;
|
||||||
$this->createValidAssetModel();
|
$this->createValidAssetModel();
|
||||||
return factory(\App\Models\Asset::class, $qty)->states('laptop-mbp')->create(
|
return factory(\App\Models\Asset::class)->states('laptop-mbp')->create(
|
||||||
array_merge([
|
array_merge([
|
||||||
'rtd_location_id' => $locId,
|
'rtd_location_id' => $locId,
|
||||||
'location_id' => $locId,
|
'location_id' => $locId,
|
||||||
|
|
|
@ -38,8 +38,8 @@ class CategoryTest extends BaseTest
|
||||||
$this->assertCount(5, $category->models);
|
$this->assertCount(5, $category->models);
|
||||||
|
|
||||||
$models->each(function($model) {
|
$models->each(function($model) {
|
||||||
// factory(App\Models\Asset::class, 2)->create(['model_id' => $model->id]);
|
$this->createValidAsset(['model_id' => $model->id]);
|
||||||
$this->createValidAsset(['model_id' => $model->id], 2);
|
$this->createValidAsset(['model_id' => $model->id]);
|
||||||
});
|
});
|
||||||
$this->assertEquals(10, $category->itemCount());
|
$this->assertEquals(10, $category->itemCount());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue