adrema/tests/Feature/Form/FormtemplateSectionRequest.php

45 lines
890 B
PHP
Raw Permalink Normal View History

2023-12-26 20:06:57 +01:00
<?php
namespace Tests\Feature\Form;
use Worksome\RequestFactories\RequestFactory;
/**
* @method self name(string $name)
*/
class FormtemplateSectionRequest extends RequestFactory
{
/**
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'name' => $this->faker->words(5, true),
2024-06-18 15:07:10 +02:00
'intro' => null,
2023-12-26 20:06:57 +01:00
'fields' => [],
];
}
/**
* @param array<int, FormtemplateFieldRequest> $fields
*/
public function fields(array $fields): self
{
return $this->state(['fields' => $fields]);
}
2024-06-18 14:54:44 +02:00
public function intro(string $intro): self
{
return $this->state(['intro' => $intro]);
}
2023-12-26 20:06:57 +01:00
/**
* @param mixed $args
*/
public function __call(string $method, $args): self
{
return $this->state([$method => $args[0]]);
}
}