Merge "Hard deprecate LinkCache::addGoodLinkObj"

This commit is contained in:
jenkins-bot 2021-10-26 15:51:05 +00:00 committed by Gerrit Code Review
commit e0f7759256
3 changed files with 5 additions and 2 deletions

View file

@ -268,6 +268,7 @@ because of Phabricator reports.
::getArchivedRevisionRecord, ::getPreviousRevisionRecord and
::getLastRevisionId.
- Use ArchivedRevisionLookup::hasArchivedRevisions instead of ::isDeleted.
* LinkCache::addGoodLinkObj() has been hard deprecated.
* …
=== Other changes in 1.38 ===

View file

@ -282,6 +282,7 @@ class LinkCache implements LoggerAwareInterface {
public function addGoodLinkObj( $id, $page, $len = -1, $redir = null,
$revision = 0, $model = null, $lang = null
) {
wfDeprecated( __METHOD__, '1.38' );
$this->addGoodLinkObjFromRow( $page, (object)[
'page_id' => (int)$id,
'page_namespace' => $page->getNamespace(),

View file

@ -16,6 +16,7 @@ use Wikimedia\TestingAccessWrapper;
*/
class TitleTest extends MediaWikiIntegrationTestCase {
use DummyServicesTrait;
use LinkCacheTestTrait;
protected function setUp(): void {
parent::setUp();
@ -367,10 +368,10 @@ class TitleTest extends MediaWikiIntegrationTestCase {
* @covers Title::clearCaches
*/
public function testClearCaches() {
$linkCache = MediaWikiServices::getInstance()->getLinkCache();
$linkCache = $this->getServiceContainer()->getLinkCache();
$title1 = Title::newFromText( 'Foo' );
$linkCache->addGoodLinkObj( 23, $title1 );
$this->addGoodLinkObject( 23, $title1 );
Title::clearCaches();