diff --git a/database/factories/ImportFactory.php b/database/factories/ImportFactory.php index 0b0f79aa44..ca6608a804 100644 --- a/database/factories/ImportFactory.php +++ b/database/factories/ImportFactory.php @@ -143,4 +143,25 @@ class ImportFactory extends Factory return $attributes; }); } + + + /** + * Create an asset model import type. + * + * @return static + */ + public function assetmodel() + { + return $this->state(function (array $attributes) { + $fileBuilder = Importing\AssetModelsImportFileBuilder::new(); + + $attributes['name'] = "{$attributes['name']} Asset Model"; + $attributes['import_type'] = 'assetmodel'; + $attributes['header_row'] = $fileBuilder->toCsv()[0]; + $attributes['first_row'] = $fileBuilder->firstRow(); + + return $attributes; + }); + } + }