laravel-nami-api/tests/Factories/MemberEntryRequestFactory.php

28 lines
718 B
PHP
Raw Normal View History

2023-02-07 02:30:00 +01:00
<?php
namespace Zoomyboy\LaravelNami\Tests\Factories;
use Worksome\RequestFactories\RequestFactory;
use Zoomyboy\LaravelNami\Data\MemberEntry;
class MemberEntryRequestFactory extends RequestFactory
{
public function definition(): array
{
return [
'firstname' => $this->faker->firstName(),
'lastname' => $this->faker->lastName(),
'groupId' => $this->faker->numberBetween(100, 200),
'id' => $this->faker->numberBetween(100, 200),
];
}
/**
* @param array<string, mixed> $attributes
*/
public function toMember(array $attributes = []): MemberEntry
{
return MemberEntry::from($this->create($attributes));
}
}