- search_inventory: global search across all 6 entity types - get_entity_history + get_activity_log: audit trail access - 4 comment tools: list, create, resolve, unresolved count - 3 custom field tools: list values, upsert, delete - 2 document tools: list, delete (upload via REST only) - 6 model type tools: list, get, create, update, delete, sync - 69 MCP tests pass total Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
45 lines
1.3 KiB
PHP
45 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Tests\Mcp\Tool;
|
|
|
|
use App\Tests\AbstractApiTestCase;
|
|
|
|
/**
|
|
* @internal
|
|
*/
|
|
class HistoryToolsTest extends AbstractApiTestCase
|
|
{
|
|
public function testGetActivityLog(): void
|
|
{
|
|
$session = $this->createMcpClient('ROLE_VIEWER');
|
|
|
|
$data = $this->callMcpTool($session, 'get_activity_log');
|
|
|
|
$this->assertArrayHasKey('_parsed', $data);
|
|
$this->assertArrayHasKey('items', $data['_parsed']);
|
|
$this->assertArrayHasKey('total', $data['_parsed']);
|
|
$this->assertArrayHasKey('page', $data['_parsed']);
|
|
$this->assertArrayHasKey('limit', $data['_parsed']);
|
|
$this->assertArrayHasKey('pageCount', $data['_parsed']);
|
|
$this->assertIsArray($data['_parsed']['items']);
|
|
}
|
|
|
|
public function testGetEntityHistory(): void
|
|
{
|
|
$machine = $this->createMachine(name: 'History Machine');
|
|
$session = $this->createMcpClient('ROLE_VIEWER');
|
|
|
|
$data = $this->callMcpTool($session, 'get_entity_history', [
|
|
'entityType' => 'machine',
|
|
'entityId' => $machine->getId(),
|
|
]);
|
|
|
|
$this->assertArrayHasKey('_parsed', $data);
|
|
$this->assertArrayHasKey('items', $data['_parsed']);
|
|
$this->assertArrayHasKey('total', $data['_parsed']);
|
|
$this->assertIsArray($data['_parsed']['items']);
|
|
}
|
|
}
|