Skip to content

Commit

Permalink
(tests) Backport the test to 1.35
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardspec committed Dec 15, 2024
1 parent 329d25a commit b7561cb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/phpunit/EventCalendarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
* @file
*/

use MediaWiki\MediaWikiServices;

/**
* Integration test of <eventcalendar> tag.
*
Expand Down Expand Up @@ -68,7 +70,7 @@ public function testEventCalendar(
* @return ParserOutput
*/
private function parseCalendarTag( $wikitext ) {
$parser = $this->getServiceContainer()->getParser();
$parser = MediaWikiServices::getInstance()->getParser();
$title = Title::newFromText( 'Title of page with the calendar itself' );
$popt = ParserOptions::newFromAnon();

Expand Down Expand Up @@ -730,7 +732,7 @@ public function testSnippetCacheWasUsed() {
$cache = ObjectCache::getInstance( CACHE_DB );
$cacheKey = $cache->makeKey( 'jscalendar-snippet-' ) . $pageId;

$dbw = $this->getServiceContainer()->getDBLoadBalancer()->getConnection( DB_PRIMARY );
$dbw = MediaWikiServices::getInstance()->getDBLoadBalancer()->getConnection( DB_PRIMARY );
$dbw->insert( 'objectcache', [
'keyname' => $cache->makeKey( 'jscalendar-snippet-' ) . $pageId,
'value' => $expectedSnippet,
Expand Down

0 comments on commit b7561cb

Please sign in to comment.