. */ declare(strict_types=1); namespace Fisharebest\Webtrees; use PHPUnit\Framework\Attributes\CoversClass; #[CoversClass(Note::class)] class NoteTest extends TestCase { protected static bool $uses_database = true; /** * Test that the class exists */ public function testClassExists(): void { self::assertTrue(class_exists(Note::class)); } public function testNoteName(): void { $tree = $this->createMock(Tree::class); $note = new Note('X123', "0 @X123@ NOTE 1\n1 CONT\n1 CONT 2\n1 CONT 3\n1 CONT 4", null, $tree); self::assertSame('1', $note->fullName()); } public function testNoteNameWithHtmlEntities(): void { $tree = $this->createMock(Tree::class); $text = '"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt." "a quote"'; $note = new Note('X123', '0 @X123@ NOTE ' . $text, null, $tree); self::assertSame('"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt." "a quot…', $note->fullName()); } }