2023-12-26 20:06:57 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Tests\Feature\Form;
|
|
|
|
|
|
|
|
use Worksome\RequestFactories\RequestFactory;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @method self name(string $name)
|
2024-07-14 20:20:56 +02:00
|
|
|
* @method self mailTop(?EditorRequestFactory $content)
|
|
|
|
* @method self mailBottom(?EditorRequestFactory $content)
|
2023-12-26 20:06:57 +01:00
|
|
|
*/
|
|
|
|
class FormtemplateRequest extends RequestFactory
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @return array<string, mixed>
|
|
|
|
*/
|
|
|
|
public function definition(): array
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'name' => $this->faker->words(5, true),
|
|
|
|
'config' => ['sections' => []],
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param array<int, FormtemplateSectionRequest> $sections
|
|
|
|
*/
|
|
|
|
public function sections(array $sections): self
|
|
|
|
{
|
|
|
|
return $this->state(['config.sections' => $sections]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $args
|
|
|
|
*/
|
|
|
|
public function __call(string $method, $args): self
|
|
|
|
{
|
2024-07-14 20:20:56 +02:00
|
|
|
return $this->state([str($method)->snake()->toString() => $args[0]]);
|
2023-12-26 20:06:57 +01:00
|
|
|
}
|
|
|
|
}
|