test: fix the P9/P14 backup wording of every VisibleEdits caller (ruling Q17 M3)

VisibleEditsTest asserts the exact refusal messages (no unfiltered_html,
trash disabled) and the keepingBackup() hints for rolled-back and partial
failures with each caller's label and entry. The callers' own tests drive
GlobalEdits, ThemeBuilderEdits (through DiviWriter) and make-global with
revisions off and assert the same sentences.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7
This commit is contained in:
2026-09-27 23:03:05 +02:00
co-authored by Claude Opus 5.5
parent 43dc3fb889
commit 79f2fdbda6
5 changed files with 165 additions and 10 deletions
@@ -18,6 +18,7 @@ use LIT\MCP\Integrations\Divi\ThemeBuilder\Template;
use LIT\MCP\Integrations\Divi\ThemeBuilder\ThemeBuilderEdits;
use LIT\MCP\Abilities\Errors;
use LIT\MCP\Tests\Support\ThemeBuilderFixtures;
use LIT\MCP\Tests\Unit\Integrations\Divi\Pages\VisibleEditsTest;
use LIT\MCP\Tests\Unit\TestCase;
use Mockery;
use WP_Post;
@@ -226,16 +227,18 @@ final class ThemeBuilderEditsTest extends TestCase
$live = [ThemeBuilderFixtures::template(1066, ['enabled' => true])];
Functions\when('current_user_can')->alias(static fn (string $cap): bool => $cap !== 'unfiltered_html');
$hint = 'Revisionen aktivieren (WP_POST_REVISIONS) oder das Layout im Divi Theme Builder bearbeiten.';
$filtered = $this->recording($live)->prepare($page, ['confirm' => true]);
self::assertToolError($filtered, 'unsupported');
self::assertStringContainsString('Theme-Builder-Layout 1062', $filtered->get_error_message());
self::assertStringContainsString('Theme Builder', (string) self::clientError($filtered)['hint']);
self::assertSame(sprintf(VisibleEditsTest::UNFAITHFUL, 'Theme-Builder-Layout 1062'), Errors::clientMessage($filtered));
self::assertSame($hint, self::clientError($filtered)['hint']);
Functions\when('current_user_can')->justReturn(true);
$this->trash = false;
$trash = $this->recording($live)->prepare($page, ['confirm' => true]);
self::assertToolError($trash, 'unsupported');
self::assertStringContainsString('Papierkorb', $trash->get_error_message());
self::assertSame(sprintf(VisibleEditsTest::NO_TRASH, 'Theme-Builder-Layout 1062'), Errors::clientMessage($trash));
self::assertSame($hint, self::clientError($trash)['hint']);
self::assertSame(0, $this->backups);
}