2024-02-02 01:05:45 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Tests\RequestFactories;
|
|
|
|
|
|
|
|
use Worksome\RequestFactories\RequestFactory;
|
|
|
|
|
|
|
|
class EditorRequestFactory extends RequestFactory
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @return array<string, mixed>
|
|
|
|
*/
|
|
|
|
public function definition(): array
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'time' => 45069432,
|
|
|
|
'blocks' => [
|
|
|
|
['id' => 'TTzz66', 'type' => 'paragraph', 'data' => ['text' => 'lorem']]
|
|
|
|
],
|
|
|
|
'version' => '1.0',
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function text(int $id, string $text): self
|
|
|
|
{
|
|
|
|
return $this->state($this->paragraphBlock($id, $text));
|
|
|
|
}
|
|
|
|
|
2024-02-09 00:21:33 +01:00
|
|
|
/**
|
|
|
|
* @return array<string, mixed>
|
|
|
|
*/
|
2024-02-02 01:05:45 +01:00
|
|
|
public function paragraphBlock(int $id, string $text): array
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'time' => 1,
|
|
|
|
'version' => '1.0',
|
|
|
|
'blocks' => [
|
|
|
|
['id' => $id, 'type' => 'paragraph', 'data' => ['text' => $text]]
|
|
|
|
],
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|