getClass(); $page = $this->getExistingTestPage( 'Saturn' ); $restriction = new $class( 1, NS_MAIN ); $this->assertTrue( $restriction->matches( $page->getTitle() ) ); $page = $this->getExistingTestPage( 'Talk:Saturn' ); $this->assertFalse( $restriction->matches( $page->getTitle() ) ); } public function testGetType() { $class = $this->getClass(); $restriction = new $class( 1, 2 ); $this->assertEquals( 'ns', $restriction->getType() ); } /** * {@inheritdoc} */ protected function getClass() { return NamespaceRestriction::class; } }