Add testRemoveComment

This commit is contained in:
Dams 2022-06-09 09:08:52 +02:00 committed by GitHub
parent 13437384af
commit 56ddbc4dd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -83,4 +83,12 @@ class CommentTest extends TestCase
$comment->setText($test); $comment->setText($test);
self::assertEquals('This is a test comment', (string) $comment); self::assertEquals('This is a test comment', (string) $comment);
} }
public function testRemoveComment(): void {
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
$sheet->getComment('A2')->getText()->createText('Comment to delete');
$sheet->removeComment('A2');
self::assertEmpty($sheet->getComments());
}
} }