3 class ResourceLoaderWikiModuleTest
extends ResourceLoaderTestCase
{
6 * @covers ResourceLoaderWikiModule::isKnownEmpty
7 * @dataProvider provideIsKnownEmpty
9 public function testIsKnownEmpty( $titleInfo, $group, $expected ) {
10 $module = $this->getMockBuilder( 'ResourceLoaderWikiModuleTestModule' )
11 ->setMethods( array( 'getTitleInfo', 'getGroup' ) )
13 $module->expects( $this->any() )
14 ->method( 'getTitleInfo' )
15 ->will( $this->returnValue( $titleInfo ) );
16 $module->expects( $this->any() )
17 ->method( 'getGroup' )
18 ->will( $this->returnValue( $group ) );
19 $context = $this->getMockBuilder( 'ResourceLoaderContext' )
20 ->disableOriginalConstructor()
22 $this->assertEquals( $expected, $module->isKnownEmpty( $context ) );
25 public static function provideIsKnownEmpty() {
28 array( array(), 'test1', true ),
29 // 'site' module with a non-empty page
32 'MediaWiki:Common.js' => array(
33 'timestamp' => 123456789,
38 // 'site' module with an empty page
41 'MediaWiki:Monobook.js' => array(
42 'timestamp' => 987654321,
47 // 'user' module with a non-empty page
50 'User:FooBar/common.js' => array(
51 'timestamp' => 246813579,
56 // 'user' module with an empty page
59 'User:FooBar/monobook.js' => array(
60 'timestamp' => 1357924680,