Skip to content

Commit

Permalink
Test against REL1_40 (#423)
Browse files Browse the repository at this point in the history
* Test against REL1_40

* Update ManageWikiInstaller.php

* Update ManageWikiFormFactoryBuilder.php

* Update ManageWikiFormFactory.php
  • Loading branch information
paladox authored Sep 17, 2023
1 parent 0155021 commit dacd00d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/mediawiki-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,20 @@ jobs:
strategy:
matrix:
include:
# Latest MediaWiki stable - PHP 7.4
# Latest Old MediaWiki stable - PHP 7.4
- mw: 'REL1_39'
php: 7.4
php-docker: 74
composer-test: true
experimental: false

# Latest MediaWiki stable - PHP 7.4
- mw: 'REL1_40'
php: 7.4
php-docker: 74
composer-test: true
experimental: false

# Latest MediaWiki master - PHP 7.4
- mw: 'master'
php: 7.4
Expand Down
4 changes: 2 additions & 2 deletions includes/FormFactory/ManageWikiFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
use Miraheze\CreateWiki\RemoteWiki;
use Miraheze\ManageWiki\Helpers\ManageWikiOOUIForm;
use Miraheze\ManageWiki\ManageWiki;
use MWException;
use OutputPage;
use UnexpectedValueException;
use Wikimedia\Rdbms\DBConnRef;

class ManageWikiFormFactory {
Expand Down Expand Up @@ -87,7 +87,7 @@ protected function submitForm(
$out = $context->getOutput();

if ( !$ceMW ) {
throw new MWException( "User '{$context->getUser()->getName()}' without 'managewiki' right tried to change wiki {$module}!" );
throw new UnexpectedValueException( "User '{$context->getUser()->getName()}' without 'managewiki' right tried to change wiki {$module}!" );
}

$form->getButtons();
Expand Down
6 changes: 3 additions & 3 deletions includes/FormFactory/ManageWikiFormFactoryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use ExtensionRegistry;
use HTMLForm;
use IContextSource;
use InvalidArgumentException;
use Linker;
use ManualLogEntry;
use MediaWiki\MediaWikiServices;
Expand All @@ -18,7 +19,6 @@
use Miraheze\ManageWiki\Helpers\ManageWikiSettings;
use Miraheze\ManageWiki\Helpers\ManageWikiTypes;
use Miraheze\ManageWiki\ManageWiki;
use MWException;
use SpecialPage;
use User;
use UserGroupMembership;
Expand Down Expand Up @@ -52,7 +52,7 @@ public static function buildDescriptor(
$formDescriptor = self::buildDescriptorPermissions( $dbName, $ceMW, $special, $config );
break;
default:
throw new MWException( "{$module} not recognised" );
throw new InvalidArgumentException( "{$module} not recognised" );
}

return $formDescriptor;
Expand Down Expand Up @@ -821,7 +821,7 @@ public static function submissionHandler(
$mwReturn = self::submissionPermissions( $formData, $dbName, $special, $config );
break;
default:
throw new MWException( "{$module} not recognised" );
throw new InvalidArgumentException( "{$module} not recognised" );
}

if ( $mwReturn->changes ) {
Expand Down
4 changes: 2 additions & 2 deletions includes/Helpers/ManageWikiInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use MediaWiki\MediaWikiServices;
use MediaWiki\Shell\Shell;
use Miraheze\ManageWiki\Jobs\MWScriptJob;
use MWException;
use RuntimeException;
use Title;

class ManageWikiInstaller {
Expand Down Expand Up @@ -137,7 +137,7 @@ private static function namespaces( string $dbname, array $data, bool $install )

private static function mwscript( string $dbname, array $data ) {
if ( Shell::isDisabled() ) {
throw new MWException( 'Shell is disabled.' );
throw new RuntimeException( 'Shell is disabled.' );
}

foreach ( $data as $script => $options ) {
Expand Down

0 comments on commit dacd00d

Please sign in to comment.