Kartographer
Extension that adds maps to wiki pages
Loading...
Searching...
No Matches
Kartographer\Tests\KartographerTest Class Reference

@group Kartographer @group Database @covers \Kartographer\Tag\ErrorReporter @covers \Kartographer\Tag\LegacyTagHandler @covers \Kartographer\Tag\LegacyMapFrame @covers \Kartographer\Tag\LegacyMapLink @license MIT More...

+ Inheritance diagram for Kartographer\Tests\KartographerTest:
+ Collaboration diagram for Kartographer\Tests\KartographerTest:

Public Member Functions

 testTagData ( $expected, string $input, string $message, bool $wikivoyageMode=false)
 @dataProvider provideTagData
 
 testTagDataParsoid ( $expected, string $input, string $message, bool $wikivoyageMode=false, ?string $parsoid=null)
 @dataProvider provideTagData
 
 testBothTrackingCategories ()
 
 testBothTrackingCategoriesParsoid ()
 
 testSrcOffsetsDoNotCrash ()
 There are three ways of handling srcOffsets in the extension: a/ do nothing b/ pass srcOffsets for the embedded wikitext c/ reset the frame.
 
 testNoTrackingCategories ()
 
 testNoTrackingCategoriesParsoid ()
 
 testResourceModules (string $input, array $expectedModules, array $expectedStyles)
 @dataProvider provideResourceModulesData
 
 testResourceModulesParsoid (string $input, array $expectedModules, array $expectedStyles)
 @dataProvider provideResourceModulesData
 
 testImagePreview ()
 
 testLiveData (string $wikitext, array $expected, bool $isPreview=false, bool $isSectionPreview=false, bool $wikivoyageMode=false)
 @dataProvider provideLiveData
 
 testLiveDataParsoid (string $wikitext, array $expected, bool $isPreview=false, bool $isSectionPreview=false, bool $wikivoyageMode=false)
 @dataProvider provideLiveData
 
 testPageProps (string $text, ?int $frames, ?int $links)
 @dataProvider providePageProps
 
 testGroupNames (array $expected, string $input)
 @dataProvider provideGroupNames
 
 testInvalidGroupNames (string $input)
 @dataProvider provideInvalidGroupNames
 

Static Public Member Functions

static provideTagData ()
 
static provideResourceModulesData ()
 
static provideLiveData ()
 
static providePageProps ()
 
static provideGroupNames ()
 
static provideInvalidGroupNames ()
 

Protected Member Functions

 setUp ()
 

Detailed Description

@group Kartographer @group Database @covers \Kartographer\Tag\ErrorReporter @covers \Kartographer\Tag\LegacyTagHandler @covers \Kartographer\Tag\LegacyMapFrame @covers \Kartographer\Tag\LegacyMapLink @license MIT

Member Function Documentation

◆ provideTagData()

static Kartographer\Tests\KartographerTest::provideTagData ( )
static

@noinspection HtmlUnknownTarget

◆ testSrcOffsetsDoNotCrash()

Kartographer\Tests\KartographerTest::testSrcOffsetsDoNotCrash ( )

There are three ways of handling srcOffsets in the extension: a/ do nothing b/ pass srcOffsets for the embedded wikitext c/ reset the frame.

Doing nothing fails parserTests introduced when fixing T362034). Passing srcOffsets is very error-prone since the wikitext content can be normalized (stripped spaces, converted entities) and simply passing them blindly can crash the rendering on UTF-8 boundary issues (see T373460). This test ensures that if the srcOffsets are reintroduced at some point, they avoid the pitfalls we already ran into.


The documentation for this class was generated from the following file: