summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/skins/SkinTemplateTest.php
blob: baa995d4e65315d75ae79720b9224bcfddf8de73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php

/**
 * @covers SkinTemplate
 *
 * @group Output
 *
 * @licence GNU GPL v2+
 * @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 array(
			array(
				'<li class="class" title="itemtitle"><a href="url" title="title">text</a></li>',
				'',
				array(
					'class' => 'class',
					'itemtitle' => 'itemtitle',
					'href' => 'url',
					'title' => 'title',
					'text' => 'text'
				),
				array(),
				'Test makteListItem with normal values'
			)
		);
	}
}