+
+ /**
+ * @covers Title::newMainPage
+ */
+ public function testNewMainPage() {
+ $msgCache = TestingAccessWrapper::newFromClass( MessageCache::class );
+ $msgCache->instance = $this->createMock( MessageCache::class );
+ $msgCache->instance->method( 'get' )->willReturn( 'Foresheet' );
+ $msgCache->instance->method( 'transform' )->willReturn( 'Foresheet' );
+
+ $this->assertSame(
+ 'Foresheet',
+ Title::newMainPage()->getText()
+ );
+ }
+
+ /**
+ * @covers Title::newMainPage
+ */
+ public function testNewMainPageWithLocal() {
+ $local = $this->createMock( MessageLocalizer::class );
+ $local->method( 'msg' )->willReturn( new RawMessage( 'Prime Article' ) );
+
+ $this->assertSame(
+ 'Prime Article',
+ Title::newMainPage( $local )->getText()
+ );
+ }