Skip to content

A free open source IT asset/license management system

Added factory

snipeae8b2e7318f1
diff --git a/database/factories/ImportFactory.php b/database/factories/ImportFactory.php
index 7e3f17d59f..1e58f3b938 100644
--- a/database/factories/ImportFactory.php
+++ b/database/factories/ImportFactory.php
@@ -237,4 +237,17 @@ class ImportFactory extends Factory
return $attributes;
});
}
+
+ public function assetHistory()
+ {
+ return $this->state(function (array $attributes) {
+ $fileBuilder = Importing\AssetHistoryImportFileBuilder::new();
+ $attributes['name'] = "{$attributes['name']} Asset History";
+ $attributes['import_type'] = 'assetHistory';
+ $attributes['header_row'] = $fileBuilder->toCsv()[0];
+ $attributes['first_row'] = $fileBuilder->firstRow();
+
+ return $attributes;
+ });
+ }
}