docs: Divi guides shortform/placeholders, hints name the write tools; test: Divi write end-to-end; version 0.3.0
- Hints (PostPresenter::DIVI_NOTE, outline, catalog) and server instructions (tree_rev rule) name the Divi write tools; guides divi-shortform and divi-placeholders, additions to divi-structure, divi-attrs, overview (tool groups, 'nur lesen'), workflows, content-types. - D7 wording and the S7 exception in readme, guides and spec 1.3/5.2; readme 0.3.0. - ToolNamingTest: every referenced guide topic exists; overview lists exactly the topics. - tests/Integration/divi-write-smoke.sh: all write tools via OAuth, editor without unfiltered_html with benign probes (S6), Divi's own save filters on the new fixture synthetic-divi-filters.html (S7); admin-render.php accepts the new wrap class. 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:
@@ -96,6 +96,40 @@ final class ToolNamingTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
/** Every guide topic named in a description, hint or the overview exists as docs/guides/<topic>.md. */
|
||||
public function testReferencedGuideTopicsExist(): void
|
||||
{
|
||||
$root = dirname(__DIR__, 3);
|
||||
$referenced = [];
|
||||
foreach (self::texts() as $path => $text) {
|
||||
if (str_ends_with($path, '.php')) {
|
||||
preg_match_all('/topic \\\\?"([a-z0-9-]+)\\\\?"/', $text, $matches);
|
||||
$referenced = array_merge($referenced, $matches[1]);
|
||||
}
|
||||
}
|
||||
|
||||
self::assertContains('divi-shortform', $referenced, 'lit/divi-insert and lit/content-create name divi-shortform');
|
||||
foreach (array_unique($referenced) as $topic) {
|
||||
self::assertFileExists($root . '/docs/guides/' . $topic . '.md', 'guide topic "' . $topic . '"');
|
||||
}
|
||||
}
|
||||
|
||||
public function testOverviewListsExactlyTheOtherGuideTopics(): void
|
||||
{
|
||||
$root = dirname(__DIR__, 3);
|
||||
$overview = (string) file_get_contents($root . '/docs/guides/overview.md');
|
||||
preg_match('/Weitere Themen:(.*?)\n\n/s', $overview, $section);
|
||||
preg_match_all('/`([a-z0-9-]+)`/', $section[1] ?? '', $listed);
|
||||
$listedTopics = array_values(array_diff($listed[1], ['topic', 'lit-guide']));
|
||||
sort($listedTopics);
|
||||
|
||||
$files = array_map(static fn (string $f): string => basename($f, '.md'), glob($root . '/docs/guides/*.md') ?: []);
|
||||
$files = array_values(array_diff($files, ['overview']));
|
||||
sort($files);
|
||||
|
||||
self::assertSame($files, $listedTopics);
|
||||
}
|
||||
|
||||
public function testOverviewListsExactlyTheDirectTools(): void
|
||||
{
|
||||
$overview = (string) file_get_contents(dirname(__DIR__, 3) . '/docs/guides/overview.md');
|
||||
|
||||
Reference in New Issue
Block a user