intro

' .'

21 Finding the Hearthburrow

x

' .'

+ Appendix — Timing

'; $out = (new ChapterOutline())->process($html); self::assertSame('21', $out['sections'][0]['num']); self::assertSame('Finding the Hearthburrow', $out['sections'][0]['title']); self::assertSame('section-1-finding-the-hearthburrow', $out['sections'][0]['id']); self::assertSame('+', $out['sections'][1]['num']); self::assertSame('Appendix — Timing', $out['sections'][1]['title']); self::assertStringContainsString('

', $out['html']); self::assertStringContainsString('

intro

', $out['html']); } public function testChapterWithoutSectionsIsUntouched(): void { $out = (new ChapterOutline())->process('

plain

'); self::assertSame([], $out['sections']); self::assertSame('

plain

', $out['html']); } }