Skip to content

Commit

Permalink
(tests) Backport the tests to 1.35-1.38 (for REL1_35 branch)
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardspec committed Dec 16, 2024
1 parent 0e0a257 commit f85c582
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [8.1]
branch: [REL1_39, REL1_40, REL1_41, REL1_42, REL1_43]
php: [7.4]
branch: [REL1_35, REL1_36, REL1_37, REL1_38]

env:
branch: ${{ matrix.branch }}
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
with:
php-version: ${{ matrix.php }}
extensions: mbstring, intl, opcache, mysqli
tools: composer
tools: composer:v1
- uses: edwardspec/github-action-build-mediawiki@v1
with:
branch: ${{ env.branch }}
Expand Down
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 f85c582

Please sign in to comment.