Additional unit tests

This commit is contained in:
MarkBaker 2020-11-02 20:14:44 +01:00
parent 3a960d62a6
commit 93fe84da71
1 changed files with 10 additions and 0 deletions

View File

@ -4,6 +4,7 @@ namespace PhpOffice\PhpSpreadsheetTests;
use PhpOffice\PhpSpreadsheet\Comment;
use PhpOffice\PhpSpreadsheet\RichText\RichText;
use PhpOffice\PhpSpreadsheet\RichText\TextElement;
use PhpOffice\PhpSpreadsheet\Style\Alignment;
use PhpOffice\PhpSpreadsheet\Style\Color;
use PHPUnit\Framework\TestCase;
@ -73,4 +74,13 @@ class CommentTest extends TestCase
$comment->setAlignment(Alignment::HORIZONTAL_CENTER);
self::assertEquals(Alignment::HORIZONTAL_CENTER, $comment->getAlignment());
}
public function testSetText(): void
{
$comment = new Comment();
$test = new RichText();
$test->addText(new TextElement('This is a test comment'));
$comment->setText($test);
self::assertEquals('This is a test comment', (string) $comment);
}
}