feat: menu list, get, create and location tools

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-26 00:00:30 +02:00
co-authored by Claude Opus 5.5
parent 236d25325d
commit 1d59d1d2ad
13 changed files with 828 additions and 0 deletions
@@ -0,0 +1,36 @@
<?php
declare(strict_types=1);
namespace LIT\MCP\Tests\Unit\Integrations\WordPress\Menus;
/**
* Shared wp_get_nav_menu_items()-shaped fixture, reused by every menu test
* (tree building, read/write abilities, and the Task 14 menu-set-items tests).
*/
trait MenuFixtures
{
public static function item(
int $id,
int $parent,
string $title,
string $type = 'post_type',
string $url = ''
): object {
return (object) [
'ID' => $id,
'menu_item_parent' => (string) $parent,
'title' => $title,
'post_title' => $type === 'custom' ? $title : '',
'type' => $type,
'object' => $type === 'custom' ? 'custom' : 'page',
'object_id' => (string) ($type === 'custom' ? $id : $id + 100),
'url' => $url,
'description' => '',
'attr_title' => '',
'target' => '',
'classes' => [''],
'xfn' => '',
];
}
}