adrema/tests/RequestFactories/InitializeRequestFactory.php

59 lines
1.5 KiB
PHP
Raw Permalink Normal View History

2023-02-07 00:43:27 +01:00
<?php
namespace Tests\RequestFactories;
use Worksome\RequestFactories\RequestFactory;
class InitializeRequestFactory extends RequestFactory
{
public function definition(): array
{
return [
2023-05-08 15:11:16 +02:00
'group_id' => (string) $this->faker->numberBetween(100, 200),
2023-02-07 00:43:27 +01:00
'password' => $this->faker->word(),
2023-05-08 15:11:16 +02:00
'mglnr' => (string) $this->faker->numberBetween(100, 200),
'params' => [
'gruppierung1Id' => $this->faker->numberBetween(100000, 200000),
'gruppierung2Id' => $this->faker->numberBetween(100000, 200000),
'gruppierung3Id' => $this->faker->numberBetween(100000, 200000),
'inGrp' => $this->faker->boolean(),
'unterhalbGrp' => $this->faker->boolean(),
],
2023-02-07 00:43:27 +01:00
];
}
public function invalid(): self
{
return $this->state([
'group_id' => null,
'password' => null,
'mglnr' => null,
]);
}
public function withCredentials(int $mglnr, string $password): self
{
return $this->state([
'mglnr' => $mglnr,
'password' => $password,
]);
}
2023-05-08 15:11:16 +02:00
/**
* @param array<string, string|int|bool> $params
*/
public function withParams(array $params): self
{
return $this->state([
'params' => $params,
]);
}
2023-02-07 00:43:27 +01:00
public function withGroup(int $group): self
{
return $this->state([
'group_id' => $group,
]);
}
}