format('hello'); $this->assertCount(1, $result); $this->assertInstanceOf(TextContent::class, $result[0]); $this->assertSame('hello', $result[0]->text); } public function testFormatContentResult(): void { $content = new TextContent('test'); $result = (new ToolResultFormatter())->format($content); $this->assertSame([$content], $result); } public function testFormatArrayResult(): void { $result = (new ToolResultFormatter())->format(['key' => 'value']); $this->assertCount(1, $result); $this->assertInstanceOf(TextContent::class, $result[0]); $this->assertStringContainsString('value', $result[0]->text); } public function testFormatNullResult(): void { $result = (new ToolResultFormatter())->format(null); $this->assertCount(1, $result); $this->assertInstanceOf(TextContent::class, $result[0]); $this->assertSame('(null)', $result[0]->text); } public function testFormatBoolResult(): void { $result = (new ToolResultFormatter())->format(true); $this->assertCount(1, $result); $this->assertInstanceOf(TextContent::class, $result[0]); $this->assertSame('true', $result[0]->text); } }