3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-04-05 15:28:30 +00:00
Files
snipe-it/tests/Support/Importing/UsersImportFileBuilder.php
2026-03-16 17:40:57 -07:00

66 lines
1.6 KiB
PHP

<?php
declare(strict_types=1);
namespace Tests\Support\Importing;
/**
* 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 UsersImportFileBuilder extends FileBuilder
{
/**
* {@inheritdoc}
*/
protected function getDictionary(): array
{
return [
'companyName' => 'Company',
'email' => 'email',
'employeeNumber' => 'Employee Number',
'firstName' => 'First Name',
'lastName' => 'Last Name',
'displayName' => 'Display Name',
'location' => 'Location',
'phoneNumber' => 'Phone Number',
'position' => 'Job Title',
'username' => 'Username',
];
}
/**
* {@inheritdoc}
*/
public function definition(): array
{
$faker = fake();
return [
'companyName' => $faker->company,
'email' => $faker->safeEmail(),
'employeeNumber' => $faker->uuid,
'firstName' => $faker->firstName,
'lastName' => $faker->lastName,
'displayName' => $faker->firstName,
'location' => "{$faker->city}, {$faker->country}",
'phoneNumber' => $faker->phoneNumber,
'position' => $faker->jobTitle,
'username' => $faker->userName(),
];
}
}