mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-09 04:47:38 -08:00
59 lines
1.3 KiB
PHP
59 lines
1.3 KiB
PHP
|
<?php
|
||
|
|
||
|
declare(strict_types=1);
|
||
|
|
||
|
namespace Tests\Support\Importing;
|
||
|
|
||
|
use App\Models\Category;
|
||
|
use Illuminate\Support\Str;
|
||
|
|
||
|
/**
|
||
|
* Build a users import file at runtime for testing.
|
||
|
*
|
||
|
* @template Row of array{
|
||
|
* name?: string,
|
||
|
* manufacturer?: string,
|
||
|
* category?: string,
|
||
|
* model_number?: string,
|
||
|
* requestable?: int,
|
||
|
* }
|
||
|
*
|
||
|
* @extends FileBuilder<Row>
|
||
|
*/
|
||
|
class AssetModelsImportFileBuilder extends FileBuilder
|
||
|
{
|
||
|
/**
|
||
|
* @inheritdoc
|
||
|
*/
|
||
|
protected function getDictionary(): array
|
||
|
{
|
||
|
return [
|
||
|
'name' => 'Name',
|
||
|
'category' => 'Category',
|
||
|
'manufacturer' => 'Manufacturer',
|
||
|
'model_number' => 'Model Number',
|
||
|
'fieldset' => 'Fieldset',
|
||
|
'eol' => 'EOL',
|
||
|
'min_amt' => 'Min Amount',
|
||
|
'notes' => 'Notes',
|
||
|
'requestable' => 'Requestable',
|
||
|
|
||
|
];
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @inheritdoc
|
||
|
*/
|
||
|
public function definition(): array
|
||
|
{
|
||
|
$faker = fake();
|
||
|
|
||
|
return [
|
||
|
'name' => $faker->catchPhrase,
|
||
|
'category' => Str::random(),
|
||
|
'model_number' => $faker->creditCardNumber(),
|
||
|
'notes' => $faker->sentence(5),
|
||
|
];
|
||
|
}
|
||
|
}
|