public function testConstruction() { $title = new TitleValue(NS_USER, 'TestThis', 'stuff'); $this->assertEquals(NS_USER, $title->getNamespace()); $this->assertEquals('TestThis', $title->getText()); $this->assertEquals('stuff', $title->getFragment()); }
/** * @dataProvider goodConstructorProvider */ public function testConstruction($ns, $text, $fragment, $interwiki, $hasFragment, $hasInterwiki) { $title = new TitleValue($ns, $text, $fragment, $interwiki); $this->assertEquals($ns, $title->getNamespace()); $this->assertTrue($title->inNamespace($ns)); $this->assertEquals($text, $title->getText()); $this->assertEquals($fragment, $title->getFragment()); $this->assertEquals($hasFragment, $title->hasFragment()); $this->assertEquals($interwiki, $title->getInterwiki()); $this->assertEquals($hasInterwiki, $title->isExternal()); }
/** * Create a new Title from a TitleValue * * @param TitleValue $titleValue Assumed to be safe. * * @return Title */ public static function newFromTitleValue(TitleValue $titleValue) { return self::makeTitle($titleValue->getNamespace(), $titleValue->getText(), $titleValue->getFragment()); }
/** * @see TitleFormatter::getText() * * @param TitleValue $title * * @return string */ public function getFullText(TitleValue $title) { return $this->formatTitle($title->getNamespace(), $title->getText(), $title->getFragment()); }