Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
2092d3a
Fix CI
paladox Apr 12, 2026
1c1faef
Update CacheKeyProviderTest.php
paladox Apr 12, 2026
7f66fe8
Update PreTextFormatterTest.php
paladox Apr 12, 2026
7f93f55
Update MediaWikiContextInteractorTest.php
paladox Apr 12, 2026
297a9c0
Update I18nJsonFileIntegrityTest.php
paladox Apr 12, 2026
c2d2856
Update ReferenceListOutputRendererTest.php
paladox Apr 12, 2026
b769743
Update CitationReferencePositionJournalTest.php
paladox Apr 12, 2026
196dd73
Update HookRegistryTest.php
paladox Apr 12, 2026
6b5a285
Update ReferenceListParserFunctionTest.php
paladox Apr 12, 2026
15e0ce6
Update SciteParserFunctionTest.php
paladox Apr 12, 2026
f83db88
Update ReferenceBacklinksLookupTest.php
paladox Apr 12, 2026
709bfd5
Update ReferenceBacklinksLookupTest.php
paladox Apr 12, 2026
8ba4ea1
Update MediaWikiContextInteractor.php
paladox Apr 12, 2026
74bdce0
Update HookRegistryTest.php
paladox Apr 12, 2026
d0d7bba
Update SemanticCiteJsonTestCaseScriptRunnerTest.php
paladox Apr 12, 2026
b8cceb6
Update ResourceIdentifierStringValue.php
paladox Apr 12, 2026
9cfb2f0
Update CitationReferenceValue.php
paladox Apr 12, 2026
eef8bd9
Update BibtexProcessorTest.php
paladox Apr 12, 2026
9e421e8
Update ReferenceListParserFunction.php
paladox Apr 12, 2026
1c5bd6b
Update SciteParserFunctionTest.php
paladox Apr 12, 2026
997f913
Update BibtexProcessor.php
paladox Apr 12, 2026
ad0fea5
Update SemanticCiteJsonTestCaseScriptRunnerTest.php
paladox Apr 12, 2026
04117ae
Update SciteParserFunction.php
paladox Apr 12, 2026
3bb9469
Update SciteParserFunction.php
paladox Apr 12, 2026
6cdd74e
Update CachedReferenceListOutputRenderer.php
paladox Apr 13, 2026
49641e4
Update CachedReferenceListOutputRenderer.php
paladox Apr 13, 2026
92d842f
Update CachedReferenceListOutputRenderer.php
paladox Apr 13, 2026
1e99617
Update CitationResourceMatchFinder.php
paladox Apr 13, 2026
255aad2
Update CachedReferenceListOutputRenderer.php
paladox Apr 13, 2026
137ce43
Update SemanticCiteJsonTestCaseScriptRunnerTest.php
paladox Apr 13, 2026
3e17c77
Update CachedReferenceListOutputRenderer.php
paladox Apr 13, 2026
5697650
Update CachedReferenceListOutputRenderer.php
paladox Apr 13, 2026
cf57176
Update SemanticCiteJsonTestCaseScriptRunnerTest.php
paladox Apr 13, 2026
5f6adc3
Update SemanticCiteJsonTestCaseScriptRunnerTest.php
paladox Apr 13, 2026
41de048
Update ci.yml
paladox Apr 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ jobs:
strategy:
matrix:
include:
- mediawiki_version: '1.43'
smw_version: 6.0.1
php_version: 8.1
database_type: mysql
database_image: "mariadb:11.2"
coverage: false
experimental: false
- mediawiki_version: '1.43'
smw_version: 6.0.1
php_version: 8.1
Expand All @@ -25,19 +32,19 @@ jobs:
coverage: true
experimental: false
- mediawiki_version: '1.44'
smw_version: 6.0.1
smw_version: dev-master
php_version: 8.2
database_type: mysql
database_image: "mariadb:11.2"
database_image: "mariadb:11.8"
coverage: false
experimental: false
- mediawiki_version: '1.45'
smw_version: dev-master
php_version: 8.3
database_type: mysql
database_image: "mariadb:11.2"
database_image: "mariadb:11.8"
coverage: false
experimental: true
experimental: false

env:
MW_VERSION: ${{ matrix.mediawiki_version }}
Expand Down Expand Up @@ -70,6 +77,3 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/php/coverage.xml
if: matrix.coverage == true



