Page MenuHomeWickedGov Phorge

NamespaceRestrictionTest.php
No OneTemporary

Size
950 B
Referenced Files
None
Subscribers
None

NamespaceRestrictionTest.php

<?php
namespace MediaWiki\Tests\Block\Restriction;
use MediaWiki\Block\Restriction\NamespaceRestriction;
/**
* @group Database
* @group Blocking
* @covers \MediaWiki\Block\Restriction\AbstractRestriction
* @covers \MediaWiki\Block\Restriction\NamespaceRestriction
*/
class NamespaceRestrictionTest extends RestrictionTestCase {
public function testMatches() {
$class = $this->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;
}
}

File Metadata

Mime Type
text/x-php
Expires
Tue, Aug 18, 18:40 (3 w, 13 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
02/b4/a04bc157bae8c4d4c6a823816018
Default Alt Text
NamespaceRestrictionTest.php (950 B)

Event Timeline