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 22:39:11 +02:00
|
|
|
$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'));
|
|
|
|
}
|
|
|
|
}
|