-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTextTest.php
More file actions
53 lines (41 loc) · 1.35 KB
/
TextTest.php
File metadata and controls
53 lines (41 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
namespace Tests\Utopia\Agents\Messages;
use PHPUnit\Framework\TestCase;
use Utopia\Agents\Message;
use Utopia\Agents\Messages\Text;
class TextTest extends TestCase
{
public function testConstructor(): void
{
$content = 'Hello, world!';
$message = new Text($content);
$this->assertInstanceOf(Message::class, $message);
$this->assertInstanceOf(Text::class, $message);
}
public function testGetContent(): void
{
$content = 'Test message content';
$message = new Text($content);
$this->assertSame($content, $message->getContent());
$this->assertIsString($message->getContent());
}
public function testEmptyContent(): void
{
$message = new Text('');
$this->assertSame('', $message->getContent());
$this->assertIsString($message->getContent());
}
public function testMultilineContent(): void
{
$content = "Line 1\nLine 2\nLine 3";
$message = new Text($content);
$this->assertSame($content, $message->getContent());
$this->assertStringContainsString("\n", $message->getContent());
}
public function testSpecialCharacters(): void
{
$content = 'Special chars: !@#$%^&*()_+ 😀 🌟';
$message = new Text($content);
$this->assertSame($content, $message->getContent());
}
}