Additional unit tests
This commit is contained in:
parent
3a960d62a6
commit
93fe84da71
|
|
@ -4,6 +4,7 @@ namespace PhpOffice\PhpSpreadsheetTests;
|
||||||
|
|
||||||
use PhpOffice\PhpSpreadsheet\Comment;
|
use PhpOffice\PhpSpreadsheet\Comment;
|
||||||
use PhpOffice\PhpSpreadsheet\RichText\RichText;
|
use PhpOffice\PhpSpreadsheet\RichText\RichText;
|
||||||
|
use PhpOffice\PhpSpreadsheet\RichText\TextElement;
|
||||||
use PhpOffice\PhpSpreadsheet\Style\Alignment;
|
use PhpOffice\PhpSpreadsheet\Style\Alignment;
|
||||||
use PhpOffice\PhpSpreadsheet\Style\Color;
|
use PhpOffice\PhpSpreadsheet\Style\Color;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
@ -73,4 +74,13 @@ class CommentTest extends TestCase
|
||||||
$comment->setAlignment(Alignment::HORIZONTAL_CENTER);
|
$comment->setAlignment(Alignment::HORIZONTAL_CENTER);
|
||||||
self::assertEquals(Alignment::HORIZONTAL_CENTER, $comment->getAlignment());
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue