-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d722f60
commit 379ed04
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhpLlm\LlmChain\Tests\Response; | ||
|
||
use PhpLlm\LlmChain\Exception\InvalidArgumentException; | ||
use PhpLlm\LlmChain\Response\ToolCall; | ||
use PhpLlm\LlmChain\Response\ToolCallResponse; | ||
use PHPUnit\Framework\Attributes\CoversClass; | ||
use PHPUnit\Framework\Attributes\Small; | ||
use PHPUnit\Framework\Attributes\Test; | ||
use PHPUnit\Framework\Attributes\UsesClass; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
#[CoversClass(ToolCallResponse::class)] | ||
#[UsesClass(ToolCall::class)] | ||
#[Small] | ||
final class TollCallResponseTest extends TestCase | ||
{ | ||
#[Test] | ||
public function throwsIfNoToolCall(): void | ||
{ | ||
$this->expectException(InvalidArgumentException::class); | ||
$this->expectExceptionMessage('Response must have at least one tool call.'); | ||
|
||
new ToolCallResponse(); | ||
} | ||
|
||
#[Test] | ||
public function getContent(): void | ||
{ | ||
$response = new ToolCallResponse($toolCall = new ToolCall('ID', 'name', ['foo' => 'bar'])); | ||
self::assertSame([$toolCall], $response->getContent()); | ||
} | ||
} |