feat: structured errors with hint, ToolResult, cursor pagination
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:
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace LIT\MCP\Tests\Unit;
|
||||
|
||||
use Brain\Monkey;
|
||||
use Brain\Monkey\Functions;
|
||||
use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
|
||||
use PHPUnit\Framework\TestCase as BaseTestCase;
|
||||
|
||||
@@ -16,6 +17,18 @@ abstract class TestCase extends BaseTestCase
|
||||
{
|
||||
parent::setUp();
|
||||
Monkey\setUp();
|
||||
|
||||
// Pure helpers with obvious behaviour. Never use Functions\expect() on these
|
||||
// names in a test: Brain Monkey forbids a stub and an expectation for the
|
||||
// same function. Functions\when() may still redefine them.
|
||||
Functions\stubs([
|
||||
'wp_json_encode' => static fn ($data, int $flags = 0) => json_encode($data, $flags),
|
||||
'is_wp_error' => static fn ($thing): bool => $thing instanceof \WP_Error,
|
||||
'absint' => static fn ($value): int => abs((int) $value),
|
||||
'wp_slash' => static fn ($value) => $value,
|
||||
'wp_unslash' => static fn ($value) => $value,
|
||||
'sanitize_text_field' => static fn ($value): string => trim(strip_tags((string) $value)),
|
||||
]);
|
||||
}
|
||||
|
||||
protected function tearDown(): void
|
||||
|
||||
Reference in New Issue
Block a user