mwNamespaceInfo = $this->createMock( MwNamespaceInfo::class ); $this->namespaceInfo = new NamespaceInfo( $this->mwNamespaceInfo ); } public function testGetCanonicalName() { $this->mwNamespaceInfo->expects( $this->any() ) ->method( 'getCanonicalName' ) ->with( NS_MAIN ) ->willReturn( '' ); $this->assertSame( '', $this->namespaceInfo->getCanonicalName( NS_MAIN ) ); } public function testGetValidNamespaces() { $this->mwNamespaceInfo->expects( $this->any() ) ->method( 'getValidNamespaces' ) ->willReturn( [ NS_MAIN ] ); $this->assertSame( [ NS_MAIN ], $this->namespaceInfo->getValidNamespaces() ); } public function testGetSubject() { $this->mwNamespaceInfo->expects( $this->any() ) ->method( 'getSubject' ) ->with( NS_TALK ) ->willReturn( NS_MAIN ); $this->assertSame( NS_MAIN, $this->mwNamespaceInfo->getSubject( NS_TALK ) ); } }