adrema/tests/Unit/EditorDataTest.php

20 lines
448 B
PHP
Raw Normal View History

2024-07-04 23:54:37 +02:00
<?php
namespace Tests\Unit;
use Tests\RequestFactories\EditorRequestFactory;
use Tests\TestCase;
class EditorDataTest extends TestCase
{
public function testItReplacesBlockContentWithList(): void
{
$data = EditorRequestFactory::new()->paragraphs(['{search}'])->toData();
2024-07-08 21:42:31 +02:00
$data = $data->replaceWithList('search', ['A', 'B']);
2024-07-04 23:54:37 +02:00
$this->assertEquals('A', data_get($data->blocks, '0.data.items.0.content'));
}
}