Merge "tests: Make PHPUnit data providers static"

This commit is contained in:
jenkins-bot 2023-05-21 11:34:36 +00:00 committed by Gerrit Code Review
commit 76ea3c5244
7 changed files with 13 additions and 13 deletions

View file

@ -86,7 +86,7 @@ class ApiVisualEditorTest extends ApiTestCase {
);
}
public function provideLoadEditorPreload() {
public static function provideLoadEditorPreload() {
return [
'load with preload content' => [
[

View file

@ -22,7 +22,7 @@ class SpecialCollabPadTest extends MediaWikiIntegrationTestCase {
);
}
public function provideSubPages() {
public static function provideSubPages() {
return [
[ 'Special:CollabPad', null ],
[ 'Special:CollabPad/', null ],

View file

@ -55,7 +55,7 @@ class DirectParsoidClientTest extends MediaWikiIntegrationTestCase {
}
/** @return Generator */
public function provideLanguageCodes() {
public static function provideLanguageCodes() {
yield 'German language code' => [ 'de' ];
yield 'English language code' => [ 'en' ];
yield 'French language code' => [ 'fr' ];

View file

@ -104,7 +104,7 @@ class DualParsoidClientTest extends MediaWikiIntegrationTestCase {
return $directClient;
}
public function provideDefaultModes() {
public static function provideDefaultModes() {
yield 'direct' => [ 'direct' ];
yield 'vrs' => [ 'vrs' ];
}
@ -164,7 +164,7 @@ class DualParsoidClientTest extends MediaWikiIntegrationTestCase {
$this->assertStringContainsString( 'mode:' . $default, $result['body'] );
}
public function provideTransformHTML() {
public static function provideTransformHTML() {
$fallbackMode = 'direct';
yield 'no etag' => [ null, $fallbackMode ];

View file

@ -29,7 +29,7 @@ class HooksTest extends MediaWikiIntegrationTestCase {
}
}
public function provideOnResourceLoaderGetConfigVars() {
public static function provideOnResourceLoaderGetConfigVars() {
// TODO: test a lot more config!
yield 'restbaseUrl: No VRS modules, DefaultParsoidClient=vrs' => [

View file

@ -51,7 +51,7 @@ class VRSParsoidClientTest extends MediaWikiIntegrationTestCase {
}
/** @return Generator */
public function provideLanguageCodes() {
public static function provideLanguageCodes() {
yield 'German language code' => [ 'de' ];
yield 'English language code' => [ 'en' ];
yield 'French language code' => [ 'fr' ];
@ -120,7 +120,7 @@ class VRSParsoidClientTest extends MediaWikiIntegrationTestCase {
/**
* @return Generator
*/
public function restbaseErrorObjectProvider() {
public static function restbaseErrorObjectProvider() {
yield [
[
'code' => 200,
@ -203,7 +203,7 @@ class VRSParsoidClientTest extends MediaWikiIntegrationTestCase {
}
/** @return Generator */
public function provideTransformHtmlData(): Generator {
public static function provideTransformHtmlData(): Generator {
yield 'No oldid and no eTag to set in request headers' => [ null, null ];
yield 'Oldid to set in request headers with no eTag' => [ 123, null ];
@ -252,7 +252,7 @@ class VRSParsoidClientTest extends MediaWikiIntegrationTestCase {
}
/** @return Generator */
public function provideTransformWikitextData(): Generator {
public static function provideTransformWikitextData(): Generator {
// [ $bodyOnly, $oldid, $stash ]
yield 'Body only: false, oldid: null, stash: false' => [ false, null, false ];

View file

@ -48,7 +48,7 @@ class VisualEditorParsoidClientFactoryTest extends MediaWikiIntegrationTestCase
);
}
public function provideGetClient() {
public static function provideGetClient() {
yield 'Empty VRS modules array, DefaultParsoidClient=vrs, no hints' => [
[
MainConfigNames::ParsoidSettings => [],
@ -168,7 +168,7 @@ class VisualEditorParsoidClientFactoryTest extends MediaWikiIntegrationTestCase
$this->assertInstanceOf( DualParsoidClient::class, $client );
}
public function provideCookieToForward() {
public static function provideCookieToForward() {
yield 'When no cookie is sent' => [ false, false ];
yield 'When a cookie is sent as a string' => [ 'cookie', 'cookie' ];
@ -247,7 +247,7 @@ class VisualEditorParsoidClientFactoryTest extends MediaWikiIntegrationTestCase
$this->assertSame( $expected, $parsoidClient->useParsoidOverHTTP() );
}
public function provideUseParsoidOverHTTP() {
public static function provideUseParsoidOverHTTP() {
// TODO: test a lot more config!
yield 'restbaseUrl: No VRS modules, DefaultParsoidClient=vrs' => [