Ejemplo n.º 1
0
 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());
 }
Ejemplo n.º 2
0
 /**
  * @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());
 }
Ejemplo n.º 3
0
 /**
  * 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());
 }
Ejemplo n.º 4
0
 /**
  * @see TitleFormatter::getText()
  *
  * @param TitleValue $title
  *
  * @return string
  */
 public function getFullText(TitleValue $title)
 {
     return $this->formatTitle($title->getNamespace(), $title->getText(), $title->getFragment());
 }