Avoid deprecated LinkCache::singleton()
[lhc/web/wiklou.git] / tests / phpunit / includes / TitleTest.php
index 75e0c3e..f9ffeae 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * @group Database
  * @group Title
@@ -163,7 +165,7 @@ class TitleTest extends MediaWikiTestCase {
         */
        public function testSecureAndSplitValid( $text ) {
                $this->secureAndSplitGlobals();
-               $this->assertInstanceOf( 'Title', Title::newFromText( $text ), "Valid: $text" );
+               $this->assertInstanceOf( Title::class, Title::newFromText( $text ), "Valid: $text" );
        }
 
        /**
@@ -434,7 +436,7 @@ class TitleTest extends MediaWikiTestCase {
                $this->setContentLang( $contLang );
 
                $title = Title::newFromText( $titleText );
-               $this->assertInstanceOf( 'Title', $title,
+               $this->assertInstanceOf( Title::class, $title,
                        "Test must be passed a valid title text, you gave '$titleText'"
                );
                $this->assertEquals( $expected,
@@ -552,6 +554,7 @@ class TitleTest extends MediaWikiTestCase {
        }
 
        /**
+        * @covers Title::newFromTitleValue
         * @dataProvider provideNewFromTitleValue
         */
        public function testNewFromTitleValue( TitleValue $value ) {
@@ -572,6 +575,7 @@ class TitleTest extends MediaWikiTestCase {
        }
 
        /**
+        * @covers Title::getTitleValue
         * @dataProvider provideGetTitleValue
         */
        public function testGetTitleValue( $text ) {
@@ -603,6 +607,7 @@ class TitleTest extends MediaWikiTestCase {
        }
 
        /**
+        * @covers Title::getFragment
         * @dataProvider provideGetFragment
         *
         * @param string $full
@@ -671,7 +676,7 @@ class TitleTest extends MediaWikiTestCase {
         */
        public function testExists() {
                $title = Title::makeTitle( NS_PROJECT, 'New page' );
-               $linkCache = LinkCache::singleton();
+               $linkCache = MediaWikiServices::getInstance()->getLinkCache();
 
                $article = new Article( $title );
                $page = $article->getPage();
@@ -913,6 +918,7 @@ class TitleTest extends MediaWikiTestCase {
        }
 
        /**
+        * @covers Title::getFragmentForURL
         * @dataProvider provideGetFragmentForURL
         *
         * @param string $titleStr