Skip to content

Commit

Permalink
Assert font of parsed HTML is not null
Browse files Browse the repository at this point in the history
  • Loading branch information
m7913d committed Nov 10, 2024
1 parent 9d7fe28 commit de6bcaa
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/PhpSpreadsheetTests/Helper/HtmlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,15 @@ public function testSTag(): void
self::assertSame(count($elements), 3);

self::assertSame($elements[0]->getText(), 'Hello ');
self::assertTrue($elements[0]->getFont() === null || !$elements[0]->getFont()->getStrikethrough());
self::assertNotNull($elements[0]->getFont());
self::assertFalse($elements[0]->getFont()->getStrikethrough());

self::assertSame($elements[1]->getText(), 'test');
self::assertTrue($elements[1]->getFont() !== null && $elements[1]->getFont()->getStrikethrough());
self::assertNotNull($elements[1]->getFont());
self::assertTrue($elements[1]->getFont()->getStrikethrough());

self::assertSame($elements[2]->getText(), 'world');
self::assertTrue($elements[2]->getFont() === null || !$elements[2]->getFont()->getStrikethrough());
self::assertNotNull($elements[2]->getFont());
self::assertFalse($elements[2]->getFont()->getStrikethrough());
}
}

0 comments on commit de6bcaa

Please sign in to comment.