fix: PresetComposer liest nur den von der Ability bereinigten Namen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
3d760113ec
commit
d5fd1642b8
@@ -240,6 +240,21 @@ final class DiviPresetsSetAbilityTest extends TestCase
|
||||
self::assertStringContainsString('1–100 Zeichen', $empty['fields']['items[0].rename']);
|
||||
}
|
||||
|
||||
/** Final review M-5: rename is cleaned by the ability and reaches the composer as the resolved name. */
|
||||
public function testRenameIsCleanedAndApplied(): void
|
||||
{
|
||||
$ability = $this->ability();
|
||||
$input = ['items' => [['module' => 'button', 'preset' => 'CTA primär', 'rename' => '<b>CTA</b> neu']]];
|
||||
$dry = self::assertToolError($ability->execute($input), 'confirm_required');
|
||||
self::assertSame(['changed'], array_column($dry['diff'], 'action'));
|
||||
|
||||
$this->snapshots->expects('save')->andReturn('presets-1');
|
||||
$this->snapshots->expects('attachLog');
|
||||
self::assertTrue($ability->execute($input + ['confirm' => true, 'design_rev' => $dry['design_rev']])['ok']);
|
||||
$items = PresetBook::fromDivi($this->stored)->items(new PresetScope('module', 'divi/button'));
|
||||
self::assertSame('CTA neu', $items['aaaaaaaaaa']['name']);
|
||||
}
|
||||
|
||||
public function testNameAndRenameAreExclusive(): void
|
||||
{
|
||||
$ability = $this->ability();
|
||||
|
||||
Reference in New Issue
Block a user