Due to T127238, files in various */skins/* directories are not checked by PHPCS. Temporarily removed the exclude rule from phpcs.xml and ran: composer fix includes/skins/* tests/phpunit/includes/skins/* tests/phpunit/skins/* Change-Id: I9240c1cee825920b6634903282be6252cce55686
42 lines
829 B
PHP
42 lines
829 B
PHP
<?php
|
|
|
|
/**
|
|
* @covers SkinTemplate
|
|
*
|
|
* @group Output
|
|
*
|
|
* @author Bene* < benestar.wikimedia@gmail.com >
|
|
*/
|
|
|
|
class SkinTemplateTest extends MediaWikiTestCase {
|
|
/**
|
|
* @dataProvider makeListItemProvider
|
|
*/
|
|
public function testMakeListItem( $expected, $key, $item, $options, $message ) {
|
|
$template = $this->getMockForAbstractClass( 'BaseTemplate' );
|
|
|
|
$this->assertEquals(
|
|
$expected,
|
|
$template->makeListItem( $key, $item, $options ),
|
|
$message
|
|
);
|
|
}
|
|
|
|
public function makeListItemProvider() {
|
|
return [
|
|
[
|
|
'<li class="class" title="itemtitle"><a href="url" title="title">text</a></li>',
|
|
'',
|
|
[
|
|
'class' => 'class',
|
|
'itemtitle' => 'itemtitle',
|
|
'href' => 'url',
|
|
'title' => 'title',
|
|
'text' => 'text'
|
|
],
|
|
[],
|
|
'Test makteListItem with normal values'
|
|
]
|
|
];
|
|
}
|
|
}
|