3
0
mirror of https://github.com/snipe/snipe-it.git synced 2025-12-01 11:30:10 +00:00
Files
snipe-it/tests/Support/Importing/ManufacturersImportFileBuilder.php
snipe 90b7df45b9 Added tests and support helper
Signed-off-by: snipe <snipe@snipe.net>
2025-06-02 02:55:11 +01:00

59 lines
1.3 KiB
PHP

<?php
declare(strict_types=1);
namespace Tests\Support\Importing;
use Illuminate\Support\Str;
/**
* Build a users import file at runtime for testing.
*
* @template Row of array{
* companyName?: string,
* email?: string,
* employeeNumber?: int,
* firstName?: string,
* lastName?: string,
* location?: string,
* phoneNumber?: string,
* position?: string,
* username?: string,
* }
*
* @extends FileBuilder<Row>
*/
class ManufacturersImportFileBuilder extends FileBuilder
{
/**
* @inheritdoc
*/
protected function getDictionary(): array
{
return [
'name' => 'name',
'support_email' => 'support_email',
'support_phone' => 'Support Phone',
'notes' => 'notes',
'support_fax' => 'support_fax',
'support_url' => 'support_url',
];
}
/**
* @inheritdoc
*/
public function definition(): array
{
$faker = fake();
return [
'name' => $faker->company,
'support_email' => Str::random(32) . "@{$faker->freeEmailDomain}",
'support_phone' => $faker->phoneNumber,
'support_fax' => $faker->phoneNumber,
'support_url' => $faker->url(),
];
}
}