- 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
47 lines
1.7 KiB
PHP
47 lines
1.7 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Renders every tab of "Einstellungen → LIT MCP" server-side as an administrator and
|
|
* prints one line per tab: "<slug> ok <bytes>" or "<slug> FAIL <reason>".
|
|
*
|
|
* Usage (inside DDEV): wp eval-file wp-content/plugins/WP-LIT-MCP/tests/Integration/admin-render.php
|
|
*
|
|
* No strict_types: wp eval-file runs this through eval().
|
|
*/
|
|
|
|
defined('WP_CLI') && WP_CLI || exit;
|
|
|
|
require_once ABSPATH . 'wp-admin/includes/admin.php';
|
|
|
|
$lit_admins = get_users(['role' => 'administrator', 'number' => 1]);
|
|
wp_set_current_user($lit_admins[0]->ID);
|
|
set_current_screen('settings_page_lit-mcp');
|
|
|
|
// wp eval-file runs without an HTTP request: WP_List_Table (used by the "Protokoll" tab)
|
|
// reads $_SERVER['HTTP_HOST']/['REQUEST_URI'] directly (no isset() guard in WordPress core),
|
|
// so a CLI run needs both set to render it, exactly as a real admin request would have them.
|
|
$_SERVER['HTTP_HOST'] = (string) wp_parse_url(home_url(), PHP_URL_HOST);
|
|
|
|
$lit_page = \LIT\MCP\Plugin::settingsPage();
|
|
if ($lit_page === null) {
|
|
echo "FAIL settings page not built\n";
|
|
exit(1);
|
|
}
|
|
|
|
foreach ($lit_page->tabSlugs() as $lit_slug) {
|
|
$_GET['tab'] = $lit_slug;
|
|
$_SERVER['REQUEST_URI'] = '/wp-admin/options-general.php?page=lit-mcp&tab=' . rawurlencode($lit_slug);
|
|
ob_start();
|
|
try {
|
|
$lit_page->render();
|
|
$lit_html = (string) ob_get_clean();
|
|
} catch (\Throwable $e) {
|
|
ob_end_clean();
|
|
echo $lit_slug . ' FAIL ' . $e->getMessage() . "\n";
|
|
continue;
|
|
}
|
|
|
|
$lit_ok = str_contains($lit_html, 'nav-tab-active') && preg_match('/class="wrap[ "]/', $lit_html) === 1;
|
|
echo $lit_slug . ($lit_ok ? ' ok ' : ' FAIL ') . strlen($lit_html) . "\n";
|
|
}
|