fix: FontInstaller prüft Divis Schriftenliste vor font_add; leere Installation ist ein sauberer Rollback

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Jan-Niclas Loosen
2026-10-19 18:27:02 +02:00
co-authored by Claude Sonnet 5.5
parent 901179de62
commit 2b45f1bdd3
4 changed files with 51 additions and 1 deletions
@@ -464,6 +464,24 @@ final class DiviFontsUploadAbilityTest extends TestCase
$this->assertTempFilesRemoved();
}
public function testAnInstallThatStoredNothingIsACleanRollback(): void
{
$installer = self::installer();
$installer->allows('install')->andReturn([]);
$installer->expects('remove')->never();
$log = FakeChangeLog::partialsOnly();
try {
$this->ability($installer, $log)->execute(self::input(['confirm' => true]));
self::fail('WriteFailed expected');
} catch (WriteFailed $e) {
self::assertTrue($e->rolledBack);
$error = self::assertToolError($e->toError(), 'write_failed');
self::assertStringContainsString('nichts gespeichert', $error['message']);
}
self::assertSame([], $log->partials);
}
public function testAPartialInstallThatCannotBeRemovedIsAPartialWrite(): void
{
$installer = self::installer();