Issue #3353210 by mondrake, PrabuEla, Spokje: [PHPUnit 10] @dataProvider methods must be declared static and public

merge-requests/6112/merge
Dave Long 2024-02-14 13:38:28 +00:00
parent 4c6cd6e343
commit 654b1f2074
No known key found for this signature in database
GPG Key ID: ED52AE211E142771
674 changed files with 995 additions and 995 deletions

View File

@ -68,7 +68,7 @@ class AnnounceFetcherTest extends AnnounceTestBase {
/**
* Data provider for testShowAnnouncements().
*/
public function providerShowAnnouncements(): array {
public static function providerShowAnnouncements(): array {
return [
'1' => [
'feed_item' => [

View File

@ -57,7 +57,7 @@ class AnnounceFetcherUnitTest extends UnitTestCase {
/**
* Data for the testValidateUrl.
*/
public function urlProvider(): array {
public static function urlProvider(): array {
return [
['https://www.drupal.org', TRUE],
['https://drupal.org', TRUE],

View File

@ -20,7 +20,7 @@ class BlockedIpsTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$tests = [];
$tests[0]['source_data']['blocked_ips'] = [

View File

@ -63,7 +63,7 @@ class BigPipeStrategyTest extends UnitTestCase {
/**
* @see \Drupal\big_pipe_test\BigPipePlaceholderTestCases
*/
public function placeholdersProvider() {
public static function placeholdersProvider() {
$cases = BigPipePlaceholderTestCases::cases();
// Generate $placeholders variable as expected by

View File

@ -37,7 +37,7 @@ final class ContentLengthTest extends UnitTestCase {
$this->assertSame((string) $expected_header, $response->headers->get('Content-Length'));
}
public function providerTestSetContentLengthHeader() {
public static function providerTestSetContentLengthHeader() {
$response = new Response('Test content', 200);
$response->headers->set('Content-Length', (string) strlen('Test content'));
return [

View File

@ -20,7 +20,7 @@ class BlockTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$tests = [];
// The source data.

View File

@ -21,7 +21,7 @@ class BlockTranslationTest extends BlockTest {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
// Test data is the same as BlockTest, but with the addition of i18n_blocks.
$tests = parent::providerSource();

View File

@ -23,7 +23,7 @@ class BlockTranslationTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
// The source data.
$tests[0]['source_data']['block'] = [

View File

@ -112,7 +112,7 @@ class BlockRepositoryTest extends UnitTestCase {
$this->assertEquals($expected_blocks, $result);
}
public function providerBlocksConfig() {
public static function providerBlocksConfig() {
$blocks_config = [
'block1' => [
AccessResult::allowed(), 'top', 0,

View File

@ -61,7 +61,7 @@ class CategoryAutocompleteTest extends UnitTestCase {
*
* @return array
*/
public function providerTestAutocompleteSuggestions() {
public static function providerTestAutocompleteSuggestions() {
$test_parameters = [];
$test_parameters[] = [
'string' => 'Com',

View File

@ -83,7 +83,7 @@ class BlockLocalTasksTest extends LocalTaskIntegrationTestBase {
/**
* Provides a list of routes to test.
*/
public function providerTestBlockAdminDisplay() {
public static function providerTestBlockAdminDisplay() {
return [
['block.admin_display', [['block.admin_display'], ['block.admin_display_theme:test_b', 'block.admin_display_theme:test_c']]],
['block.admin_display_theme', [['block.admin_display'], ['block.admin_display_theme:test_b', 'block.admin_display_theme:test_c']]],

View File

@ -68,7 +68,7 @@ class BlockPageVariantTest extends UnitTestCase {
->getMock();
}
public function providerBuild() {
public static function providerBuild() {
$blocks_config = [
'block1' => [
// region, is main content block, is messages block, is title block

View File

@ -40,7 +40,7 @@ class BlockSettingsTest extends UnitTestCase {
/**
* Provides data for testTransform.
*/
public function providerTestTransform() {
public static function providerTestTransform() {
return [
'title set' => [
[

View File

@ -191,7 +191,7 @@ class BlockContentAccessHandlerTest extends KernelTestBase {
/**
* Data provider for testAccess().
*/
public function providerTestAccess(): array {
public static function providerTestAccess(): array {
$cases = [
'view:published:reusable' => [
'view',

View File

@ -177,7 +177,7 @@ class BlockContentEntityReferenceSelectionTest extends KernelTestBase {
/**
* Provides possible fields and condition types.
*/
public function fieldConditionProvider() {
public static function fieldConditionProvider() {
$cases = [];
foreach (['base', 'group', 'nested_group'] as $condition_type) {
foreach ([TRUE, FALSE] as $reusable) {

View File

@ -20,7 +20,7 @@ class BoxTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$tests = [];
$tests[0]['source_data']['boxes'] = [

View File

@ -23,7 +23,7 @@ class BoxTranslationTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$tests = [];
// The source data.

View File

@ -20,7 +20,7 @@ class BlockCustomTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$tests = [];
$tests[0]['source_data']['block_custom'] = [

View File

@ -23,7 +23,7 @@ class BlockCustomTranslationTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$tests = [];
// The source data.

View File

@ -142,7 +142,7 @@ class DependentAccessTest extends UnitTestCase {
* mergeAccessDependency() first. A call to either should behave the same on a
* new RefinableDependentAccessInterface object.
*/
public function providerTestSetFirst() {
public static function providerTestSetFirst() {
return [
[TRUE],
[FALSE],

View File

@ -80,7 +80,7 @@ class BlockContentLocalTasksTest extends LocalTaskIntegrationTestBase {
/**
* Provides a list of routes to test.
*/
public function getBlockContentListingRoutes() {
public static function getBlockContentListingRoutes() {
return [
['entity.block_content.collection', 'system.admin_content'],
];

View File

@ -256,7 +256,7 @@ class BookMultilingualTest extends KernelTestBase {
/**
* Data provider for ::testMultilingualBooks().
*/
public function langcodesProvider() {
public static function langcodesProvider() {
return [
[self::LANGCODE],
['en'],

View File

@ -32,7 +32,7 @@ class MigrateBookConfigsTest extends MigrateDrupal6TestBase {
* @return array
* The data for each test scenario.
*/
public function providerBookSettings() {
public static function providerBookSettings() {
return [
// d6_book_settings was renamed to book_settings, but use the old alias to
// prove that it works.

View File

@ -18,7 +18,7 @@ class BookTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$tests = [];
// The source data.

View File

@ -104,7 +104,7 @@ class BookManagerTest extends UnitTestCase {
* @return array
* The test data.
*/
public function providerTestGetBookParents() {
public static function providerTestGetBookParents() {
$empty = [
'p1' => 0,
'p2' => 0,

View File

@ -39,7 +39,7 @@ class BookLocalTasksTest extends LocalTaskIntegrationTestBase {
/**
* Provides a list of routes to test.
*/
public function getBookAdminRoutes() {
public static function getBookAdminRoutes() {
return [
['book.admin'],
['book.settings'],
@ -60,7 +60,7 @@ class BookLocalTasksTest extends LocalTaskIntegrationTestBase {
/**
* Provides a list of routes to test.
*/
public function getBookNodeRoutes() {
public static function getBookNodeRoutes() {
return [
['entity.node.canonical'],
['entity.node.book_outline_form'],

View File

@ -146,7 +146,7 @@ class CKEditor5UpdateImageToolbarItemTest extends UpdatePathTestBase {
* @return array
* The test cases.
*/
public function provider(): array {
public static function provider(): array {
// There are 3 aspects that need to be verified, each can be true or false,
// making for 8 test cases in total.
$test_cases = [];

View File

@ -450,14 +450,14 @@ abstract class ImageTestBase extends CKEditor5TestBase {
$this->assertVisibleBalloon('.ck-text-alternative-form');
}
public function providerAltTextRequired(): array {
public static function providerAltTextRequired(): array {
return [
'Restricted' => [FALSE],
'Unrestricted' => [TRUE],
];
}
public function providerLinkability(): array {
public static function providerLinkability(): array {
return [
'BLOCK image, restricted' => ['block', FALSE],
'BLOCK image, unrestricted' => ['block', TRUE],
@ -528,7 +528,7 @@ abstract class ImageTestBase extends CKEditor5TestBase {
$this->assertFalse($drupal_media_element->hasAttribute('data-align'));
}
public function providerAlignment() {
public static function providerAlignment() {
return [
'Block image' => ['block'],
'Inline image' => ['inline'],
@ -620,7 +620,7 @@ abstract class ImageTestBase extends CKEditor5TestBase {
*
* @return string[][]
*/
public function providerWidth(): array {
public static function providerWidth(): array {
return [
'Image resize with percent unit (only allowed in HTML 4)' => [
'width' => '33%',
@ -674,7 +674,7 @@ abstract class ImageTestBase extends CKEditor5TestBase {
* @return array
* The test cases.
*/
public function providerResize(): array {
public static function providerResize(): array {
return [
'Image resize is enabled' => [
'is_resize_enabled' => TRUE,

View File

@ -82,7 +82,7 @@ JS;
*
* @return string[][]
*/
public function provider(): array {
public static function provider(): array {
return [
'Language code both in Drupal and CKEditor' => [
'langcode' => 'th',

View File

@ -221,7 +221,7 @@ class MediaLinkabilityTest extends MediaTestBase {
$this->assertEmpty($xpath->query('//a'));
}
public function providerLinkability(): array {
public static function providerLinkability(): array {
return [
'restricted' => [FALSE],
'unrestricted' => [TRUE],

View File

@ -186,7 +186,7 @@ class MediaPreviewTest extends MediaTestBase {
/**
* Data provider for ::testEmbedPreviewAccess.
*/
public function previewAccessProvider() {
public static function previewAccessProvider() {
return [
'media_embed filter enabled' => [
TRUE,

View File

@ -1007,7 +1007,7 @@ class MediaTest extends MediaTestBase {
/**
* For testing view modes in different scenarios.
*/
public function providerTestViewMode(): array {
public static function providerTestViewMode(): array {
return [
'with alignment' => [TRUE],
'without alignment' => [FALSE],

View File

@ -118,7 +118,7 @@ JS;
* @return array
* The test cases.
*/
public function providerAllowingExtraAttributes(): array {
public static function providerAllowingExtraAttributes(): array {
$general_test_case_markup = '<div class="llama" data-llama="🦙"><p data-llama="🦙">The <a href="https://example.com/pirate" class="button" data-grammar="subject">pirate</a> is <a href="https://example.com/irate" class="use-ajax" data-grammar="adjective">irate</a>.</p></div>';
return [
'no extra attributes allowed' => [

View File

@ -201,7 +201,7 @@ YAML,
* @return \Generator
* Test scenarios.
*/
public function providerTestInvalidPluginDefinitions(): \Generator {
public static function providerTestInvalidPluginDefinitions(): \Generator {
yield 'invalid plugin ID with everything else okay' => [
<<<YAML
foo_bar:
@ -1282,7 +1282,7 @@ PHP,
/**
* Provides uses cases enabling different elements and the expected results.
*/
public function providerTestProvidedElements(): array {
public static function providerTestProvidedElements(): array {
$text_align_classes = [
'text-align-left' => TRUE,
'text-align-center' => TRUE,
@ -1507,7 +1507,7 @@ PHP,
/**
* Provides use cases for findPluginSupportingElement().
*/
public function providerTestPluginSupportingElement() {
public static function providerTestPluginSupportingElement() {
return [
'tag that belongs to a superset' => [
'tag' => 'h2',

View File

@ -46,7 +46,7 @@ class CKEditor5StylesheetsTest extends KernelTestBase {
* @return array
* An array of test cases.
*/
public function externalStylesheetsProvider() {
public static function externalStylesheetsProvider() {
return [
'Install theme which has an absolute external CSS URL' => [
'test_ckeditor_stylesheets_external',

View File

@ -649,7 +649,7 @@ class SmartDefaultSettingsTest extends KernelTestBase {
* @return \Generator
* Test scenarios.
*/
public function provider() {
public static function provider() {
$basic_html_test_case = [
'format_id' => 'basic_html',
'filters_to_drop' => [],

View File

@ -110,7 +110,7 @@ class ValidatorsTest extends KernelTestBase {
/**
* Provides a list of Text Editor config entities using CKEditor 5 to test.
*/
public function provider(): array {
public static function provider(): array {
$data = [];
$data['CKEditor5::getDefaultSettings()'] = [
// @see ::test()
@ -703,7 +703,7 @@ class ValidatorsTest extends KernelTestBase {
/**
* Provides a list of Text Editor + Text Format pairs to test.
*/
public function providerPair(): array {
public static function providerPair(): array {
// cspell:ignore donk
$data = [];
$data['INVALID: allow_view_mode_override condition not met: filter must be configured to allow 2 or more view modes'] = [

View File

@ -99,7 +99,7 @@ class WildcardHtmlSupportTest extends KernelTestBase {
$this->assertEquals($expected_ghs_configuration, $ghs_configuration);
}
public function providerGhsConfiguration(): array {
public static function providerGhsConfiguration(): array {
return [
'empty source editing' => [
'<p> <br>',

View File

@ -19,7 +19,7 @@ class AlignmentPluginTest extends UnitTestCase {
/**
* Provides a list of configs to test.
*/
public function providerGetDynamicPluginConfig(): array {
public static function providerGetDynamicPluginConfig(): array {
return [
'All alignments' => [
Alignment::DEFAULT_CONFIGURATION,

View File

@ -62,7 +62,7 @@ class CKEditor5Test extends UnitTestCase {
* @return array[]
* An array with the property path and expected form item name.
*/
public function providerPathsToFormNames(): array {
public static function providerPathsToFormNames(): array {
return [
'validation error targeting toolbar items' => [
'settings.toolbar.items',

View File

@ -27,7 +27,7 @@ class HTMLRestrictionsTest extends UnitTestCase {
new HTMLRestrictions($elements);
}
public function providerConstruct(): \Generator {
public static function providerConstruct(): \Generator {
// Fundamental structure.
yield 'INVALID: list instead of key-value pairs' => [
['<foo>', '<bar>'],
@ -166,7 +166,7 @@ class HTMLRestrictionsTest extends UnitTestCase {
$this->assertCount($expected_concrete_plus_wildcard_count, $r->getAllowedElements(FALSE));
}
public function providerCounting(): \Generator {
public static function providerCounting(): \Generator {
yield 'empty' => [
[],
TRUE,
@ -256,7 +256,7 @@ class HTMLRestrictionsTest extends UnitTestCase {
$this->assertSame($expected_raw + $filter_html_additional_expectations, HTMLRestrictions::fromFilterPluginInstance($filter_plugin_instance->reveal())->getAllowedElements(FALSE));
}
public function providerConvenienceConstructors(): \Generator {
public static function providerConvenienceConstructors(): \Generator {
// All empty cases.
yield 'empty string' => [
'',
@ -638,7 +638,7 @@ class HTMLRestrictionsTest extends UnitTestCase {
$this->assertSame($expected_ghs_config, $restrictions->toGeneralHtmlSupportConfig());
}
public function providerRepresentations(): \Generator {
public static function providerRepresentations(): \Generator {
yield 'empty set' => [
HTMLRestrictions::emptySet(),
[],
@ -904,7 +904,7 @@ class HTMLRestrictionsTest extends UnitTestCase {
$this->assertEquals($expected_union, $a->merge($b));
}
public function providerOperands(): \Generator {
public static function providerOperands(): \Generator {
// Empty set operand cases.
yield 'any set + empty set' => [
'a' => new HTMLRestrictions(['a' => ['href' => TRUE]]),
@ -1504,7 +1504,7 @@ class HTMLRestrictionsTest extends UnitTestCase {
$this->assertEquals($expected_extracted_plain_tags_subset, $input->extractPlainTagsSubset());
}
public function providerSubsets(): \Generator {
public static function providerSubsets(): \Generator {
yield 'empty set' => [
new HTMLRestrictions([]),
new HTMLRestrictions([]),

View File

@ -19,7 +19,7 @@ class HeadingPluginTest extends UnitTestCase {
/**
* Provides a list of configs to test.
*/
public function providerGetDynamicPluginConfig(): array {
public static function providerGetDynamicPluginConfig(): array {
// Prepare headings matching ckeditor5.ckeditor5.yml to also protect
// against unexpected changes to the YAML file given the YAML file is used
// to generate the dynamic plugin configuration.

View File

@ -19,7 +19,7 @@ class ListPluginTest extends UnitTestCase {
/**
* Provides a list of configs to test.
*/
public function providerGetDynamicPluginConfig(): array {
public static function providerGetDynamicPluginConfig(): array {
return [
'startIndex is false' => [
[

View File

@ -34,7 +34,7 @@ class SmartDefaultSettingsTest extends UnitTestCase {
*
* @return \Generator
*/
public function providerSurplusScore(): \Generator {
public static function providerSurplusScore(): \Generator {
$needed = new HTMLRestrictions(['code' => FALSE]);
yield 'surplus: 1 tag, 1 attribute, 1 attribute with wildcard restriction' => [
@ -92,7 +92,7 @@ class SmartDefaultSettingsTest extends UnitTestCase {
*
* @return \Generator
*/
public function providerCandidates(): \Generator {
public static function providerCandidates(): \Generator {
$generate_definition = function (string $label_and_id, array $overrides): CKEditor5PluginDefinition {
$annotation = [
'provider' => 'test',

View File

@ -18,7 +18,7 @@ class SourceEditingPluginTest extends UnitTestCase {
/**
* Provides a list of configs to test.
*/
public function providerGetDynamicPluginConfig(): array {
public static function providerGetDynamicPluginConfig(): array {
return [
'Empty array of allowed tags' => [
[

View File

@ -18,7 +18,7 @@ class StylePluginTest extends UnitTestCase {
/**
* Provides a list of configs to test.
*/
public function providerGetDynamicPluginConfig(): array {
public static function providerGetDynamicPluginConfig(): array {
return [
'default configuration (empty)' => [
[

View File

@ -124,7 +124,7 @@ class CommentOrphanTest extends EntityKernelTestBase {
/**
* Provides test data for testOrphan.
*/
public function providerTestOrphan() {
public static function providerTestOrphan() {
return [
['entity_id'],
['uid'],

View File

@ -113,7 +113,7 @@ class MigrateCommentTypeTest extends MigrateDrupal6TestBase {
/**
* Provides test cases for ::testNoCommentTypeMigration().
*/
public function providerTestNoCommentTypeMigration() {
public static function providerTestNoCommentTypeMigration() {
return [
'Node module is disabled in source' => [
'Disabled source modules' => ['node'],

View File

@ -46,7 +46,7 @@ class CommentEntityTranslationCheckRequirementsTest extends MigrateDrupal7TestBa
*
* @return string[][]
*/
public function providerTestCheckRequirements() {
public static function providerTestCheckRequirements() {
return [
['comment'],
['node'],

View File

@ -119,7 +119,7 @@ class MigrateCommentTypeTest extends MigrateDrupal7TestBase {
/**
* Provides test cases for ::testNoCommentTypeMigration().
*/
public function providerTestNoCommentTypeMigration() {
public static function providerTestNoCommentTypeMigration() {
return [
'Node module is disabled in source' => [
'Disabled source modules' => ['node'],

View File

@ -47,7 +47,7 @@ class CommentTypeRequirementsTest extends MigrateDrupal7TestBase {
/**
* Test cases for ::testCheckCommentTypeRequirements().
*/
public function providerTestCheckCommentTypeRequirements() {
public static function providerTestCheckCommentTypeRequirements() {
return [
'D6 comment is disabled on source' => [
'Disabled source modules' => ['comment'],

View File

@ -21,7 +21,7 @@ class CommentTypeTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$node_type_rows = [
[
'type' => 'page',

View File

@ -21,7 +21,7 @@ class CommentSourceWithHighWaterTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$tests = [];
// The source data.

View File

@ -20,7 +20,7 @@ class CommentTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$tests = [];
// The source data.

View File

@ -22,7 +22,7 @@ class CommentEntityTranslationTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$tests = [];
// The source data.

View File

@ -22,7 +22,7 @@ class CommentTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$tests = [];
// The source data.

View File

@ -33,7 +33,7 @@ class ConfigLocalTasksTest extends LocalTaskIntegrationTestBase {
/**
* Provides a list of routes to test.
*/
public function getConfigAdminRoutes() {
public static function getConfigAdminRoutes() {
return [
['config.sync', [['config.sync', 'config.import', 'config.export']]],
['config.import_full', [['config.sync', 'config.import', 'config.export'], ['config.import_full', 'config.import_single']]],

View File

@ -22,7 +22,7 @@ class ProfileFieldTranslationTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$test = [];
$test[0]['source_data'] = [
'profile_fields' => [

View File

@ -523,7 +523,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
* hasConfigSchema() as the first value and the expected return value of
* ConfigNamesMapper::hasSchema() as the second value.
*/
public function providerTestHasSchema() {
public static function providerTestHasSchema() {
return [
[[TRUE], TRUE],
[[FALSE], FALSE],
@ -570,7 +570,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
* hasTranslatable() as the first value and the expected return value of
* ConfigNamesMapper::hasTranslatable() as the second value.
*/
public function providerTestHasTranslatable() {
public static function providerTestHasTranslatable() {
return [
[[], FALSE],
[[TRUE], TRUE],
@ -621,7 +621,7 @@ class ConfigNamesMapperTest extends UnitTestCase {
* hasTranslation() as the first value and the expected return value of
* ConfigNamesMapper::hasTranslation() as the second value.
*/
public function providerTestHasTranslation() {
public static function providerTestHasTranslation() {
return [
[[TRUE], TRUE],
[[FALSE], FALSE],

View File

@ -20,7 +20,7 @@ class ContactCategoryTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$tests = [
[
'source_data' => [],

View File

@ -20,7 +20,7 @@ class ContactSettingsTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$tests = [];
$tests[0]['source_data']['variable'] = [

View File

@ -102,7 +102,7 @@ class ModerationActionsTest extends BrowserTestBase {
* @return array
* An array of test cases.
*/
public function nodeStatusActionsTestCases() {
public static function nodeStatusActionsTestCases() {
return [
'Moderated bundle shows warning (publish action)' => [
'node_publish_action',

View File

@ -261,7 +261,7 @@ class ViewsModerationStateFilterTest extends ViewTestBase {
* @return string[]
* An array of view IDs.
*/
public function providerTestWorkflowChanges() {
public static function providerTestWorkflowChanges() {
return [
'view on base table, filter on base table' => [
'test_content_moderation_state_filter_base_table',

View File

@ -48,7 +48,7 @@ class ContentModerationPermissionsTest extends KernelTestBase {
* @return array
* Content moderation permissions based test cases.
*/
public function permissionsTestCases() {
public static function permissionsTestCases() {
return [
'Simple Content Moderation Workflow' => [
[

View File

@ -169,7 +169,7 @@ class ContentModerationStateTest extends KernelTestBase {
/**
* Test cases for basic moderation test.
*/
public function basicModerationTestCases() {
public static function basicModerationTestCases() {
return [
'Nodes' => [
'node',
@ -480,7 +480,7 @@ class ContentModerationStateTest extends KernelTestBase {
/**
* Test cases for ::testModerationWithSpecialLanguages().
*/
public function moderationWithSpecialLanguagesTestCases() {
public static function moderationWithSpecialLanguagesTestCases() {
return [
'Not specified to not specified' => [
LanguageInterface::LANGCODE_NOT_SPECIFIED,

View File

@ -364,7 +364,7 @@ class EntityStateChangeValidationTest extends KernelTestBase {
/**
* Test cases for ::testTransitionAccessValidation.
*/
public function transitionAccessValidationTestCases() {
public static function transitionAccessValidationTestCases() {
return [
'Invalid transition, no permissions validated' => [
[],

View File

@ -98,7 +98,7 @@ class EntityTypeInfoTest extends KernelTestBase {
* - An entity type ID.
* - Whether the entity type is moderatable or not.
*/
public function providerTestEntityTypeAlter() {
public static function providerTestEntityTypeAlter() {
$tests = [];
$tests['non_internal_non_revisionable'] = ['entity_test', FALSE];
$tests['non_internal_revisionable'] = ['entity_test_rev', TRUE];

View File

@ -97,7 +97,7 @@ class ModerationInformationTest extends KernelTestBase {
/**
* Test cases for ::testIsDefaultRevisionPublished.
*/
public function isDefaultRevisionPublishedTestCases() {
public static function isDefaultRevisionPublishedTestCases() {
return [
'Draft to draft' => [
'draft',

View File

@ -213,7 +213,7 @@ class ModerationStateFieldItemListTest extends KernelTestBase {
/**
* Data provider for ::testModerationStateChanges.
*/
public function moderationStateChangesTestCases() {
public static function moderationStateChangesTestCases() {
return [
'Draft to draft' => [
'draft',
@ -298,7 +298,7 @@ class ModerationStateFieldItemListTest extends KernelTestBase {
/**
* Test cases for ::testEntityUnserialize.
*/
public function entityUnserializeTestCases() {
public static function entityUnserializeTestCases() {
return [
'Default draft state' => [
'draft',
@ -332,7 +332,7 @@ class ModerationStateFieldItemListTest extends KernelTestBase {
/**
* Tests cases for ::testModeratedEntityWithExistingId.
*/
public function moderatedEntityWithExistingIdTestCases() {
public static function moderatedEntityWithExistingIdTestCases() {
return [
'Draft non-default state' => [
'draft',

View File

@ -64,7 +64,7 @@ class StateFormatterTest extends KernelTestBase {
/**
* Test cases for testStateFieldFormatter().
*/
public function formatterTestCases() {
public static function formatterTestCases() {
return [
'Draft State' => [
'draft',

View File

@ -155,7 +155,7 @@ class WorkspacesContentModerationStateTest extends ContentModerationStateTest {
/**
* Test cases for basic moderation test.
*/
public function basicModerationTestCases() {
public static function basicModerationTestCases() {
return [
'Nodes' => [
'node',

View File

@ -69,7 +69,7 @@ class ContentModerationRouteSubscriberTest extends UnitTestCase {
/**
* Data provider for ::testSetLatestRevisionFlag.
*/
public function setLatestRevisionFlagTestCases() {
public static function setLatestRevisionFlagTestCases() {
return [
'Entity parameter not on an entity form' => [
[],

View File

@ -29,7 +29,7 @@ class ContentPreprocessTest extends UnitTestCase {
/**
* Data provider for self::testIsLatestVersionPage().
*/
public function routeNodeProvider() {
public static function routeNodeProvider() {
return [
['entity.node.canonical', 1, 1, FALSE, 'Not on the latest version tab route.'],
['entity.node.latest_version', 1, 1, TRUE, 'On the latest version tab route, with the route node.'],

View File

@ -105,7 +105,7 @@ class LatestRevisionCheckTest extends UnitTestCase {
/**
* Data provider for testLastAccessPermissions().
*/
public function accessSituationProvider() {
public static function accessSituationProvider() {
return [
// Node with global permissions and latest version.
[Node::class, 'node', TRUE, ['view latest version', 'view any unpublished content'], FALSE, AccessResultAllowed::class],

View File

@ -146,7 +146,7 @@ class ModerationInformationTest extends UnitTestCase {
/**
* Data provider for several tests.
*/
public function providerWorkflow() {
public static function providerWorkflow() {
return [
[NULL, FALSE],
['workflow', TRUE],

View File

@ -98,7 +98,7 @@ class StateTransitionValidationTest extends UnitTestCase {
/**
* Data provider for the user transition test.
*/
public function userTransitionsProvider() {
public static function userTransitionsProvider() {
// The user has the right permission, so let it through.
$ret[] = ['draft', 'draft', 'use process transition draft', TRUE, TRUE];

View File

@ -134,7 +134,7 @@ class ContentTranslationHandlerTest extends KernelTestBase {
* An array of test cases, each one containing the element to alter, the
* form state, and the expected altered element.
*/
public function providerTestEntityFormSharedElements() {
public static function providerTestEntityFormSharedElements() {
$tests = [];
$element = [];

View File

@ -25,7 +25,7 @@ class EntityTranslationSettingsTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$tests = [];
// Source data when there's no entity type that uses entity translation.

View File

@ -55,7 +55,7 @@ class ContentTranslationLocalTasksTest extends LocalTaskIntegrationTestBase {
/**
* Provides a list of routes to test.
*/
public function providerTestBlockAdminDisplay() {
public static function providerTestBlockAdminDisplay() {
return [
[
'entity.node.canonical',

View File

@ -26,7 +26,7 @@ class ContextualUnitTest extends KernelTestBase {
* @return array[]
* Test cases.
*/
public function contextualLinksDataProvider(): array {
public static function contextualLinksDataProvider(): array {
$tests['one group, one dynamic path argument, no metadata'] = [
[
'node' => [

View File

@ -272,7 +272,7 @@ class DateTimeItemTest extends FieldKernelTestBase {
/**
* Provider for testDatetimeValidation().
*/
public function datetimeValidationProvider() {
public static function datetimeValidationProvider() {
return [
// Valid ISO 8601 dates, but unsupported by DateTimeItem.
['2014-01-01T20:00:00Z'],
@ -332,7 +332,7 @@ class DateTimeItemTest extends FieldKernelTestBase {
/**
* Provider for testDatetimeValidation().
*/
public function dateOnlyValidationProvider() {
public static function dateOnlyValidationProvider() {
return [
// Valid date strings, but unsupported by DateTimeItem.
['Thu, 03 Nov 2014'],

View File

@ -66,7 +66,7 @@ class DateFieldTest extends UnitTestCase {
/**
* Provides data for testDefineValueProcessPipeline().
*/
public function providerTestDefineValueProcessPipeline() {
public static function providerTestDefineValueProcessPipeline() {
return [
[['type' => 'date'], 'Y-m-d\TH:i:s', 'Y-m-d\TH:i:s'],
[['type' => 'datestamp'], 'U', 'U'],

View File

@ -58,7 +58,7 @@ class StandardTest extends UnitTestCase {
*
* @see \Drupal\Tests\editor\Unit\editor\EditorXssFilter\StandardTest::testFilterXss()
*/
public function providerTestFilterXss() {
public static function providerTestFilterXss() {
$data = [];
$data[] = ['<p>Hello, world!</p><unknown>Pink Fairy Armadillo</unknown>', '<p>Hello, world!</p><unknown>Pink Fairy Armadillo</unknown>'];
$data[] = ['<p style="color:red">Hello, world!</p><unknown>Pink Fairy Armadillo</unknown>', '<p>Hello, world!</p><unknown>Pink Fairy Armadillo</unknown>'];
@ -580,7 +580,7 @@ xss:ex/*XSS*//*/*/pression(alert("XSS"))\'>',
* - The assertion message.
* - (optional) The disallowed HTML tags to be passed to \Drupal\Component\Utility\Xss::filter().
*/
public function providerTestBlackListMode() {
public static function providerTestBlackListMode() {
return [
[
'<unknown style="visibility:hidden">Pink Fairy Armadillo</unknown><video src="gerenuk.mp4"><script>alert(0)</script>',

View File

@ -167,7 +167,7 @@ class NumberItemTest extends FieldKernelTestBase {
* @return \Generator
* The test data.
*/
public function dataNumberFieldSettingsProvider() {
public static function dataNumberFieldSettingsProvider() {
yield ['integer', NULL, NULL, -100, FALSE];
yield ['integer', 0, NULL, -100, TRUE, 'field_integer: the value may be no less than 0.'];
yield ['integer', 10, NULL, 100, FALSE];
@ -243,7 +243,7 @@ class NumberItemTest extends FieldKernelTestBase {
* @return \Generator
* The test data.
*/
public function dataTestMinMaxValue() {
public static function dataTestMinMaxValue() {
yield [1, 10, 5, FALSE, ''];
yield [10, 5, 6, TRUE, 'The minimum value must be less than or equal to 5.'];
yield [1, 0, 6, TRUE, 'The minimum value must be less than or equal to 0.'];

View File

@ -26,7 +26,7 @@ class FieldInstanceLabelDescriptionTranslationTest extends MigrateSqlSourceTestB
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$test = [];
// The source data.

View File

@ -18,7 +18,7 @@ class FieldInstanceOptionTranslationTest extends FieldOptionTranslationTest {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$test = parent::providerSource();
// FieldInstanceOptionTranslation extends FieldOptionTranslation so the

View File

@ -22,7 +22,7 @@ class FieldInstancePerFormDisplayTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$tests = [
[
'source_data' => [],

View File

@ -20,7 +20,7 @@ class FieldInstancePerViewModeTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$tests = [
[
'source_data' => [],

View File

@ -20,7 +20,7 @@ class FieldInstanceTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$tests = [
[
'source_data' => [],

View File

@ -22,7 +22,7 @@ class FieldOptionTranslationTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$test = [];
// The source data.

View File

@ -20,7 +20,7 @@ class FieldTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$tests = [
[
'source_data' => [],

View File

@ -26,7 +26,7 @@ class FieldInstanceLabelDescriptionTranslationTest extends MigrateSqlSourceTestB
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$test = [];
// The source data.

View File

@ -20,7 +20,7 @@ class FieldInstancePerFormDisplayTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$tests = [
[
'source_data' => [],

View File

@ -20,7 +20,7 @@ class FieldInstancePerViewModeTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$tests = [
[
'source_data' => [],

View File

@ -20,7 +20,7 @@ class FieldInstanceTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$tests = [
[
'source_data' => [],

View File

@ -22,7 +22,7 @@ class FieldOptionTranslationTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$test = [];
// The source data.

View File

@ -20,7 +20,7 @@ class FieldTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$tests = [
[
'source_data' => [],

View File

@ -20,7 +20,7 @@ class ViewModeTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public function providerSource() {
public static function providerSource() {
$tests = [
[
'source_data' => [],

View File

@ -202,7 +202,7 @@ class FieldStorageConfigEntityUnitTest extends UnitTestCase {
* @return array
* Test cases.
*/
public function providerInvalidEnforcedCardinality() {
public static function providerInvalidEnforcedCardinality() {
return [
'zero' => [0],
'negative_other_than_-1' => [-70],

View File

@ -111,7 +111,7 @@ class ProcessFieldTest extends MigrateTestCase {
* - The MigrateException message to expect.
* - Whether the field plugin is not found.
*/
public function providerTestTransform() {
public static function providerTestTransform() {
return [
// Tests the getFieldType() method.
[

Some files were not shown because too many files have changed in this diff Show More