9 use MediaWikiCoversValidator;
14 'modules' =>
'test.context',
26 $this->assertEquals( $derived->getDebug(),
false );
27 $this->assertEquals( $derived->getLanguage(),
'zh' );
28 $this->assertEquals( $derived->getModules(), [
'test.context' ] );
29 $this->assertEquals( $derived->getOnly(),
'scripts' );
30 $this->assertEquals( $derived->getSkin(),
'fallback' );
31 $this->assertEquals( $derived->getUser(), null );
34 $this->assertEquals( $derived->getDirection(),
'ltr' );
35 $this->assertEquals( $derived->getHash(),
'zh|fallback|||scripts|||||' );
41 $derived->setModules( [
'test.override' ] );
42 $this->assertEquals( $derived->getModules(), [
'test.override' ] );
49 $derived->setLanguage(
'nl' );
50 $this->assertEquals( $derived->getLanguage(),
'nl' );
56 $derived->setLanguage(
'nl' );
57 $this->assertEquals( $derived->getDirection(),
'ltr' );
59 $derived->setLanguage(
'he' );
60 $this->assertEquals( $derived->getDirection(),
'rtl' );
62 $derived->setDirection(
'ltr' );
63 $this->assertEquals( $derived->getDirection(),
'ltr' );
69 $derived->setSkin(
'override' );
70 $this->assertEquals( $derived->getSkin(),
'override' );
76 $derived->setUser(
'Example' );
77 $this->assertEquals( $derived->getUser(),
'Example' );
83 $derived->setDebug(
true );
84 $this->assertEquals( $derived->getDebug(),
true );
90 $derived->setOnly(
'styles' );
91 $this->assertEquals( $derived->getOnly(),
'styles' );
93 $derived->setOnly(
null );
94 $this->assertEquals( $derived->getOnly(), null );
100 $derived->setVersion(
'hw1' );
101 $this->assertEquals( $derived->getVersion(),
'hw1' );
107 $derived->setRaw(
true );
108 $this->assertEquals( $derived->getRaw(),
true );
114 $this->assertEquals( $derived->getHash(),
'zh|fallback|||scripts|||||' );
116 $derived->setLanguage(
'nl' );
117 $derived->setUser(
'Example' );
119 $this->assertEquals( $derived->getHash(),
'nl|fallback||Example|scripts|||||' );
125 $this->assertNull( $derived->getContentOverrideCallback() );
127 $override =
function (
Title $t ) {
130 $derived->setContentOverrideCallback( $override );
131 $this->assertSame( $override, $derived->getContentOverrideCallback() );
134 $this->assertSame( $override, $derived2->getContentOverrideCallback() );
140 $this->assertSame( $derived->getRequest(),
$context->getRequest() );
141 $this->assertSame( $derived->getResourceLoader(),
$context->getResourceLoader() );