diff --git a/.env-39 b/.env-39 index 405353e..1ae5a8f 100644 --- a/.env-39 +++ b/.env-39 @@ -1,4 +1,4 @@ -MW_VERSION?=1.39 +MW_VERSION?=1.43 PHP_VERSION?=8.1 DB_TYPE?=mysql -DB_IMAGE?="mariadb:latest" \ No newline at end of file +DB_IMAGE?="mariadb:latest" diff --git a/.github/workflows/FUNDING.yml b/.github/FUNDING.yml similarity index 100% rename from .github/workflows/FUNDING.yml rename to .github/FUNDING.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6fc9f9d..7360e09 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,52 +17,36 @@ jobs: strategy: matrix: include: - - mediawiki_version: '1.39' - smw_version: '4.2.0' - pf_version: '5.9' + - mediawiki_version: '1.43' + smw_version: '6.0.1' + pf_version: '6.0' php_version: 8.1 database_type: mysql database_image: "mariadb:11.2" coverage: false experimental: false - - mediawiki_version: '1.39' - smw_version: dev-master - pf_version: '5.9' + - mediawiki_version: '1.43' + smw_version: '6.0.1' + pf_version: '6.0' php_version: 8.1 database_type: mysql database_image: "mysql:8" - coverage: false - experimental: false - - mediawiki_version: '1.40' - smw_version: '4.2.0' - pf_version: '5.9' - php_version: 8.1 - database_type: mysql - database_image: "mariadb:11.2" coverage: true experimental: false - - mediawiki_version: '1.41' + - mediawiki_version: '1.44' smw_version: dev-master - pf_version: '5.9' - php_version: 8.1 + pf_version: '6.0' + php_version: 8.2 database_type: mysql - database_image: "mariadb:11.2" + database_image: "mariadb:11.8" coverage: false experimental: false - - mediawiki_version: '1.42' + - mediawiki_version: '1.45' smw_version: dev-master - pf_version: '5.9' - php_version: 8.1 + pf_version: '6.0' + php_version: 8.3 database_type: mysql - database_image: "mariadb:11.2" - coverage: false - experimental: false - - mediawiki_version: '1.43' - smw_version: dev-master - pf_version: '5.9' - php_version: 8.1 - database_type: mysql - database_image: "mariadb:11.2" + database_image: "mariadb:11.8" coverage: false experimental: false diff --git a/Makefile b/Makefile index 7eedeb6..97aa9d4 100644 --- a/Makefile +++ b/Makefile @@ -11,14 +11,14 @@ endif EXTENSION := SemanticFormsSelect # docker images -MW_VERSION?=1.39 +MW_VERSION?=1.43 PHP_VERSION?=8.1 -DB_TYPE?=sqlite -DB_IMAGE?="" +DB_TYPE?=mysql +DB_IMAGE?="mariadb:11.2" # extensions -SMW_VERSION?=dev-master -PF_VERSION?=5.9 +SMW_VERSION?=6.0.1 +PF_VERSION?=6.0 # composer # Enables "composer update" inside of extension @@ -30,4 +30,3 @@ NODE_JS?=true # check for build dir and git submodule init if it does not exist include build/Makefile - diff --git a/composer.json b/composer.json index 5ef50cf..ce61c68 100644 --- a/composer.json +++ b/composer.json @@ -37,11 +37,10 @@ } ], "require": { - "php": ">=7.4", + "php": ">=8.1", "composer/installers": ">=1.0.1" }, "require-dev": { - "mediawiki/semantic-media-wiki": "@dev", "mediawiki/minus-x": "1.1.3", "php-parallel-lint/php-console-highlighter": "1.0.0", "php-parallel-lint/php-parallel-lint": "1.4.0" @@ -72,8 +71,8 @@ "@phpunit-coverage" ], "lint": "parallel-lint . --exclude vendor --exclude node_modules --exclude extensions", - "phpunit": "php ../../tests/phpunit/phpunit.php -c phpunit.xml.dist", - "phpunit-coverage": "php ../../tests/phpunit/phpunit.php -c phpunit.xml.dist --testdox --coverage-text --coverage-html coverage/php --coverage-clover coverage/php/coverage.xml", + "phpunit": "php ${MW_INSTALL_PATH:-../..}/tests/phpunit/phpunit.php -c phpunit.xml.dist", + "phpunit-coverage": "php ${MW_INSTALL_PATH:-../..}/tests/phpunit/phpunit.php -c phpunit.xml.dist --testdox --coverage-text --coverage-clover coverage/php/coverage.xml", "post-test-coverage": [ "sed -i 's|/var/www/html/extensions/SemanticFormsSelect/||g' coverage/php/coverage.xml", "find coverage/php -type f -name '*.html' -exec sed -i 's|/var/www/html/extensions/||g' {} +" diff --git a/extension.json b/extension.json index 322ecf1..ce95ac6 100644 --- a/extension.json +++ b/extension.json @@ -14,7 +14,7 @@ "license-name": "GPL-2.0-or-later", "type": "semantic", "requires": { - "MediaWiki": ">= 1.39" + "MediaWiki": ">= 1.43" }, "AutoloadClasses": { "SFS\\Hooks": "SemanticFormsSelect.hooks.php", diff --git a/src/ApiSemanticFormsSelect.php b/src/ApiSemanticFormsSelect.php index 380bcfc..14291b7 100644 --- a/src/ApiSemanticFormsSelect.php +++ b/src/ApiSemanticFormsSelect.php @@ -14,10 +14,10 @@ use ApiBase; use MediaWiki\MediaWikiServices; +use MediaWiki\Title\Title; use Parser; use ParserOptions; use ParserOutput; -use Title; class ApiSemanticFormsSelect extends ApiBase { diff --git a/tests/phpunit/Unit/ApiSemanticFormsSelectRequestProcessorTest.php b/tests/phpunit/Unit/ApiSemanticFormsSelectRequestProcessorTest.php index 67753c2..fedc372 100644 --- a/tests/phpunit/Unit/ApiSemanticFormsSelectRequestProcessorTest.php +++ b/tests/phpunit/Unit/ApiSemanticFormsSelectRequestProcessorTest.php @@ -2,11 +2,11 @@ namespace SFS\Tests; +use MediaWiki\Api\ApiMain; +use MediaWiki\Context\RequestContext; +use MediaWiki\Request\WebRequest; +use MediaWiki\Request\FauxRequest; use SFS\ApiSemanticFormsSelectRequestProcessor; -use ApiMain; -use RequestContext; -use WebRequest; -use FauxRequest; /** * @covers \SFS\ApiSemanticFormsSelectRequestProcessor diff --git a/tests/phpunit/Unit/ApiSemanticFormsSelectTest.php b/tests/phpunit/Unit/ApiSemanticFormsSelectTest.php index 5c76e31..1057a6b 100644 --- a/tests/phpunit/Unit/ApiSemanticFormsSelectTest.php +++ b/tests/phpunit/Unit/ApiSemanticFormsSelectTest.php @@ -2,11 +2,11 @@ namespace SFS\Tests; +use MediaWiki\Api\ApiMain; +use MediaWiki\Context\RequestContext; +use MediaWiki\Request\WebRequest; +use MediaWiki\Request\FauxRequest; use SFS\ApiSemanticFormsSelect; -use ApiMain; -use RequestContext; -use WebRequest; -use FauxRequest; /** * @covers \SFS\ApiSemanticFormsSelect diff --git a/tests/phpunit/Unit/SelectFieldTest.php b/tests/phpunit/Unit/SelectFieldTest.php index 8b35624..15196d2 100644 --- a/tests/phpunit/Unit/SelectFieldTest.php +++ b/tests/phpunit/Unit/SelectFieldTest.php @@ -9,11 +9,10 @@ namespace SFS\Tests; use MediaWiki\MediaWikiServices; +use MediaWiki\Title\Title; use Parser; -use SFS\SelectField; - use ParserOptions; -use Title; +use SFS\SelectField; /** * @covers \SFS\SelectField @@ -256,13 +255,7 @@ protected function setUp(): void { $name = $user->getName(); $parserOption; - if ( version_compare( MW_VERSION, '1.39', '>=' ) ) { - //check if version is higher than 1.39, or the same (the getOption() function within ParserOptions is different then in MW 1.35) - $parserOption = new ParserOptions( $user ); - } else { - //if MW version is lower than 1.39 - $parserOption = new ParserOptions( $name ); - } + $parserOption = new ParserOptions( $user ); $parser = MediaWikiServices::getInstance()->getParser(); $parser->setOutputType(Parser::OT_HTML); $parser->setTitle( Title::newFromText( 'NO TITLE' ) ); @@ -277,5 +270,4 @@ protected function tearDown(): void { parent::tearDown(); } - }