fix: Divi-Reiter ohne Divi, Zustandstexte, Schreibsperren und Aufräum-Filter aus der Abschlussprüfung

Behebt die fünf Befunde der Abschlussprüfung von divi-absicherung: Divi-Reiter ohne aktives Divi zeigt nur
noch einen Hinweis (kein Status, keine Prüfung, kein Aufräumen), Zustandstexte werden erst beim Rendern
übersetzt, DiviPages::setFlags() und DiviThemeBuilder::liveId(true) prüfen jetzt selbst die
Freigabesperre, WriteProbe::removeOrphans() löscht nur noch Entwürfe mit passendem Titel, und
wp lit-mcp divi-check --update-reference verweigert sich ohne Entwicklungskopie, bevor irgendetwas
geschrieben wird.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-30 03:33:16 +02:00
co-authored by Claude Opus 5.5
parent 35ea47d832
commit 43c0a78374
9 changed files with 122 additions and 24 deletions
+18 -3
View File
@@ -49,8 +49,11 @@ final class DiviCheckCommandTest extends TestCase
* @param bool $expectSave True asserts save() is called exactly once (the green happy path); otherwise it is
* merely allowed, since some tests (e.g. no admin) never reach the save() call.
*/
private function command(array $problems = [], bool $expectSave = false): DiviCheckCommand
{
private function command(
array $problems = [],
bool $expectSave = false,
bool $noSourceDir = false
): DiviCheckCommand {
$steps = array_map(
static fn (string $key): CheckStep => new CheckStep($key, $problems[$key] ?? []),
[CheckStep::MANIFEST, CheckStep::MIRRORS, CheckStep::CATALOG, CheckStep::FORMAT, CheckStep::WRITE]
@@ -72,7 +75,7 @@ final class DiviCheckCommandTest extends TestCase
},
fn (): ?string => $this->themeDir,
$this->expectedFile,
fn (): ?string => $this->sourceDir
$noSourceDir ? static fn (): ?string => null : fn (): ?string => $this->sourceDir
);
}
@@ -105,6 +108,18 @@ final class DiviCheckCommandTest extends TestCase
self::assertFileDoesNotExist($this->expectedFile);
}
public function testUpdateReferenceRefusesWithoutADevelopmentSourceDir(): void
{
$code = $this->command(noSourceDir: true)->run(['update-reference' => true]);
self::assertSame(1, $code);
self::assertStringContainsString(
'Referenz nicht aktualisiert: nur in einer Entwicklungskopie mit tests/ möglich.',
implode("\n", $this->lines)
);
self::assertFileDoesNotExist($this->expectedFile);
}
public function testDiffShowsWhatChangedInAMirroredFunction(): void
{
file_put_contents(