2 changes: 1 addition & 1 deletion src/Bibtex/BibtexProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct( BibtexParser $bibtexParser, BibtexAuthorListParser
public function doProcess( ParserParameterProcessor $parserParameterProcessor ) {

$bibtex = $this->doPreprocess(
$parserParameterProcessor->getParameterValuesFor( 'bibtex' )
$parserParameterProcessor->getParameterValuesByKey( 'bibtex' )
);

$parameters = $this->bibtexParser->parse( $bibtex );
Expand Down
6 changes: 3 additions & 3 deletions src/CachedReferenceListOutputRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private function removeReferenceListPlaceholder( &$text ) {
}

return $text = preg_replace(
"/" . "<div id=\"scite-custom-referencelist\"(.*)?>(<h2>|<span>)(.*)?<\/div>" . "/m",
"/<div id=\"scite-custom-referencelist\"([^>]*)>(?:\\s*<div[^>]*>\\s*)?(<h2|<span)([^>]*>.*?)(?:<\\/div>\\s*)?<\\/div>/s",
'',
$text
);
Expand All @@ -125,8 +125,8 @@ private function addReferenceListToCorrectTextPosition( &$text ) {
// Find out whether to place the list into a custom position or not
if ( strpos( $text, 'scite-custom-referencelist' ) !== false ) {
return $text = preg_replace_callback(
"/" . "<div id=\"scite-custom-referencelist\"(.*)?>(<h2>|<span>)(.*)?<\/div>" . "/m",
'self::getCustomizedRenderedHtmlReferenceList',
"/<div id=\"scite-custom-referencelist\"([^>]*)>(?:\\s*<div[^>]*>\\s*)?(<h2|<span)([^>]*>.*?)(?:<\\/div>\\s*)?<\\/div>/s",
[ $this, 'getCustomizedRenderedHtmlReferenceList' ],
$text
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/CitationResourceMatchFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function findCitationResourceLinks( array $subjects, $linkClass = '', $ca

foreach ( $subjects as $subject ) {

$dataValue = $this->dataValueFactory->newDataItemValue(
$dataValue = $this->dataValueFactory->newDataValueByItem(
$subject,
null
);
Expand Down
2 changes: 1 addition & 1 deletion src/DataValues/CitationReferenceValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function setCaptionFormat( $captionFormat ) {
/**
* @see StringValue::parseUserValue
*/
protected function parseUserValue( $value ) {
protected function parseUserValue( $value ): void {

if ( method_exists( $this, 'getCallable' ) ) {
$citationReferencePositionJournal = $this->getCallable( 'sci.citationreferencepositionjournal' );
Expand Down
2 changes: 1 addition & 1 deletion src/DataValues/ResourceIdentifierStringValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct( $typeid = '' ) {
/**
* @see StringValue::parseUserValue
*/
protected function parseUserValue( $value ) {
protected function parseUserValue( $value ): void {

$inputValue = $value;
// $this->m_caption = $value;
Expand Down
1 change: 1 addition & 0 deletions src/MediaWikiContextInteractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use IContextSource;
use MediaWiki\MediaWikiServices;
use MediaWiki\Title\Title;

/**
* Helper class to avoid making objects depend on the IContextSource and instead
Expand Down
2 changes: 1 addition & 1 deletion src/ReferenceListParserFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ private function doProcessReferenceValues( array $values ) {
$subject = $this->parserData->getSubject();

foreach ( $values as $value ) {
$dataValue = $this->dataValueFactory->newPropertyValue(
$dataValue = $this->dataValueFactory->newDataValueByText(
new DIProperty( PropertyRegistry::SCI_CITE_REFERENCE ),
trim( $value ),
false,
Expand Down
8 changes: 4 additions & 4 deletions src/SciteParserFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public function doProcess( ParserParameterProcessor $parserParameterProcessor, P

// Explicit reference precedes
if ( $parserParameterProcessor->hasParameter( 'reference' ) ) {
$reference = $parserParameterProcessor->getParameterValuesFor( 'reference' );
$reference = $parserParameterProcessor->getParameterValuesByKey( 'reference' );
$reference = end( $reference );
}

Expand All @@ -174,7 +174,7 @@ public function doProcess( ParserParameterProcessor $parserParameterProcessor, P
);

if ( $parserParameterProcessor->hasParameter( 'type' ) ) {
$type = $parserParameterProcessor->getParameterValuesFor( 'type' );
$type = $parserParameterProcessor->getParameterValuesByKey( 'type' );
sort( $type );
$type = end( $type );
}
Expand Down Expand Up @@ -230,7 +230,7 @@ private function tryToMatchCitationTextByPrecept( ParserParameterProcessor $pars

// An explicit template precedes the assignment found for the type
if ( $parserParameterProcessor->hasParameter( 'template' ) ) {
$template = $parserParameterProcessor->getParameterValuesFor( 'template' );
$template = $parserParameterProcessor->getParameterValuesByKey( 'template' );
$template = trim( end( $template ) );
} elseif ( $this->mediaWikiNsContentMapper->findTemplateForType( $type ) !== null ) {
$template = $this->mediaWikiNsContentMapper->findTemplateForType( $type );
Expand Down Expand Up @@ -287,7 +287,7 @@ private function addPropertyValuesFor( ParserParameterProcessor $parserParameter

foreach ( $values as $value ) {

$dataValue = $this->dataValueFactory->newPropertyValue(
$dataValue = $this->dataValueFactory->newDataValueByText(
$property,
trim( $value ),
false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace SCI\Tests\Integration\JSONScript;

use ParserOptions;
use SCI\MediaWikiNsContentMapper;
use SCI\HookRegistry;
use SCI\Options;
Expand Down Expand Up @@ -78,21 +79,21 @@ protected function setUp() : void {
/**
* @see JsonTestCaseScriptRunner::getTestCaseLocation
*/
protected function getRequiredJsonTestCaseMinVersion() {
protected function getRequiredJsonTestCaseMinVersion(): string {
return '0.1';
}

/**
* @see JsonTestCaseScriptRunner::getTestCaseLocation
*/
protected function getTestCaseLocation() {
protected function getTestCaseLocation(): string {
return __DIR__ . '/TestCases';
}

/**
* @see JsonTestCaseScriptRunner::getPermittedSettings
*/
protected function getPermittedSettings() {
protected function getPermittedSettings(): array {
$settings = parent::getPermittedSettings();

return array_merge( $settings, [
Expand All @@ -111,7 +112,7 @@ protected function getPermittedSettings() {
*
* @param JsonTestCaseFileHandler $jsonTestCaseFileHandler
*/
protected function runTestCaseFile( JsonTestCaseFileHandler $jsonTestCaseFileHandler ) {
protected function runTestCaseFile( JsonTestCaseFileHandler $jsonTestCaseFileHandler ): void {
parent::runTestCaseFile( $jsonTestCaseFileHandler );

// On SQLite we don't want DB dead locks due to parallel write access
Expand All @@ -130,12 +131,12 @@ protected function runTestCaseFile( JsonTestCaseFileHandler $jsonTestCaseFileHan
$jsonTestCaseFileHandler->getSettingsFor( 'scigReferenceListType' )
);

$this->createPagesFor(
$this->createPagesFrom(
$jsonTestCaseFileHandler->getListOfProperties(),
SMW_NS_PROPERTY
);

$this->createPagesFor(
$this->createPagesFrom(
$jsonTestCaseFileHandler->getListOfSubjects(),
NS_MAIN
);
Expand Down Expand Up @@ -211,7 +212,12 @@ private function assertParserOutputForCase( $case ) {
// hook is run
$context = new \RequestContext();
$context->setTitle( $subject->getTitle() );
$context->getOutput()->addParserOutput( $parserOutput );
if ( version_compare( MW_VERSION, '1.44', '>=' ) ) {
$parserOptions = ParserOptions::newFromAnon();
$context->getOutput()->addParserOutput( $parserOutput, $parserOptions );
} else {
$context->getOutput()->addParserOutput( $parserOutput );
}

$this->stringValidator->assertThatStringContains(
$case['expected-output']['to-contain'],
Expand Down
9 changes: 2 additions & 7 deletions tests/phpunit/Structure/I18nJsonFileIntegrityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace SCI\Tests\Structure;

use SMW\Tests\Utils\UtilityFactory;
use SMW\Tests\PHPUnitCompat;

/**
* @group semantic-cite
Expand All @@ -16,22 +15,18 @@
*/
class I18nJsonFileIntegrityTest extends \PHPUnit\Framework\TestCase {

use PHPUnitCompat;

/**
* @dataProvider i18nFileProvider
*/
public function testI18NJsonDecodeEncode( $file ) {

$jsonFileReader = UtilityFactory::getInstance()->newJsonFileReader( $file );

$this->assertInternalType(
'integer',
$this->assertIsInt(
$jsonFileReader->getModificationTime()
);

$this->assertInternalType(
'array',
$this->assertIsArray(
$jsonFileReader->read()
);
}
Expand Down
6 changes: 3 additions & 3 deletions tests/phpunit/Unit/Bibtex/BibtexProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function testDoProcess() {
->getMock();

$parserParameterProcessor->expects( $this->once() )
->method( 'getParameterValuesFor' )
->method( 'getParameterValuesByKey' )
->with( $this->equalTo( 'bibtex' ) )
->will( $this->returnValue( [] ) );

Expand Down Expand Up @@ -90,7 +90,7 @@ public function testProcessAuthors() {
->getMock();

$parserParameterProcessor->expects( $this->once() )
->method( 'getParameterValuesFor' )
->method( 'getParameterValuesByKey' )
->with( $this->equalTo( 'bibtex' ) )
->will( $this->returnValue( [ ] ) );

Expand Down Expand Up @@ -144,7 +144,7 @@ public function testDoNotProcess( $parameter ) {
->will( $this->returnValue( true ) );

$parserParameterProcessor->expects( $this->once() )
->method( 'getParameterValuesFor' )
->method( 'getParameterValuesByKey' )
->with( $this->equalTo( 'bibtex' ) )
->will( $this->returnValue( [ ] ) );

Expand Down
11 changes: 4 additions & 7 deletions tests/phpunit/Unit/CacheKeyProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace SCI\Tests;

use SCI\CacheKeyProvider;
use SMW\Tests\PHPUnitCompat;

/**
* @covers \SCI\CacheKeyProvider
Expand All @@ -16,8 +15,6 @@
*/
class CacheKeyProviderTest extends \PHPUnit\Framework\TestCase {

use PHPUnitCompat;

public function testCanConstruct() {

$this->assertInstanceOf(
Expand All @@ -31,22 +28,22 @@ public function testGetKey() {
$instance = new CacheKeyProvider();
$instance->setCachePrefix( 'foo' );

$this->assertContains(
$this->assertStringContainsString(
'foo',
$instance->getCacheKeyForCitationReference( 'abc' )
);

$this->assertContains(
$this->assertStringContainsString(
':ref:',
$instance->getCacheKeyForCitationReference( 123 )
);

$this->assertContains(
$this->assertStringContainsString(
'foo',
$instance->getCacheKeyForReferenceList( 'def' )
);

$this->assertContains(
$this->assertStringContainsString(
':reflist:',
$instance->getCacheKeyForReferenceList( 456 )
);
Expand Down
6 changes: 1 addition & 5 deletions tests/phpunit/Unit/CitationReferencePositionJournalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace SCI\Tests;

use SCI\CitationReferencePositionJournal;
use SMW\Tests\PHPUnitCompat;

/**
* @covers \SCI\CitationReferencePositionJournal
Expand All @@ -16,8 +15,6 @@
*/
class CitationReferencePositionJournalTest extends \PHPUnit\Framework\TestCase {

use PHPUnitCompat;

private $cache;
private $cacheKeyProvider;

Expand Down Expand Up @@ -51,8 +48,7 @@ public function testUnboundReferenceList() {
$instance->buildJournalForUnboundReferenceList( [] )
);

$this->assertInternalType(
'array',
$this->assertIsArray(
$instance->buildJournalForUnboundReferenceList( [ 'foo' ] )
);
}
Expand Down
6 changes: 1 addition & 5 deletions tests/phpunit/Unit/HookRegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use SMW\DataTypeRegistry;
use SMW\DIWikiPage;
use SMW\DIProperty;
use SMW\Tests\PHPUnitCompat;

/**
* @covers \SCI\HookRegistry
Expand All @@ -20,8 +19,6 @@
*/
class HookRegistryTest extends \PHPUnit\Framework\TestCase {

use PHPUnitCompat;

public function testCanConstruct() {

$store = $this->getMockBuilder( '\SMW\Store' )
Expand Down Expand Up @@ -477,8 +474,7 @@ public function doTestRegisteredAfterDeleteSubjectComplete( $instance ) {
}

private function assertThatHookIsExcutable( callable $handler, $arguments = [] ) {
$this->assertInternalType(
'boolean',
$this->assertIsBool(
call_user_func_array( $handler, $arguments )
);
}
Expand Down
Loading
Loading