mirror of
https://github.com/diocloid/LinkTitles.git
synced 2025-07-13 17:59:29 +02:00
32 lines
828 B
PHP
32 lines
828 B
PHP
<?php
|
|
/**
|
|
* @group bovender
|
|
*/
|
|
class SplitterTest extends MediaWikiTestCase {
|
|
/**
|
|
* @dataProvider provideSplitData
|
|
*/
|
|
public function testSplit( $input, $expectedOutput ) {
|
|
$splitter = LinkTitles\Splitter::default();
|
|
$this->assertSame( $expectedOutput, $splitter->split( $input ) );
|
|
}
|
|
|
|
// TODO: Add more examples.
|
|
public static function provideSplitData() {
|
|
return [
|
|
[
|
|
'this may be linked [[this may not be linked]]',
|
|
[ 'this may be linked ', '[[this may not be linked]]', '' ]
|
|
],
|
|
[
|
|
'this may be linked <gallery>this may not be linked</gallery>',
|
|
[ 'this may be linked ', '<gallery>this may not be linked</gallery>', '' ]
|
|
],
|
|
[
|
|
'this may be linked {{mytemplate|param={{transcluded}}}}',
|
|
[ 'this may be linked ', '{{mytemplate|param={{transcluded}}}}', '' ]
|
|
],
|
|
];
|
|
}
|
|
}
|