diff --git a/core/lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotatedClassDiscovery.php b/core/lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotatedClassDiscovery.php index b350ac02293e63e03deb6b40aa702b2f460ab4d8..000c337db243b138d2647352f7f2ba7bc6e3717b 100644 --- a/core/lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotatedClassDiscovery.php +++ b/core/lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotatedClassDiscovery.php @@ -69,7 +69,7 @@ class AnnotatedClassDiscovery implements DiscoveryInterface { * @param string[] $annotation_namespaces * (optional) Additional namespaces to be scanned for annotation classes. */ - function __construct($plugin_namespaces = [], $plugin_definition_annotation_name = 'Drupal\Component\Annotation\Plugin', array $annotation_namespaces = []) { + public function __construct($plugin_namespaces = [], $plugin_definition_annotation_name = 'Drupal\Component\Annotation\Plugin', array $annotation_namespaces = []) { $this->pluginNamespaces = $plugin_namespaces; $this->pluginDefinitionAnnotationName = $plugin_definition_annotation_name; $this->annotationNamespaces = $annotation_namespaces; diff --git a/core/lib/Drupal/Component/Gettext/PoHeader.php b/core/lib/Drupal/Component/Gettext/PoHeader.php index 806beba008dea29a4cde2c53b8a23b9f2eb971de..5dd13a5d5b9d77f6f302c6fa8aa2bb0f2581e2d7 100644 --- a/core/lib/Drupal/Component/Gettext/PoHeader.php +++ b/core/lib/Drupal/Component/Gettext/PoHeader.php @@ -85,7 +85,7 @@ public function __construct($langcode = NULL) { * Plural form component from the header, for example: * 'nplurals=2; plural=(n > 1);'. */ - function getPluralForms() { + public function getPluralForms() { return $this->_pluralForms; } @@ -95,7 +95,7 @@ function getPluralForms() { * @param string $languageName * Human readable language name. */ - function setLanguageName($languageName) { + public function setLanguageName($languageName) { $this->_languageName = $languageName; } @@ -105,7 +105,7 @@ function setLanguageName($languageName) { * @return string * The human readable language name. */ - function getLanguageName() { + public function getLanguageName() { return $this->_languageName; } @@ -115,7 +115,7 @@ function getLanguageName() { * @param string $projectName * Human readable project name. */ - function setProjectName($projectName) { + public function setProjectName($projectName) { $this->_projectName = $projectName; } @@ -125,7 +125,7 @@ function setProjectName($projectName) { * @return string * The human readable project name. */ - function getProjectName() { + public function getProjectName() { return $this->_projectName; } @@ -190,7 +190,7 @@ public function __toString() { * * @throws Exception */ - function parsePluralForms($pluralforms) { + public function parsePluralForms($pluralforms) { $plurals = []; // First, delete all whitespace. $pluralforms = strtr($pluralforms, [" " => "", "\t" => ""]); diff --git a/core/lib/Drupal/Component/Gettext/PoItem.php b/core/lib/Drupal/Component/Gettext/PoItem.php index 6d76d6c218c9444c8dcd56153b0daf3a37bdfddc..1f05bbd59dd64f3f659f71e8fff7446a3670ce9e 100644 --- a/core/lib/Drupal/Component/Gettext/PoItem.php +++ b/core/lib/Drupal/Component/Gettext/PoItem.php @@ -59,7 +59,7 @@ class PoItem { * * @return string with langcode */ - function getLangcode() { + public function getLangcode() { return $this->_langcode; } @@ -68,7 +68,7 @@ function getLangcode() { * * @param string $langcode */ - function setLangcode($langcode) { + public function setLangcode($langcode) { $this->_langcode = $langcode; } @@ -77,7 +77,7 @@ function setLangcode($langcode) { * * @return string $context */ - function getContext() { + public function getContext() { return $this->_context; } @@ -86,7 +86,7 @@ function getContext() { * * @param string $context */ - function setContext($context) { + public function setContext($context) { $this->_context = $context; } @@ -96,7 +96,7 @@ function setContext($context) { * * @return string or array $translation */ - function getSource() { + public function getSource() { return $this->_source; } @@ -106,7 +106,7 @@ function getSource() { * * @param string or array $source */ - function setSource($source) { + public function setSource($source) { $this->_source = $source; } @@ -116,7 +116,7 @@ function setSource($source) { * * @return string or array $translation */ - function getTranslation() { + public function getTranslation() { return $this->_translation; } @@ -126,7 +126,7 @@ function getTranslation() { * * @param string or array $translation */ - function setTranslation($translation) { + public function setTranslation($translation) { $this->_translation = $translation; } @@ -135,7 +135,7 @@ function setTranslation($translation) { * * @param bool $plural */ - function setPlural($plural) { + public function setPlural($plural) { $this->_plural = $plural; } @@ -144,7 +144,7 @@ function setPlural($plural) { * * @return bool */ - function isPlural() { + public function isPlural() { return $this->_plural; } @@ -153,7 +153,7 @@ function isPlural() { * * @return String $comment */ - function getComment() { + public function getComment() { return $this->_comment; } @@ -162,7 +162,7 @@ function getComment() { * * @param string $comment */ - function setComment($comment) { + public function setComment($comment) { $this->_comment = $comment; } diff --git a/core/lib/Drupal/Component/Gettext/PoMemoryWriter.php b/core/lib/Drupal/Component/Gettext/PoMemoryWriter.php index c8da6e6d86ff9e3b3a782ff7d679223438ee470d..c5416b6fa420643df0069286c171a10363a746bd 100644 --- a/core/lib/Drupal/Component/Gettext/PoMemoryWriter.php +++ b/core/lib/Drupal/Component/Gettext/PoMemoryWriter.php @@ -17,7 +17,7 @@ class PoMemoryWriter implements PoWriterInterface { /** * Constructor, initialize empty items. */ - function __construct() { + public function __construct() { $this->_items = []; } @@ -57,7 +57,7 @@ public function getData() { * * Not implemented. Not relevant for the MemoryWriter. */ - function setLangcode($langcode) { + public function setLangcode($langcode) { } /** @@ -65,7 +65,7 @@ function setLangcode($langcode) { * * Not implemented. Not relevant for the MemoryWriter. */ - function getLangcode() { + public function getLangcode() { } /** @@ -73,7 +73,7 @@ function getLangcode() { * * Not implemented. Not relevant for the MemoryWriter. */ - function getHeader() { + public function getHeader() { } /** @@ -81,7 +81,7 @@ function getHeader() { * * Not implemented. Not relevant for the MemoryWriter. */ - function setHeader(PoHeader $header) { + public function setHeader(PoHeader $header) { } } diff --git a/core/lib/Drupal/Component/Gettext/PoStreamReader.php b/core/lib/Drupal/Component/Gettext/PoStreamReader.php index c44f9a1a691eccf816677d952357bfe9e0d7bda2..f84d2514c0c892b03b48ad0e33341cb295886357 100644 --- a/core/lib/Drupal/Component/Gettext/PoStreamReader.php +++ b/core/lib/Drupal/Component/Gettext/PoStreamReader.php @@ -547,7 +547,7 @@ public function setItemFromArray($value) { * @return * The string parsed from inside the quotes. */ - function parseQuoted($string) { + public function parseQuoted($string) { if (substr($string, 0, 1) != substr($string, -1, 1)) { // Start and end quotes must be the same. return FALSE; diff --git a/core/lib/Drupal/Component/PhpStorage/FileReadOnlyStorage.php b/core/lib/Drupal/Component/PhpStorage/FileReadOnlyStorage.php index 5795638a3738a0c53aa57d4d7bbdf6b1bf2da026..1fb2f217f4d9b625cd5cfe077266e01ae6d61a28 100644 --- a/core/lib/Drupal/Component/PhpStorage/FileReadOnlyStorage.php +++ b/core/lib/Drupal/Component/PhpStorage/FileReadOnlyStorage.php @@ -68,7 +68,7 @@ public function getFullPath($name) { /** * {@inheritdoc} */ - function writeable() { + public function writeable() { return FALSE; } diff --git a/core/lib/Drupal/Core/Access/RouteProcessorCsrf.php b/core/lib/Drupal/Core/Access/RouteProcessorCsrf.php index d529c0cf784708ac2e2df90fc3abb4a0a3fe8af0..9f2e7d409270c5cbff383112fc517a369042144d 100644 --- a/core/lib/Drupal/Core/Access/RouteProcessorCsrf.php +++ b/core/lib/Drupal/Core/Access/RouteProcessorCsrf.php @@ -25,7 +25,7 @@ class RouteProcessorCsrf implements OutboundRouteProcessorInterface { * @param \Drupal\Core\Access\CsrfTokenGenerator $csrf_token * The CSRF token generator. */ - function __construct(CsrfTokenGenerator $csrf_token) { + public function __construct(CsrfTokenGenerator $csrf_token) { $this->csrfToken = $csrf_token; } diff --git a/core/lib/Drupal/Core/Cache/DatabaseBackendFactory.php b/core/lib/Drupal/Core/Cache/DatabaseBackendFactory.php index 5cc87e91d7e61e3de42d21dcb127f98312b77818..8aa018ec45333615a60681f77cb51541157be2fe 100644 --- a/core/lib/Drupal/Core/Cache/DatabaseBackendFactory.php +++ b/core/lib/Drupal/Core/Cache/DatabaseBackendFactory.php @@ -28,7 +28,7 @@ class DatabaseBackendFactory implements CacheFactoryInterface { * @param \Drupal\Core\Cache\CacheTagsChecksumInterface $checksum_provider * The cache tags checksum provider. */ - function __construct(Connection $connection, CacheTagsChecksumInterface $checksum_provider) { + public function __construct(Connection $connection, CacheTagsChecksumInterface $checksum_provider) { $this->connection = $connection; $this->checksumProvider = $checksum_provider; } @@ -42,7 +42,7 @@ function __construct(Connection $connection, CacheTagsChecksumInterface $checksu * @return \Drupal\Core\Cache\DatabaseBackend * The cache backend object for the specified cache bin. */ - function get($bin) { + public function get($bin) { return new DatabaseBackend($this->connection, $this->checksumProvider, $bin); } diff --git a/core/lib/Drupal/Core/Cache/MemoryBackendFactory.php b/core/lib/Drupal/Core/Cache/MemoryBackendFactory.php index 680f850af0543078ff9ddc063b016a4eabb3f2ef..c5c6a950a4cea5dd5a5c1656df2ab56eb32458ac 100644 --- a/core/lib/Drupal/Core/Cache/MemoryBackendFactory.php +++ b/core/lib/Drupal/Core/Cache/MemoryBackendFactory.php @@ -14,7 +14,7 @@ class MemoryBackendFactory implements CacheFactoryInterface { /** * {@inheritdoc} */ - function get($bin) { + public function get($bin) { if (!isset($this->bins[$bin])) { $this->bins[$bin] = new MemoryBackend(); } diff --git a/core/lib/Drupal/Core/Cache/NullBackendFactory.php b/core/lib/Drupal/Core/Cache/NullBackendFactory.php index 3f11f565232d55c5eb1ede858d37a3f96c3d1b70..909b10531785cb43b57f037a0962d721e9bce33d 100644 --- a/core/lib/Drupal/Core/Cache/NullBackendFactory.php +++ b/core/lib/Drupal/Core/Cache/NullBackendFactory.php @@ -7,7 +7,7 @@ class NullBackendFactory implements CacheFactoryInterface { /** * {@inheritdoc} */ - function get($bin) { + public function get($bin) { return new NullBackend($bin); } diff --git a/core/lib/Drupal/Core/Cache/PhpBackendFactory.php b/core/lib/Drupal/Core/Cache/PhpBackendFactory.php index fdb32719366fccf4680d0dc6b89c5dfeb02217de..0091ed307ded05d5ebfd8e65d511b75e875d2ffb 100644 --- a/core/lib/Drupal/Core/Cache/PhpBackendFactory.php +++ b/core/lib/Drupal/Core/Cache/PhpBackendFactory.php @@ -30,7 +30,7 @@ public function __construct(CacheTagsChecksumInterface $checksum_provider) { * @return \Drupal\Core\Cache\PhpBackend * The cache backend object for the specified cache bin. */ - function get($bin) { + public function get($bin) { return new PhpBackend($bin, $this->checksumProvider); } diff --git a/core/lib/Drupal/Core/Config/ConfigFactory.php b/core/lib/Drupal/Core/Config/ConfigFactory.php index d91bec92e4094c82d61ae6f93d4d76fc08a9bb49..8c06cd1edf78b790b1942922910773dc036a297e 100644 --- a/core/lib/Drupal/Core/Config/ConfigFactory.php +++ b/core/lib/Drupal/Core/Config/ConfigFactory.php @@ -365,7 +365,7 @@ public function onConfigDelete(ConfigCrudEvent $event) { /** * {@inheritdoc} */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { $events[ConfigEvents::SAVE][] = ['onConfigSave', 255]; $events[ConfigEvents::DELETE][] = ['onConfigDelete', 255]; return $events; diff --git a/core/lib/Drupal/Core/Config/ConfigFactoryOverrideBase.php b/core/lib/Drupal/Core/Config/ConfigFactoryOverrideBase.php index 3ca16021fca2d62d85ce1ede5d7df7fd6ec937f2..82e066965e9dd32387f36fccae7eb0bc056fbb42 100644 --- a/core/lib/Drupal/Core/Config/ConfigFactoryOverrideBase.php +++ b/core/lib/Drupal/Core/Config/ConfigFactoryOverrideBase.php @@ -44,7 +44,7 @@ abstract public function onConfigRename(ConfigRenameEvent $event); /** * {@inheritdoc} */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { $events[ConfigEvents::COLLECTION_INFO][] = ['addCollections']; $events[ConfigEvents::SAVE][] = ['onConfigSave', 20]; $events[ConfigEvents::DELETE][] = ['onConfigDelete', 20]; diff --git a/core/lib/Drupal/Core/Config/ConfigImportValidateEventSubscriberBase.php b/core/lib/Drupal/Core/Config/ConfigImportValidateEventSubscriberBase.php index ca4964552d28cfd490c94baa8fe5b442886b087f..13263656cd1dc273b13c9cb97ce6a92f6aea7b04 100644 --- a/core/lib/Drupal/Core/Config/ConfigImportValidateEventSubscriberBase.php +++ b/core/lib/Drupal/Core/Config/ConfigImportValidateEventSubscriberBase.php @@ -22,7 +22,7 @@ abstract public function onConfigImporterValidate(ConfigImporterEvent $event); /** * {@inheritdoc} */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { $events[ConfigEvents::IMPORT_VALIDATE][] = ['onConfigImporterValidate', 20]; return $events; } diff --git a/core/lib/Drupal/Core/Config/Entity/Query/Query.php b/core/lib/Drupal/Core/Config/Entity/Query/Query.php index e75b98a868d404421160523dd5b7e242b763ab21..918853d34851f446079d5e5102d55943892899e1 100644 --- a/core/lib/Drupal/Core/Config/Entity/Query/Query.php +++ b/core/lib/Drupal/Core/Config/Entity/Query/Query.php @@ -49,7 +49,7 @@ class Query extends QueryBase implements QueryInterface { * @param array $namespaces * List of potential namespaces of the classes belonging to this query. */ - function __construct(EntityTypeInterface $entity_type, $conjunction, ConfigFactoryInterface $config_factory, KeyValueFactoryInterface $key_value_factory, array $namespaces) { + public function __construct(EntityTypeInterface $entity_type, $conjunction, ConfigFactoryInterface $config_factory, KeyValueFactoryInterface $key_value_factory, array $namespaces) { parent::__construct($entity_type, $conjunction, $namespaces); $this->configFactory = $config_factory; $this->keyValueFactory = $key_value_factory; diff --git a/core/lib/Drupal/Core/Config/Entity/Query/QueryFactory.php b/core/lib/Drupal/Core/Config/Entity/Query/QueryFactory.php index ac12f56e743df9ed1a8f029b5b2d8bbe95e67970..f87e618b3eec29e5ea362cd3d9d23362977d5162 100644 --- a/core/lib/Drupal/Core/Config/Entity/Query/QueryFactory.php +++ b/core/lib/Drupal/Core/Config/Entity/Query/QueryFactory.php @@ -249,7 +249,7 @@ public function onConfigDelete(ConfigCrudEvent $event) { /** * {@inheritdoc} */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { $events[ConfigEvents::SAVE][] = ['onConfigSave', 128]; $events[ConfigEvents::DELETE][] = ['onConfigDelete', 128]; return $events; diff --git a/core/lib/Drupal/Core/Config/FileStorageFactory.php b/core/lib/Drupal/Core/Config/FileStorageFactory.php index 70c2582a8fa4abb546c56fa6ca7df5c92044bbf1..9e324975f9a05be685f30bfc18564322d1c83b5b 100644 --- a/core/lib/Drupal/Core/Config/FileStorageFactory.php +++ b/core/lib/Drupal/Core/Config/FileStorageFactory.php @@ -15,7 +15,7 @@ class FileStorageFactory { * @deprecated in Drupal 8.0.x and will be removed before 9.0.0. Drupal core * no longer creates an active directory. */ - static function getActive() { + public static function getActive() { return new FileStorage(config_get_config_directory(CONFIG_ACTIVE_DIRECTORY)); } @@ -24,7 +24,7 @@ static function getActive() { * * @return \Drupal\Core\Config\FileStorage FileStorage */ - static function getSync() { + public static function getSync() { return new FileStorage(config_get_config_directory(CONFIG_SYNC_DIRECTORY)); } diff --git a/core/lib/Drupal/Core/Config/Schema/ConfigSchemaDiscovery.php b/core/lib/Drupal/Core/Config/Schema/ConfigSchemaDiscovery.php index b086c62cbb56d6dc17151695f8d098d8dd26987b..3e6301046ccfef970e6bae86ea7f14f470c58fec 100644 --- a/core/lib/Drupal/Core/Config/Schema/ConfigSchemaDiscovery.php +++ b/core/lib/Drupal/Core/Config/Schema/ConfigSchemaDiscovery.php @@ -26,7 +26,7 @@ class ConfigSchemaDiscovery implements DiscoveryInterface { * @param $schema_storage * The storage object to use for reading schema data. */ - function __construct(StorageInterface $schema_storage) { + public function __construct(StorageInterface $schema_storage) { $this->schemaStorage = $schema_storage; } diff --git a/core/lib/Drupal/Core/Database/Connection.php b/core/lib/Drupal/Core/Database/Connection.php index f6963c585b774ec5ca94a3a7036ecf1b95a1e913..803689b2c4f534654f10b923e37e7d94a770bfc0 100644 --- a/core/lib/Drupal/Core/Database/Connection.php +++ b/core/lib/Drupal/Core/Database/Connection.php @@ -1274,7 +1274,7 @@ protected function generateTemporaryTableName() { * @return string * The name of the temporary table. */ - abstract function queryTemporary($query, array $args = [], array $options = []); + abstract public function queryTemporary($query, array $args = [], array $options = []); /** * Returns the type of database driver. diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Install/Tasks.php b/core/lib/Drupal/Core/Database/Driver/mysql/Install/Tasks.php index b19af64cb46a89bb7fd0516c51553de532e2c469..0b1d7dde7d075479c8354e122d9bdd61e4d82a67 100644 --- a/core/lib/Drupal/Core/Database/Driver/mysql/Install/Tasks.php +++ b/core/lib/Drupal/Core/Database/Driver/mysql/Install/Tasks.php @@ -140,7 +140,7 @@ public function getFormOptions(array $database) { /** * Ensure that InnoDB is available. */ - function ensureInnoDbAvailable() { + public function ensureInnoDbAvailable() { $engines = Database::getConnection()->query('SHOW ENGINES')->fetchAllKeyed(); if (isset($engines['MyISAM']) && $engines['MyISAM'] == 'DEFAULT' && !isset($engines['InnoDB'])) { $this->fail(t('The MyISAM storage engine is not supported.')); diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php index 33579de8e13c10e87569689e401176e4885be40d..d2cb36b60400a4f6f55dc041ffe036361ce28882 100644 --- a/core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php +++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php @@ -132,7 +132,7 @@ protected function checkEncoding() { * * Unserializing does not work on Postgresql 9 when bytea_output is 'hex'. */ - function checkBinaryOutput() { + public function checkBinaryOutput() { // PostgreSQL < 9 doesn't support bytea_output, so verify we are running // at least PostgreSQL 9. $database_connection = Database::getConnection(); @@ -236,7 +236,7 @@ protected function checkStandardConformingStringsSuccess() { /** * Make PostgreSQL Drupal friendly. */ - function initializeDatabase() { + public function initializeDatabase() { // We create some functions using global names instead of prefixing them // like we do with table names. This is so that we don't double up if more // than one instance of Drupal is running on a single database. We therefore diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php index 19efe50c0b2dddd8a051513ffc405057fafa1c2d..33d037ef65e027b8afb591edb89ce093d5b9939b 100644 --- a/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php +++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php @@ -386,7 +386,7 @@ protected function processField($field) { * This maps a generic data type in combination with its data size * to the engine-specific data type. */ - function getFieldTypeMap() { + public function getFieldTypeMap() { // Put :normal last so it gets preserved by array_flip. This makes // it much easier for modules (such as schema.module) to map // database types back into schema types. @@ -471,7 +471,7 @@ public function tableExists($table) { return (bool) $this->connection->query("SELECT 1 FROM pg_tables WHERE schemaname = :schema AND tablename = :table", [':schema' => $prefixInfo['schema'], ':table' => $prefixInfo['table']])->fetchField(); } - function renameTable($table, $new_name) { + public function renameTable($table, $new_name) { if (!$this->tableExists($table)) { throw new SchemaObjectDoesNotExistException(t("Cannot rename @table to @table_new: table @table doesn't exist.", ['@table' => $table, '@table_new' => $new_name])); } @@ -664,7 +664,7 @@ public function dropPrimaryKey($table) { return TRUE; } - function addUniqueKey($table, $name, $fields) { + public function addUniqueKey($table, $name, $fields) { if (!$this->tableExists($table)) { throw new SchemaObjectDoesNotExistException(t("Cannot add unique key @name to table @table: table doesn't exist.", ['@table' => $table, '@name' => $name])); } diff --git a/core/lib/Drupal/Core/Database/Query/Condition.php b/core/lib/Drupal/Core/Database/Query/Condition.php index d04fec58e3c058ccf352298c2697db0d89ed1cb6..51693576e86513488e110191c9caf484037f083b 100644 --- a/core/lib/Drupal/Core/Database/Query/Condition.php +++ b/core/lib/Drupal/Core/Database/Query/Condition.php @@ -341,7 +341,7 @@ public function __toString() { * Only copies fields that implement Drupal\Core\Database\Query\ConditionInterface. Also sets * $this->changed to TRUE. */ - function __clone() { + public function __clone() { $this->changed = TRUE; foreach ($this->conditions as $key => $condition) { if ($key !== '#conjunction') { diff --git a/core/lib/Drupal/Core/Database/Query/SelectExtender.php b/core/lib/Drupal/Core/Database/Query/SelectExtender.php index 56fe7c132519556b59e37feca4450a41009dc009..9082ca8056a5f06e0370f22a719b6a0ef8383e62 100644 --- a/core/lib/Drupal/Core/Database/Query/SelectExtender.php +++ b/core/lib/Drupal/Core/Database/Query/SelectExtender.php @@ -440,7 +440,7 @@ public function countQuery() { /** * {@inheritdoc} */ - function isNull($field) { + public function isNull($field) { $this->query->isNull($field); return $this; } @@ -448,7 +448,7 @@ function isNull($field) { /** * {@inheritdoc} */ - function isNotNull($field) { + public function isNotNull($field) { $this->query->isNotNull($field); return $this; } diff --git a/core/lib/Drupal/Core/Database/Schema.php b/core/lib/Drupal/Core/Database/Schema.php index eb98bb1d58881c936dd71efb68a69ff086cbb465..80a68f6e5acc8dd4a16430a520318249aee317fb 100644 --- a/core/lib/Drupal/Core/Database/Schema.php +++ b/core/lib/Drupal/Core/Database/Schema.php @@ -105,7 +105,7 @@ protected function getPrefixInfo($table = 'default', $add_prefix = TRUE) { * * This prevents using {} around non-table names like indexes and keys. */ - function prefixNonTable($table) { + public function prefixNonTable($table) { $args = func_get_args(); $info = $this->getPrefixInfo($table); $args[0] = $info['table']; diff --git a/core/lib/Drupal/Core/Database/StatementInterface.php b/core/lib/Drupal/Core/Database/StatementInterface.php index c0ee92936a37c0d2cf44166788feaa7e49e5c75f..a34bf617fabb159d6d1fb858e07290eae4904782 100644 --- a/core/lib/Drupal/Core/Database/StatementInterface.php +++ b/core/lib/Drupal/Core/Database/StatementInterface.php @@ -155,7 +155,7 @@ public function fetchAssoc(); * @return * An array of results. */ - function fetchAll($mode = NULL, $column_index = NULL, $constructor_arguments = NULL); + public function fetchAll($mode = NULL, $column_index = NULL, $constructor_arguments = NULL); /** * Returns an entire single column of a result set as an indexed array. diff --git a/core/lib/Drupal/Core/Entity/Query/QueryBase.php b/core/lib/Drupal/Core/Entity/Query/QueryBase.php index f805747e9cf5acc05473a16bd2e6435d9bceeb4e..ed3d12b2c857316c0f95d8d821a93735151c8b43 100644 --- a/core/lib/Drupal/Core/Entity/Query/QueryBase.php +++ b/core/lib/Drupal/Core/Entity/Query/QueryBase.php @@ -325,7 +325,7 @@ public function tableSort(&$headers) { /** * Makes sure that the Condition object is cloned as well. */ - function __clone() { + public function __clone() { $this->condition = clone $this->condition; } diff --git a/core/lib/Drupal/Core/Entity/Query/Sql/QueryAggregate.php b/core/lib/Drupal/Core/Entity/Query/Sql/QueryAggregate.php index f8e42f05bcdfa0248ba6482323160654a6819ae8..2d2aacfdf326e5c527be26e19b07208527beb2d1 100644 --- a/core/lib/Drupal/Core/Entity/Query/Sql/QueryAggregate.php +++ b/core/lib/Drupal/Core/Entity/Query/Sql/QueryAggregate.php @@ -151,7 +151,7 @@ protected function finish() { * replaced with underscores and if a default fallback to .value happened, * the _value is stripped. */ - function createSqlAlias($field, $sql_field) { + public function createSqlAlias($field, $sql_field) { $alias = str_replace('.', '_', $sql_field); // If the alias contains of field_*_value remove the _value at the end. if (substr($alias, 0, 6) === 'field_' && substr($field, -6) !== '_value' && substr($alias, -6) === '_value') { diff --git a/core/lib/Drupal/Core/EventSubscriber/AcceptNegotiation406.php b/core/lib/Drupal/Core/EventSubscriber/AcceptNegotiation406.php index d644fa531aa3abc73b2cb413e6309749b1d3f06f..61309c64d5ffca10ebdc0022d8fb4879524deea2 100644 --- a/core/lib/Drupal/Core/EventSubscriber/AcceptNegotiation406.php +++ b/core/lib/Drupal/Core/EventSubscriber/AcceptNegotiation406.php @@ -36,7 +36,7 @@ public function onViewDetect406(GetResponseForControllerResultEvent $event) { /** * {@inheritdoc} */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { $events[KernelEvents::VIEW][] = ['onViewDetect406', -10]; return $events; diff --git a/core/lib/Drupal/Core/EventSubscriber/ConfigSnapshotSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/ConfigSnapshotSubscriber.php index 330970138d9de562804d73b859735d143172aafc..289eae09d9f46b3b43c556a756235d340cbd1d94 100644 --- a/core/lib/Drupal/Core/EventSubscriber/ConfigSnapshotSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/ConfigSnapshotSubscriber.php @@ -64,7 +64,7 @@ public function onConfigImporterImport(ConfigImporterEvent $event) { * @return array * An array of event listener definitions. */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { $events[ConfigEvents::IMPORT][] = ['onConfigImporterImport', 40]; return $events; } diff --git a/core/lib/Drupal/Core/EventSubscriber/EntityRouteAlterSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/EntityRouteAlterSubscriber.php index ae8dafc4e3d88cef41b33c607253e09615377524..bca8f684b1c0282ea2399b1ad9d9ec4fa804a226 100644 --- a/core/lib/Drupal/Core/EventSubscriber/EntityRouteAlterSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/EntityRouteAlterSubscriber.php @@ -52,7 +52,7 @@ public function onRoutingRouteAlterSetType(RouteBuildEvent $event) { /** * {@inheritdoc} */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { $events[RoutingEvents::ALTER][] = ['onRoutingRouteAlterSetType', -150]; return $events; } diff --git a/core/lib/Drupal/Core/EventSubscriber/KernelDestructionSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/KernelDestructionSubscriber.php index 79d7dd5a39a59160728c2bfa8c2624c6d5c48a05..0619695aacb68d0b088f95beca59e9346061009e 100644 --- a/core/lib/Drupal/Core/EventSubscriber/KernelDestructionSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/KernelDestructionSubscriber.php @@ -58,7 +58,7 @@ public function onKernelTerminate(PostResponseEvent $event) { * @return array * An array of event listener definitions. */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { // Run this subscriber after others as those might use services that need // to be terminated as well or run code that needs to run before // termination. diff --git a/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php index 04a7fd6d03da72a821aed7499167b2598a66fbe9..f63ade66ac3120c3188ddc27008c41de13448370 100644 --- a/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php @@ -101,7 +101,7 @@ public function onViewRenderArray(GetResponseForControllerResultEvent $event) { /** * {@inheritdoc} */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { $events[KernelEvents::VIEW][] = ['onViewRenderArray']; return $events; diff --git a/core/lib/Drupal/Core/EventSubscriber/MenuRouterRebuildSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/MenuRouterRebuildSubscriber.php index 1bc662c54df4b7f12a1ebe2159ab5b88633288e1..521c58206b44ef7e8c5f8d5b93b6159842fde8e8 100644 --- a/core/lib/Drupal/Core/EventSubscriber/MenuRouterRebuildSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/MenuRouterRebuildSubscriber.php @@ -80,7 +80,7 @@ protected function menuLinksRebuild() { /** * {@inheritdoc} */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { // Run after CachedRouteRebuildSubscriber. $events[RoutingEvents::FINISHED][] = ['onRouterRebuild', 100]; return $events; diff --git a/core/lib/Drupal/Core/EventSubscriber/ParamConverterSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/ParamConverterSubscriber.php index 19590ae6dd00cb547ae4327bf323b35437699b01..3b12516853168c1ce5db80db1cf8c5cc05f18b07 100644 --- a/core/lib/Drupal/Core/EventSubscriber/ParamConverterSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/ParamConverterSubscriber.php @@ -43,7 +43,7 @@ public function onRoutingRouteAlterSetParameterConverters(RouteBuildEvent $event /** * {@inheritdoc} */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { // Run after \Drupal\system\EventSubscriber\AdminRouteSubscriber. $events[RoutingEvents::ALTER][] = ['onRoutingRouteAlterSetParameterConverters', -220]; return $events; diff --git a/core/lib/Drupal/Core/EventSubscriber/PathSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/PathSubscriber.php index 737c77cd16772f0f07087c1021e87176bde5c11f..1fec198a1dcbbb7987a88ce0e60e754c2f207416 100644 --- a/core/lib/Drupal/Core/EventSubscriber/PathSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/PathSubscriber.php @@ -70,7 +70,7 @@ public function onKernelTerminate(PostResponseEvent $event) { * @return array * An array of event listener definitions. */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { $events[KernelEvents::CONTROLLER][] = ['onKernelController', 200]; $events[KernelEvents::TERMINATE][] = ['onKernelTerminate', 200]; return $events; diff --git a/core/lib/Drupal/Core/EventSubscriber/RedirectLeadingSlashesSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/RedirectLeadingSlashesSubscriber.php index ad7b049c7b8eea5f8576fa1eff5a3c70e82083ec..635fca1a8543d4cb76a615cb9306df39bbf03c6d 100644 --- a/core/lib/Drupal/Core/EventSubscriber/RedirectLeadingSlashesSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/RedirectLeadingSlashesSubscriber.php @@ -41,7 +41,7 @@ public function redirect(GetResponseEvent $event) { /** * {@inheritdoc} */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { $events[KernelEvents::REQUEST][] = ['redirect', 1000]; return $events; } diff --git a/core/lib/Drupal/Core/EventSubscriber/RedirectResponseSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/RedirectResponseSubscriber.php index bf5ca05dbe460606d7aae90b206be54a20cbe69c..8397bdef4e50e5f25b1e48e6bd4bcc7ebfcbed00 100644 --- a/core/lib/Drupal/Core/EventSubscriber/RedirectResponseSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/RedirectResponseSubscriber.php @@ -165,7 +165,7 @@ public function sanitizeDestination(GetResponseEvent $event) { * @return array * An array of event listener definitions. */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { $events[KernelEvents::RESPONSE][] = ['checkRedirectUrl']; $events[KernelEvents::REQUEST][] = ['sanitizeDestination', 100]; return $events; diff --git a/core/lib/Drupal/Core/EventSubscriber/ReplicaDatabaseIgnoreSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/ReplicaDatabaseIgnoreSubscriber.php index b0228f888fb3fabba134a654af3a7e0b31f76306..fc123d36d1a854a2212f06782fe2c7f111a4fdea 100644 --- a/core/lib/Drupal/Core/EventSubscriber/ReplicaDatabaseIgnoreSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/ReplicaDatabaseIgnoreSubscriber.php @@ -47,7 +47,7 @@ public function checkReplicaServer(GetResponseEvent $event) { /** * {@inheritdoc} */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { $events[KernelEvents::REQUEST][] = ['checkReplicaServer']; return $events; } diff --git a/core/lib/Drupal/Core/EventSubscriber/RequestCloseSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/RequestCloseSubscriber.php index 765b1deb8c1c6ee3a5ea136dbc7cfb066eb47f92..81dd1efaa91577bdd65484997e07f0807f0cd9aa 100644 --- a/core/lib/Drupal/Core/EventSubscriber/RequestCloseSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/RequestCloseSubscriber.php @@ -23,7 +23,7 @@ class RequestCloseSubscriber implements EventSubscriberInterface { * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler. */ - function __construct(ModuleHandlerInterface $module_handler) { + public function __construct(ModuleHandlerInterface $module_handler) { $this->moduleHandler = $module_handler; } @@ -48,7 +48,7 @@ public function onTerminate(PostResponseEvent $event) { * @return array * An array of event listener definitions. */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { $events[KernelEvents::TERMINATE][] = ['onTerminate', 100]; return $events; diff --git a/core/lib/Drupal/Core/EventSubscriber/RouteEnhancerSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/RouteEnhancerSubscriber.php index f12174a6bbab66b0feff383f2c23b1d8ea3626e6..8763842b58558cdd410b1bb95675a15039ad7b86 100644 --- a/core/lib/Drupal/Core/EventSubscriber/RouteEnhancerSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/RouteEnhancerSubscriber.php @@ -40,7 +40,7 @@ public function onRouteAlter(RouteBuildEvent $event) { /** * {@inheritdoc} */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { $events[RoutingEvents::ALTER][] = ['onRouteAlter', -300]; return $events; } diff --git a/core/lib/Drupal/Core/EventSubscriber/RouteFilterSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/RouteFilterSubscriber.php index 79f98a43074d4206844b6ff24ea4cf9198491b3d..f64b8db514feea2950d34785d378383f08b159c1 100644 --- a/core/lib/Drupal/Core/EventSubscriber/RouteFilterSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/RouteFilterSubscriber.php @@ -42,7 +42,7 @@ public function onRouteAlter(RouteBuildEvent $event) { /** * {@inheritdoc} */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { $events[RoutingEvents::ALTER][] = ['onRouteAlter', -300]; return $events; } diff --git a/core/lib/Drupal/Core/EventSubscriber/RouteMethodSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/RouteMethodSubscriber.php index b43ebf4b8bd636e762aafcaf5ac36aa50e8d7d69..31888352137e57f1845efed15183e25cf918b4ea 100644 --- a/core/lib/Drupal/Core/EventSubscriber/RouteMethodSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/RouteMethodSubscriber.php @@ -35,7 +35,7 @@ public function onRouteBuilding(RouteBuildEvent $event) { /** * {@inheritdoc} */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { // Set a higher priority to ensure that routes get the default HTTP methods // as early as possible. $events[RoutingEvents::ALTER][] = ['onRouteBuilding', 5000]; diff --git a/core/lib/Drupal/Core/FileTransfer/FTP.php b/core/lib/Drupal/Core/FileTransfer/FTP.php index 2238f330c1368fbe5fc3810d6ffec0ec2ac94066..83cf66bed4837dfd3c7a341185832876f29a5cd7 100644 --- a/core/lib/Drupal/Core/FileTransfer/FTP.php +++ b/core/lib/Drupal/Core/FileTransfer/FTP.php @@ -21,7 +21,7 @@ public function __construct($jail, $username, $password, $hostname, $port) { /** * {@inheritdoc} */ - static function factory($jail, $settings) { + public static function factory($jail, $settings) { $username = empty($settings['username']) ? '' : $settings['username']; $password = empty($settings['password']) ? '' : $settings['password']; $hostname = empty($settings['advanced']['hostname']) ? 'localhost' : $settings['advanced']['hostname']; diff --git a/core/lib/Drupal/Core/FileTransfer/FTPExtension.php b/core/lib/Drupal/Core/FileTransfer/FTPExtension.php index 7cb0c540c7773eb1562a4799c176bc6a7ad474a9..c5f1b22b30d5644bb1a47a19b6e5c6284aed7121 100644 --- a/core/lib/Drupal/Core/FileTransfer/FTPExtension.php +++ b/core/lib/Drupal/Core/FileTransfer/FTPExtension.php @@ -101,7 +101,7 @@ public function isFile($path) { /** * {@inheritdoc} */ - function chmodJailed($path, $mode, $recursive) { + public function chmodJailed($path, $mode, $recursive) { if (!ftp_chmod($this->connection, $mode, $path)) { throw new FileTransferException("Unable to set permissions on %file", NULL, ['%file' => $path]); } diff --git a/core/lib/Drupal/Core/FileTransfer/FileTransfer.php b/core/lib/Drupal/Core/FileTransfer/FileTransfer.php index a3cf6781e009fb25bc4c4963cef1f29e15f401e3..25014f1338058d927b03620e6aadb58951d24f73 100644 --- a/core/lib/Drupal/Core/FileTransfer/FileTransfer.php +++ b/core/lib/Drupal/Core/FileTransfer/FileTransfer.php @@ -49,7 +49,7 @@ abstract class FileTransfer { * be restricted to. This prevents the FileTransfer classes from being * able to touch other parts of the filesystem. */ - function __construct($jail) { + public function __construct($jail) { $this->jail = $jail; } @@ -73,7 +73,7 @@ function __construct($jail) { * * @throws \Drupal\Core\FileTransfer\FileTransferException */ - static function factory($jail, $settings) { + public static function factory($jail, $settings) { throw new FileTransferException('FileTransfer::factory() static method not overridden by FileTransfer subclass.'); } @@ -90,7 +90,7 @@ static function factory($jail, $settings) { * @return string|bool * The variable specified in $name. */ - function __get($name) { + public function __get($name) { if ($name == 'connection') { $this->connect(); return $this->connection; @@ -249,7 +249,7 @@ protected final function fixRemotePath($path, $strip_chroot = TRUE) { * @return string * The modified path. */ - function sanitizePath($path) { + public function sanitizePath($path) { $path = str_replace('\\', '/', $path); // Windows path sanitization. if (substr($path, -1) == '/') { $path = substr($path, 0, -1); @@ -347,7 +347,7 @@ abstract public function isFile($path); * @return string|bool * If successful, the chroot path for this connection, otherwise FALSE. */ - function findChroot() { + public function findChroot() { // If the file exists as is, there is no chroot. $path = __FILE__; $path = $this->fixRemotePath($path, FALSE); @@ -373,7 +373,7 @@ function findChroot() { /** * Sets the chroot and changes the jail to match the correct path scheme. */ - function setChroot() { + public function setChroot() { $this->chroot = $this->findChroot(); $this->jail = $this->fixRemotePath($this->jail); } diff --git a/core/lib/Drupal/Core/FileTransfer/FileTransferException.php b/core/lib/Drupal/Core/FileTransfer/FileTransferException.php index f8d0d07f4062f2ed0e40941029677f487b5b6458..bcfd602d9e68b91a2649ec1731f1e464da6e2143 100644 --- a/core/lib/Drupal/Core/FileTransfer/FileTransferException.php +++ b/core/lib/Drupal/Core/FileTransfer/FileTransferException.php @@ -24,7 +24,7 @@ class FileTransferException extends \RuntimeException { * @param array $arguments * Arguments to be used in this exception. */ - function __construct($message, $code = 0, $arguments = []) { + public function __construct($message, $code = 0, $arguments = []) { parent::__construct($message, $code); $this->arguments = $arguments; } diff --git a/core/lib/Drupal/Core/FileTransfer/Local.php b/core/lib/Drupal/Core/FileTransfer/Local.php index 9320f4a3a1d2ca1dab2a1886ad6365f5f197e3de..1da4e48eaa75f309ab4a8cd4af584d15a3a7f249 100644 --- a/core/lib/Drupal/Core/FileTransfer/Local.php +++ b/core/lib/Drupal/Core/FileTransfer/Local.php @@ -17,7 +17,7 @@ public function connect() { /** * {@inheritdoc} */ - static function factory($jail, $settings) { + public static function factory($jail, $settings) { return new Local($jail); } diff --git a/core/lib/Drupal/Core/FileTransfer/SSH.php b/core/lib/Drupal/Core/FileTransfer/SSH.php index 256aaf4c635839117d5285d1354e9248841cb2c9..5795526e93f8514595bff8916efeb0c765b38b46 100644 --- a/core/lib/Drupal/Core/FileTransfer/SSH.php +++ b/core/lib/Drupal/Core/FileTransfer/SSH.php @@ -10,7 +10,7 @@ class SSH extends FileTransfer implements ChmodInterface { /** * {@inheritdoc} */ - function __construct($jail, $username, $password, $hostname = "localhost", $port = 22) { + public function __construct($jail, $username, $password, $hostname = "localhost", $port = 22) { $this->username = $username; $this->password = $password; $this->hostname = $hostname; @@ -34,7 +34,7 @@ public function connect() { /** * {@inheritdoc} */ - static function factory($jail, $settings) { + public static function factory($jail, $settings) { $username = empty($settings['username']) ? '' : $settings['username']; $password = empty($settings['password']) ? '' : $settings['password']; $hostname = empty($settings['advanced']['hostname']) ? 'localhost' : $settings['advanced']['hostname']; @@ -127,7 +127,7 @@ public function isFile($path) { /** * {@inheritdoc} */ - function chmodJailed($path, $mode, $recursive) { + public function chmodJailed($path, $mode, $recursive) { $cmd = sprintf("chmod %s%o %s", $recursive ? '-R ' : '', $mode, escapeshellarg($path)); if (@!ssh2_exec($this->connection, $cmd)) { throw new FileTransferException('Cannot change permissions of @path.', NULL, ['@path' => $path]); diff --git a/core/lib/Drupal/Core/KeyValueStore/DatabaseStorageExpirable.php b/core/lib/Drupal/Core/KeyValueStore/DatabaseStorageExpirable.php index 8e487d18330119778081a749c57d7bad708adfe6..c6514962d6371029d28881416578b71808836555 100644 --- a/core/lib/Drupal/Core/KeyValueStore/DatabaseStorageExpirable.php +++ b/core/lib/Drupal/Core/KeyValueStore/DatabaseStorageExpirable.php @@ -71,7 +71,7 @@ public function getAll() { /** * {@inheritdoc} */ - function setWithExpire($key, $value, $expire) { + public function setWithExpire($key, $value, $expire) { $this->connection->merge($this->table) ->keys([ 'name' => $key, @@ -87,7 +87,7 @@ function setWithExpire($key, $value, $expire) { /** * {@inheritdoc} */ - function setWithExpireIfNotExists($key, $value, $expire) { + public function setWithExpireIfNotExists($key, $value, $expire) { $result = $this->connection->merge($this->table) ->insertFields([ 'collection' => $this->collection, @@ -104,7 +104,7 @@ function setWithExpireIfNotExists($key, $value, $expire) { /** * {@inheritdoc} */ - function setMultipleWithExpire(array $data, $expire) { + public function setMultipleWithExpire(array $data, $expire) { foreach ($data as $key => $value) { $this->setWithExpire($key, $value, $expire); } diff --git a/core/lib/Drupal/Core/KeyValueStore/KeyValueDatabaseExpirableFactory.php b/core/lib/Drupal/Core/KeyValueStore/KeyValueDatabaseExpirableFactory.php index 7815b8c15788b1bc7a6e3aea51fee32dbb34c9b1..f9c9b4c17a6147023a6647f4da33c6b3c86a0e03 100644 --- a/core/lib/Drupal/Core/KeyValueStore/KeyValueDatabaseExpirableFactory.php +++ b/core/lib/Drupal/Core/KeyValueStore/KeyValueDatabaseExpirableFactory.php @@ -39,7 +39,7 @@ class KeyValueDatabaseExpirableFactory implements KeyValueExpirableFactoryInterf * @param \Drupal\Core\Database\Connection $connection * The Connection object containing the key-value tables. */ - function __construct(SerializationInterface $serializer, Connection $connection) { + public function __construct(SerializationInterface $serializer, Connection $connection) { $this->serializer = $serializer; $this->connection = $connection; } diff --git a/core/lib/Drupal/Core/KeyValueStore/KeyValueDatabaseFactory.php b/core/lib/Drupal/Core/KeyValueStore/KeyValueDatabaseFactory.php index d70cb1196e373aa7619eda574f6dd3301f768f41..3bb45c16c4321a4ec1dd87effcb3c72689557eb6 100644 --- a/core/lib/Drupal/Core/KeyValueStore/KeyValueDatabaseFactory.php +++ b/core/lib/Drupal/Core/KeyValueStore/KeyValueDatabaseFactory.php @@ -32,7 +32,7 @@ class KeyValueDatabaseFactory implements KeyValueFactoryInterface { * @param \Drupal\Core\Database\Connection $connection * The Connection object containing the key-value tables. */ - function __construct(SerializationInterface $serializer, Connection $connection) { + public function __construct(SerializationInterface $serializer, Connection $connection) { $this->serializer = $serializer; $this->connection = $connection; } diff --git a/core/lib/Drupal/Core/KeyValueStore/KeyValueFactory.php b/core/lib/Drupal/Core/KeyValueStore/KeyValueFactory.php index 0801ca1f0a79c82583970f4163ac5628145c649c..eeaf510ea2ca5031b74705c1d9ac84cffa78106d 100644 --- a/core/lib/Drupal/Core/KeyValueStore/KeyValueFactory.php +++ b/core/lib/Drupal/Core/KeyValueStore/KeyValueFactory.php @@ -50,7 +50,7 @@ class KeyValueFactory implements KeyValueFactoryInterface { * @param array $options * (optional) Collection-specific storage override options. */ - function __construct(ContainerInterface $container, array $options = []) { + public function __construct(ContainerInterface $container, array $options = []) { $this->container = $container; $this->options = $options; } diff --git a/core/lib/Drupal/Core/Password/PhpassHashedPassword.php b/core/lib/Drupal/Core/Password/PhpassHashedPassword.php index 28313d266c794cbf0b8352ad18bcab57b76845e7..0f938a0356d52edf65ae7bc15ab4e63116777a1f 100644 --- a/core/lib/Drupal/Core/Password/PhpassHashedPassword.php +++ b/core/lib/Drupal/Core/Password/PhpassHashedPassword.php @@ -47,7 +47,7 @@ class PhpassHashedPassword implements PasswordInterface { * The number of times is calculated by raising 2 to the power of the given * value. */ - function __construct($countLog2) { + public function __construct($countLog2) { // Ensure that $countLog2 is within set bounds. $this->countLog2 = $this->enforceLog2Boundaries($countLog2); } diff --git a/core/lib/Drupal/Core/PhpStorage/PhpStorageFactory.php b/core/lib/Drupal/Core/PhpStorage/PhpStorageFactory.php index 17f889e4b182a102061cc32eebcbc5bcd5b4ca78..cdacff6fe1bfecf7758f6c3cff31e76889cc532b 100644 --- a/core/lib/Drupal/Core/PhpStorage/PhpStorageFactory.php +++ b/core/lib/Drupal/Core/PhpStorage/PhpStorageFactory.php @@ -28,7 +28,7 @@ class PhpStorageFactory { * @return \Drupal\Component\PhpStorage\PhpStorageInterface * An instantiated storage for the specified name. */ - static function get($name) { + public static function get($name) { $configuration = []; $overrides = Settings::get('php_storage'); if (isset($overrides[$name])) { diff --git a/core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php b/core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php index bbcc858c9ccae4bfadd91dbfe4dbde316450fd19..9ecbaa05375428543655d307aa94373c2aa4fd47 100644 --- a/core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php +++ b/core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php @@ -50,7 +50,7 @@ class AnnotatedClassDiscovery extends ComponentAnnotatedClassDiscovery { * @param string[] $annotation_namespaces * (optional) Additional namespaces to scan for annotation definitions. */ - function __construct($subdir, \Traversable $root_namespaces, $plugin_definition_annotation_name = 'Drupal\Component\Annotation\Plugin', array $annotation_namespaces = []) { + public function __construct($subdir, \Traversable $root_namespaces, $plugin_definition_annotation_name = 'Drupal\Component\Annotation\Plugin', array $annotation_namespaces = []) { if ($subdir) { // Prepend a directory separator to $subdir, // if it does not already have one. diff --git a/core/lib/Drupal/Core/Plugin/Discovery/HookDiscovery.php b/core/lib/Drupal/Core/Plugin/Discovery/HookDiscovery.php index e366bcb28977dd36e6b59a2e06998dc54ed72845..51040cd0d3f641ee2de22c07731d33fa89e8718b 100644 --- a/core/lib/Drupal/Core/Plugin/Discovery/HookDiscovery.php +++ b/core/lib/Drupal/Core/Plugin/Discovery/HookDiscovery.php @@ -36,7 +36,7 @@ class HookDiscovery implements DiscoveryInterface { * The Drupal hook that a module can implement in order to interface to * this discovery class. */ - function __construct(ModuleHandlerInterface $module_handler, $hook) { + public function __construct(ModuleHandlerInterface $module_handler, $hook) { $this->moduleHandler = $module_handler; $this->hook = $hook; } diff --git a/core/lib/Drupal/Core/Plugin/Discovery/YamlDiscovery.php b/core/lib/Drupal/Core/Plugin/Discovery/YamlDiscovery.php index af5630c764b276e988f348d2e60756ed6c6b29fd..586655806016cf1124d6c1c1651cdbbfd698c43c 100644 --- a/core/lib/Drupal/Core/Plugin/Discovery/YamlDiscovery.php +++ b/core/lib/Drupal/Core/Plugin/Discovery/YamlDiscovery.php @@ -47,7 +47,7 @@ class YamlDiscovery implements DiscoveryInterface { * @param array $directories * An array of directories to scan. */ - function __construct($name, array $directories) { + public function __construct($name, array $directories) { $this->discovery = new CoreYamlDiscovery($name, $directories); } diff --git a/core/lib/Drupal/Core/PrivateKey.php b/core/lib/Drupal/Core/PrivateKey.php index 9d0f73602a590facf82423a6830b6590babf2c4f..d7ac845f58a661a3b15eb95d51999c36f085e6cc 100644 --- a/core/lib/Drupal/Core/PrivateKey.php +++ b/core/lib/Drupal/Core/PrivateKey.php @@ -23,7 +23,7 @@ class PrivateKey { * @param \Drupal\Core\State\StateInterface $state * The state service. */ - function __construct(StateInterface $state) { + public function __construct(StateInterface $state) { $this->state = $state; } diff --git a/core/lib/Drupal/Core/Queue/DatabaseQueue.php b/core/lib/Drupal/Core/Queue/DatabaseQueue.php index 710a99b4941e56673e0ebaae1307fcf663be4952..e70000ee2264f910cf58031a4c0141dfe8e3ed8a 100644 --- a/core/lib/Drupal/Core/Queue/DatabaseQueue.php +++ b/core/lib/Drupal/Core/Queue/DatabaseQueue.php @@ -42,7 +42,7 @@ class DatabaseQueue implements ReliableQueueInterface, QueueGarbageCollectionInt * @param \Drupal\Core\Database\Connection $connection * The Connection object containing the key-value tables. */ - function __construct($name, Connection $connection) { + public function __construct($name, Connection $connection) { $this->name = $name; $this->connection = $connection; } diff --git a/core/lib/Drupal/Core/Queue/QueueDatabaseFactory.php b/core/lib/Drupal/Core/Queue/QueueDatabaseFactory.php index e2bec48682bc1dc53ba96862dbfa87fa0281d571..a64678952e4fa51a5de467ba2da81f9e9e18bb1e 100644 --- a/core/lib/Drupal/Core/Queue/QueueDatabaseFactory.php +++ b/core/lib/Drupal/Core/Queue/QueueDatabaseFactory.php @@ -22,7 +22,7 @@ class QueueDatabaseFactory { * @param \Drupal\Core\Database\Connection $connection * The Connection object containing the key-value tables. */ - function __construct(Connection $connection) { + public function __construct(Connection $connection) { $this->connection = $connection; } diff --git a/core/lib/Drupal/Core/Queue/QueueFactory.php b/core/lib/Drupal/Core/Queue/QueueFactory.php index 74126ef9041e176c2cd9b5f790e9eae82261e645..6df7c5e6026a79d5e55cae815ff0195c4b172f6b 100644 --- a/core/lib/Drupal/Core/Queue/QueueFactory.php +++ b/core/lib/Drupal/Core/Queue/QueueFactory.php @@ -31,7 +31,7 @@ class QueueFactory implements ContainerAwareInterface { /** * Constructs a queue factory. */ - function __construct(Settings $settings) { + public function __construct(Settings $settings) { $this->settings = $settings; } diff --git a/core/lib/Drupal/Core/Routing/RouteProvider.php b/core/lib/Drupal/Core/Routing/RouteProvider.php index 1ba5f0d96c8ac6b3206b2ba4f3435b3f4a69370d..5d92e77e0f1908527b21c26d1da5090c13b43f51 100644 --- a/core/lib/Drupal/Core/Routing/RouteProvider.php +++ b/core/lib/Drupal/Core/Routing/RouteProvider.php @@ -397,7 +397,7 @@ public function reset() { /** * {@inheritdoc} */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { $events[RoutingEvents::FINISHED][] = ['reset']; return $events; } diff --git a/core/lib/Drupal/Core/Session/UserSession.php b/core/lib/Drupal/Core/Session/UserSession.php index f25247d213e1e35204c5124118f66a6e14c24f25..f426803cebf1eb87c411873a2c30923928f82a17 100644 --- a/core/lib/Drupal/Core/Session/UserSession.php +++ b/core/lib/Drupal/Core/Session/UserSession.php @@ -128,7 +128,7 @@ public function isAnonymous() { /** * {@inheritdoc} */ - function getPreferredLangcode($fallback_to_default = TRUE) { + public function getPreferredLangcode($fallback_to_default = TRUE) { $language_list = \Drupal::languageManager()->getLanguages(); if (!empty($this->preferred_langcode) && isset($language_list[$this->preferred_langcode])) { return $language_list[$this->preferred_langcode]->getId(); @@ -141,7 +141,7 @@ function getPreferredLangcode($fallback_to_default = TRUE) { /** * {@inheritdoc} */ - function getPreferredAdminLangcode($fallback_to_default = TRUE) { + public function getPreferredAdminLangcode($fallback_to_default = TRUE) { $language_list = \Drupal::languageManager()->getLanguages(); if (!empty($this->preferred_admin_langcode) && isset($language_list[$this->preferred_admin_langcode])) { return $language_list[$this->preferred_admin_langcode]->getId(); diff --git a/core/lib/Drupal/Core/StreamWrapper/LocalStream.php b/core/lib/Drupal/Core/StreamWrapper/LocalStream.php index a6c8d2e48d6bb39481db6561e3cea8361a94394c..ec1980ebd37579483a50cb5ff022e91a7e59af17 100644 --- a/core/lib/Drupal/Core/StreamWrapper/LocalStream.php +++ b/core/lib/Drupal/Core/StreamWrapper/LocalStream.php @@ -52,19 +52,19 @@ public static function getType() { * @return string * String specifying the path. */ - abstract function getDirectoryPath(); + abstract public function getDirectoryPath(); /** * {@inheritdoc} */ - function setUri($uri) { + public function setUri($uri) { $this->uri = $uri; } /** * {@inheritdoc} */ - function getUri() { + public function getUri() { return $this->uri; } @@ -98,7 +98,7 @@ protected function getTarget($uri = NULL) { /** * {@inheritdoc} */ - function realpath() { + public function realpath() { return $this->getLocalPath(); } diff --git a/core/lib/Drupal/Core/StreamWrapper/ReadOnlyStream.php b/core/lib/Drupal/Core/StreamWrapper/ReadOnlyStream.php index e5538cc42f2564bc9955c3a6e3da09c7f3e12ebc..2bf03f6cd87e913a6ac66bf4fde58ff8ef3e9ba8 100644 --- a/core/lib/Drupal/Core/StreamWrapper/ReadOnlyStream.php +++ b/core/lib/Drupal/Core/StreamWrapper/ReadOnlyStream.php @@ -39,14 +39,14 @@ abstract class ReadOnlyStream implements StreamWrapperInterface { /** * {@inheritdoc} */ - function setUri($uri) { + public function setUri($uri) { $this->uri = $uri; } /** * {@inheritdoc} */ - function getUri() { + public function getUri() { return $this->uri; } diff --git a/core/lib/Drupal/Core/Template/AttributeValueBase.php b/core/lib/Drupal/Core/Template/AttributeValueBase.php index a0280e61064cd142f1c01f592f60d28eb2ece6a6..0990eb3fdde600a6f686b2b6b7b234826bdf31a2 100644 --- a/core/lib/Drupal/Core/Template/AttributeValueBase.php +++ b/core/lib/Drupal/Core/Template/AttributeValueBase.php @@ -65,6 +65,6 @@ public function value() { /** * Implements the magic __toString() method. */ - abstract function __toString(); + abstract public function __toString(); } diff --git a/core/lib/Drupal/Core/Updater/Theme.php b/core/lib/Drupal/Core/Updater/Theme.php index d16af5738180d28ff1bd156ecf20ee9200a1d5f5..7ac70f098fd1813583037dc9c4aaddb85fab8840 100644 --- a/core/lib/Drupal/Core/Updater/Theme.php +++ b/core/lib/Drupal/Core/Updater/Theme.php @@ -56,7 +56,7 @@ public function isInstalled() { /** * {@inheritdoc} */ - static function canUpdateDirectory($directory) { + public static function canUpdateDirectory($directory) { $info = static::getExtensionInfo($directory); return (isset($info['type']) && $info['type'] == 'theme'); diff --git a/core/lib/Drupal/Core/Utility/ProjectInfo.php b/core/lib/Drupal/Core/Utility/ProjectInfo.php index 4a4d0c0a65719ca260cc0466c29cdb58133ea442..395a23bfade8711fd3aedf825fd464027e38969f 100644 --- a/core/lib/Drupal/Core/Utility/ProjectInfo.php +++ b/core/lib/Drupal/Core/Utility/ProjectInfo.php @@ -39,7 +39,7 @@ class ProjectInfo { * (optional) Array of additional elements to be collected from the .info.yml * file. Defaults to array(). */ - function processInfoList(array &$projects, array $list, $project_type, $status, array $additional_whitelist = []) { + public function processInfoList(array &$projects, array $list, $project_type, $status, array $additional_whitelist = []) { foreach ($list as $file) { // Just projects with a matching status should be listed. if ($file->status != $status) { @@ -148,7 +148,7 @@ function processInfoList(array &$projects, array $list, $project_type, $status, * @return string * The canonical project short name. */ - function getProjectName(Extension $file) { + public function getProjectName(Extension $file) { $project_name = ''; if (isset($file->info['project'])) { $project_name = $file->info['project']; @@ -174,7 +174,7 @@ function getProjectName(Extension $file) { * * @see \Drupal\Core\Utility\ProjectInfo::processInfoList() */ - function filterProjectInfo($info, $additional_whitelist = []) { + public function filterProjectInfo($info, $additional_whitelist = []) { $whitelist = [ '_info_file_ctime', 'datestamp', diff --git a/core/lib/Drupal/Core/Utility/ThemeRegistry.php b/core/lib/Drupal/Core/Utility/ThemeRegistry.php index 99b970ca9d08d3b62d357aef94f11742bb65bdcf..bc2ce5a2211d9ff24cfbda4eda720ad8bd66cd8d 100644 --- a/core/lib/Drupal/Core/Utility/ThemeRegistry.php +++ b/core/lib/Drupal/Core/Utility/ThemeRegistry.php @@ -46,7 +46,7 @@ class ThemeRegistry extends CacheCollector implements DestructableInterface { * @param bool $modules_loaded * Whether all modules have already been loaded. */ - function __construct($cid, CacheBackendInterface $cache, LockBackendInterface $lock, $tags = [], $modules_loaded = FALSE) { + public function __construct($cid, CacheBackendInterface $cache, LockBackendInterface $lock, $tags = [], $modules_loaded = FALSE) { $this->cid = $cid; $this->cache = $cache; $this->lock = $lock; @@ -81,7 +81,7 @@ function __construct($cid, CacheBackendInterface $cache, LockBackendInterface $l * An array with the keys of the full theme registry, but the values * initialized to NULL. */ - function initializeRegistry() { + public function initializeRegistry() { // @todo DIC this. $this->completeRegistry = \Drupal::service('theme.registry')->get(); diff --git a/core/modules/action/tests/src/Functional/ConfigurationTest.php b/core/modules/action/tests/src/Functional/ConfigurationTest.php index 063e4a89ebcba2da78d38f427efcad91c8cae121..472ba17125ce7aba1f5ce22bae4eed5cab27823d 100644 --- a/core/modules/action/tests/src/Functional/ConfigurationTest.php +++ b/core/modules/action/tests/src/Functional/ConfigurationTest.php @@ -24,7 +24,7 @@ class ConfigurationTest extends BrowserTestBase { /** * Tests configuration of advanced actions through administration interface. */ - function testActionConfiguration() { + public function testActionConfiguration() { // Create a user with permission to view the actions administration pages. $user = $this->drupalCreateUser(['administer actions']); $this->drupalLogin($user); diff --git a/core/modules/aggregator/src/Tests/AggregatorAdminTest.php b/core/modules/aggregator/src/Tests/AggregatorAdminTest.php index 3d09bbcac0ad67b653a83906e439697bf2888571..01898b6cf09dca27b44be1b849e28e7d1719d251 100644 --- a/core/modules/aggregator/src/Tests/AggregatorAdminTest.php +++ b/core/modules/aggregator/src/Tests/AggregatorAdminTest.php @@ -59,7 +59,7 @@ public function testSettingsPage() { /** * Tests the overview page. */ - function testOverviewPage() { + public function testOverviewPage() { $feed = $this->createFeed($this->getRSS091Sample()); $this->drupalGet('admin/config/services/aggregator'); diff --git a/core/modules/ban/tests/src/Functional/IpAddressBlockingTest.php b/core/modules/ban/tests/src/Functional/IpAddressBlockingTest.php index 0a155fb471b9644c286dd5877dff12b848b33ae3..778f3dba97514a3fdb02924295e9bba291a07676 100644 --- a/core/modules/ban/tests/src/Functional/IpAddressBlockingTest.php +++ b/core/modules/ban/tests/src/Functional/IpAddressBlockingTest.php @@ -23,7 +23,7 @@ class IpAddressBlockingTest extends BrowserTestBase { /** * Tests various user input to confirm correct validation and saving of data. */ - function testIPAddressValidation() { + public function testIPAddressValidation() { // Create user. $admin_user = $this->drupalCreateUser(['ban IP addresses']); $this->drupalLogin($admin_user); diff --git a/core/modules/basic_auth/src/Tests/Authentication/BasicAuthTest.php b/core/modules/basic_auth/src/Tests/Authentication/BasicAuthTest.php index 45b9b356eb50214a866dcdbe5fa5680c274a6b38..3650e4fb6213a7f946c582b4c690851b3ad5400c 100644 --- a/core/modules/basic_auth/src/Tests/Authentication/BasicAuthTest.php +++ b/core/modules/basic_auth/src/Tests/Authentication/BasicAuthTest.php @@ -75,7 +75,7 @@ public function testBasicAuth() { /** * Test the global login flood control. */ - function testGlobalLoginFloodControl() { + public function testGlobalLoginFloodControl() { $this->config('user.flood') ->set('ip_limit', 2) // Set a high per-user limit out so that it is not relevant in the test. @@ -100,7 +100,7 @@ function testGlobalLoginFloodControl() { /** * Test the per-user login flood control. */ - function testPerUserLoginFloodControl() { + public function testPerUserLoginFloodControl() { $this->config('user.flood') // Set a high global limit out so that it is not relevant in the test. ->set('ip_limit', 4000) @@ -138,7 +138,7 @@ function testPerUserLoginFloodControl() { /** * Tests compatibility with locale/UI translation. */ - function testLocale() { + public function testLocale() { ConfigurableLanguage::createFromLangcode('de')->save(); $this->config('system.site')->set('default_langcode', 'de')->save(); @@ -154,7 +154,7 @@ function testLocale() { /** * Tests if a comprehensive message is displayed when the route is denied. */ - function testUnauthorizedErrorMessage() { + public function testUnauthorizedErrorMessage() { $account = $this->drupalCreateUser(); $url = Url::fromRoute('router_test.11'); diff --git a/core/modules/big_pipe/src/EventSubscriber/NoBigPipeRouteAlterSubscriber.php b/core/modules/big_pipe/src/EventSubscriber/NoBigPipeRouteAlterSubscriber.php index 516aeb4e0b474a2aa4a378b008c1f1a7dd894899..8b3c9c23a7c8cd2cd15815c3c115d99fb2d6cf45 100644 --- a/core/modules/big_pipe/src/EventSubscriber/NoBigPipeRouteAlterSubscriber.php +++ b/core/modules/big_pipe/src/EventSubscriber/NoBigPipeRouteAlterSubscriber.php @@ -40,7 +40,7 @@ public function onRoutingRouteAlterSetNoBigPipe(RouteBuildEvent $event) { /** * {@inheritdoc} */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { $events[RoutingEvents::ALTER][] = ['onRoutingRouteAlterSetNoBigPipe']; return $events; } diff --git a/core/modules/big_pipe/tests/src/Unit/Render/BigPipeResponseAttachmentsProcessorTest.php b/core/modules/big_pipe/tests/src/Unit/Render/BigPipeResponseAttachmentsProcessorTest.php index f7d137dff8f23ce3999c936ac6ea9bbddeb9dcde..b45c916ceea0de5023686d00284fc5b6819b9cc0 100644 --- a/core/modules/big_pipe/tests/src/Unit/Render/BigPipeResponseAttachmentsProcessorTest.php +++ b/core/modules/big_pipe/tests/src/Unit/Render/BigPipeResponseAttachmentsProcessorTest.php @@ -38,7 +38,7 @@ public function testNonHtmlResponse($response_class) { $big_pipe_response_attachments_processor->processAttachments($non_html_response); } - function nonHtmlResponseProvider() { + public function nonHtmlResponseProvider() { return [ 'AjaxResponse, which implements AttachmentsInterface' => [AjaxResponse::class], 'A dummy that implements AttachmentsInterface' => [get_class($this->prophesize(AttachmentsInterface::class)->reveal())], diff --git a/core/modules/block/src/EventSubscriber/BlockPageDisplayVariantSubscriber.php b/core/modules/block/src/EventSubscriber/BlockPageDisplayVariantSubscriber.php index 5faf8b870ac94f7382b27348457d9ad8daa2887e..89f361f44048a9c326cd6752dbf1cd67735bed9c 100644 --- a/core/modules/block/src/EventSubscriber/BlockPageDisplayVariantSubscriber.php +++ b/core/modules/block/src/EventSubscriber/BlockPageDisplayVariantSubscriber.php @@ -26,7 +26,7 @@ public function onSelectPageDisplayVariant(PageDisplayVariantSelectionEvent $eve /** * {@inheritdoc} */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { $events[RenderEvents::SELECT_PAGE_DISPLAY_VARIANT][] = ['onSelectPageDisplayVariant']; return $events; } diff --git a/core/modules/block/src/Tests/BlockAdminThemeTest.php b/core/modules/block/src/Tests/BlockAdminThemeTest.php index 7736e05362d52cc7f9120bd5be018afca15bbe1f..8773f0362043d50020a42ef9e952f3217476cff4 100644 --- a/core/modules/block/src/Tests/BlockAdminThemeTest.php +++ b/core/modules/block/src/Tests/BlockAdminThemeTest.php @@ -21,7 +21,7 @@ class BlockAdminThemeTest extends WebTestBase { /** * Check for the accessibility of the admin theme on the block admin page. */ - function testAdminTheme() { + public function testAdminTheme() { // Create administrative user. $admin_user = $this->drupalCreateUser(['administer blocks', 'administer themes']); $this->drupalLogin($admin_user); @@ -42,7 +42,7 @@ function testAdminTheme() { /** * Ensure contextual links are disabled in Seven theme. */ - function testSevenAdminTheme() { + public function testSevenAdminTheme() { // Create administrative user. $admin_user = $this->drupalCreateUser([ 'access administration pages', diff --git a/core/modules/block/src/Tests/BlockFormInBlockTest.php b/core/modules/block/src/Tests/BlockFormInBlockTest.php index 59b5f5ff5de892e9d5142be7721f0d4516bf9a57..ebe43c8cef01dfe5fd119b1121c2ceaf1acabebe 100644 --- a/core/modules/block/src/Tests/BlockFormInBlockTest.php +++ b/core/modules/block/src/Tests/BlockFormInBlockTest.php @@ -33,7 +33,7 @@ protected function setUp() { /** * Test to see if form in block's redirect isn't cached. */ - function testCachePerPage() { + public function testCachePerPage() { $form_values = ['email' => 'test@example.com']; // Go to "test-page" and test if the block is enabled. diff --git a/core/modules/block/src/Tests/BlockRenderOrderTest.php b/core/modules/block/src/Tests/BlockRenderOrderTest.php index d74a90afc474267fa12aec3fc8122876a4bb10ef..a7e26ded4e39558a467afcb3515870d24a7b5adf 100644 --- a/core/modules/block/src/Tests/BlockRenderOrderTest.php +++ b/core/modules/block/src/Tests/BlockRenderOrderTest.php @@ -31,7 +31,7 @@ protected function setUp() { /** * Tests the render order of the blocks. */ - function testBlockRenderOrder() { + public function testBlockRenderOrder() { // Enable test blocks and place them in the same region. $region = 'header'; $test_blocks = [ diff --git a/core/modules/block/src/Tests/BlockTest.php b/core/modules/block/src/Tests/BlockTest.php index e6066c4fd270c0fe89accbc80be3bb72c66316f3..5910d4789a8b5fae074aec1fecf42495d279923f 100644 --- a/core/modules/block/src/Tests/BlockTest.php +++ b/core/modules/block/src/Tests/BlockTest.php @@ -18,7 +18,7 @@ class BlockTest extends BlockTestBase { /** * Tests block visibility. */ - function testBlockVisibility() { + public function testBlockVisibility() { $block_name = 'system_powered_by_block'; // Create a random title for the block. $title = $this->randomMachineName(8); @@ -99,7 +99,7 @@ public function testBlockToggleVisibility() { /** * Test block visibility when leaving "pages" textarea empty. */ - function testBlockVisibilityListedEmpty() { + public function testBlockVisibilityListedEmpty() { $block_name = 'system_powered_by_block'; // Create a random title for the block. $title = $this->randomMachineName(8); @@ -176,7 +176,7 @@ public function testAddBlockFromLibraryWithWeight() { /** * Test configuring and moving a module-define block to specific regions. */ - function testBlock() { + public function testBlock() { // Place page title block to test error messages. $this->drupalPlaceBlock('page_title_block'); @@ -268,7 +268,7 @@ public function testBlockThemeSelector() { /** * Test block display of theme titles. */ - function testThemeName() { + public function testThemeName() { // Enable the help block. $this->drupalPlaceBlock('help_block', ['region' => 'help']); $this->drupalPlaceBlock('local_tasks_block'); @@ -285,7 +285,7 @@ function testThemeName() { /** * Test block title display settings. */ - function testHideBlockTitle() { + public function testHideBlockTitle() { $block_name = 'system_powered_by_block'; // Create a random title for the block. $title = $this->randomMachineName(8); @@ -328,7 +328,7 @@ function testHideBlockTitle() { * The machine name of the theme region to move the block to, for example * 'header' or 'sidebar_first'. */ - function moveBlockToRegion(array $block, $region) { + public function moveBlockToRegion(array $block, $region) { // Set the created block to a specific region. $block += ['theme' => $this->config('system.theme')->get('default')]; $edit = []; diff --git a/core/modules/block/src/Tests/BlockUiTest.php b/core/modules/block/src/Tests/BlockUiTest.php index 5f18ae162b230b63285c9a25b9bbdd797399e5d3..899f9bba87617162b7baaf0f9a9fd49291e2660e 100644 --- a/core/modules/block/src/Tests/BlockUiTest.php +++ b/core/modules/block/src/Tests/BlockUiTest.php @@ -94,7 +94,7 @@ public function testBlockDemoUiPage() { /** * Test block admin page exists and functions correctly. */ - function testBlockAdminUiPage() { + public function testBlockAdminUiPage() { // Visit the blocks admin ui. $this->drupalGet('admin/structure/block'); // Look for the blocks table. diff --git a/core/modules/block/src/Tests/NonDefaultBlockAdminTest.php b/core/modules/block/src/Tests/NonDefaultBlockAdminTest.php index 9f3590c7fa53601562803757f9271dae3a370a83..fc2f33c0dad04f1260d246e3ba6bb3da00d39d08 100644 --- a/core/modules/block/src/Tests/NonDefaultBlockAdminTest.php +++ b/core/modules/block/src/Tests/NonDefaultBlockAdminTest.php @@ -30,7 +30,7 @@ protected function setUp() { /** * Test non-default theme admin. */ - function testNonDefaultBlockAdmin() { + public function testNonDefaultBlockAdmin() { $admin_user = $this->drupalCreateUser(['administer blocks', 'administer themes']); $this->drupalLogin($admin_user); $new_theme = 'bartik'; diff --git a/core/modules/block/tests/src/Functional/BlockCacheTest.php b/core/modules/block/tests/src/Functional/BlockCacheTest.php index 4ea433f76a85f590fd9af0692b09a7ee09b1b552..e5bb360e3e66060f88a7ea2f37d8b33945b74f03 100644 --- a/core/modules/block/tests/src/Functional/BlockCacheTest.php +++ b/core/modules/block/tests/src/Functional/BlockCacheTest.php @@ -69,7 +69,7 @@ protected function setUp() { /** * Test "user.roles" cache context. */ - function testCachePerRole() { + public function testCachePerRole() { \Drupal::state()->set('block_test.cache_contexts', ['user.roles']); // Enable our test block. Set some content for it to display. @@ -116,7 +116,7 @@ function testCachePerRole() { /** * Test a cacheable block without any additional cache context. */ - function testCachePermissions() { + public function testCachePermissions() { // user.permissions is a required context, so a user with different // permissions will see a different version of the block. \Drupal::state()->set('block_test.cache_contexts', []); @@ -142,7 +142,7 @@ function testCachePermissions() { /** * Test non-cacheable block. */ - function testNoCache() { + public function testNoCache() { \Drupal::state()->set('block_test.cache_max_age', 0); $current_content = $this->randomMachineName(); @@ -162,7 +162,7 @@ function testNoCache() { /** * Test "user" cache context. */ - function testCachePerUser() { + public function testCachePerUser() { \Drupal::state()->set('block_test.cache_contexts', ['user']); $current_content = $this->randomMachineName(); @@ -191,7 +191,7 @@ function testCachePerUser() { /** * Test "url" cache context. */ - function testCachePerPage() { + public function testCachePerPage() { \Drupal::state()->set('block_test.cache_contexts', ['url']); $current_content = $this->randomMachineName(); diff --git a/core/modules/block/tests/src/Functional/BlockHtmlTest.php b/core/modules/block/tests/src/Functional/BlockHtmlTest.php index 943699079630cda06a0e811e680d74857972879e..5f9afe916f7d15bfcc27700f3d041e2f39664205 100644 --- a/core/modules/block/tests/src/Functional/BlockHtmlTest.php +++ b/core/modules/block/tests/src/Functional/BlockHtmlTest.php @@ -35,7 +35,7 @@ protected function setUp() { /** * Tests for valid HTML for a block. */ - function testHtml() { + public function testHtml() { $this->drupalGet(''); // Ensure that a block's ID is converted to an HTML valid ID, and that diff --git a/core/modules/block/tests/src/Functional/BlockInvalidRegionTest.php b/core/modules/block/tests/src/Functional/BlockInvalidRegionTest.php index 9b18633d67527f9be2a6f782585a81a6befb70ff..fe8cdcb56a7884ab8911a4c7d9dc6f797c7f4db5 100644 --- a/core/modules/block/tests/src/Functional/BlockInvalidRegionTest.php +++ b/core/modules/block/tests/src/Functional/BlockInvalidRegionTest.php @@ -34,7 +34,7 @@ protected function setUp() { /** * Tests that blocks assigned to invalid regions work correctly. */ - function testBlockInInvalidRegion() { + public function testBlockInInvalidRegion() { // Enable a test block and place it in an invalid region. $block = $this->drupalPlaceBlock('test_html'); \Drupal::configFactory()->getEditable('block.block.' . $block->id())->set('region', 'invalid_region')->save(); diff --git a/core/modules/block/tests/src/Functional/BlockTemplateSuggestionsTest.php b/core/modules/block/tests/src/Functional/BlockTemplateSuggestionsTest.php index 61a37454200ec35cec5eaa7eb7d00e03879944f1..fd4fd5138cda84879a508a1037cb528e81e4ffe0 100644 --- a/core/modules/block/tests/src/Functional/BlockTemplateSuggestionsTest.php +++ b/core/modules/block/tests/src/Functional/BlockTemplateSuggestionsTest.php @@ -22,7 +22,7 @@ class BlockTemplateSuggestionsTest extends BrowserTestBase { /** * Tests template suggestions from block_theme_suggestions_block(). */ - function testBlockThemeHookSuggestions() { + public function testBlockThemeHookSuggestions() { // Define a block with a derivative to be preprocessed, which includes both // an underscore (not transformed) and a hyphen (transformed to underscore), // and generates possibilities for each level of derivative. diff --git a/core/modules/block/tests/src/Functional/NewDefaultThemeBlocksTest.php b/core/modules/block/tests/src/Functional/NewDefaultThemeBlocksTest.php index 767a7da590051ee815a2a08aa0fbe6b3086b2652..adc7da3f1fd355847d04a0e67fdb89d2ebb00125 100644 --- a/core/modules/block/tests/src/Functional/NewDefaultThemeBlocksTest.php +++ b/core/modules/block/tests/src/Functional/NewDefaultThemeBlocksTest.php @@ -21,7 +21,7 @@ class NewDefaultThemeBlocksTest extends BrowserTestBase { /** * Check the enabled Bartik blocks are correctly copied over. */ - function testNewDefaultThemeBlocks() { + public function testNewDefaultThemeBlocks() { $default_theme = $this->config('system.theme')->get('default'); // Add two instances of the user login block. diff --git a/core/modules/block_content/src/Tests/Views/BlockContentFieldFilterTest.php b/core/modules/block_content/src/Tests/Views/BlockContentFieldFilterTest.php index 905a7a0053ef5fc4805b3adbca4d3429b3c3feef..1ff4fb55baf74daf117f430b31df552611d28c82 100644 --- a/core/modules/block_content/src/Tests/Views/BlockContentFieldFilterTest.php +++ b/core/modules/block_content/src/Tests/Views/BlockContentFieldFilterTest.php @@ -35,7 +35,7 @@ class BlockContentFieldFilterTest extends BlockContentTestBase { /** * {@inheritdoc} */ - function setUp() { + public function setUp() { parent::setUp(); // Add two new languages. diff --git a/core/modules/book/src/Plugin/Block/BookNavigationBlock.php b/core/modules/book/src/Plugin/Block/BookNavigationBlock.php index 7b0156f2405efff68ba98df8954827b8d2c86cc0..e55fe365256f038c29652948025cfa6fbb1c4197 100644 --- a/core/modules/book/src/Plugin/Block/BookNavigationBlock.php +++ b/core/modules/book/src/Plugin/Block/BookNavigationBlock.php @@ -94,7 +94,7 @@ public function defaultConfiguration() { /** * {@inheritdoc} */ - function blockForm($form, FormStateInterface $form_state) { + public function blockForm($form, FormStateInterface $form_state) { $options = [ 'all pages' => $this->t('Show block on all pages'), 'book pages' => $this->t('Show block only on book pages'), diff --git a/core/modules/book/src/Tests/BookTest.php b/core/modules/book/src/Tests/BookTest.php index 183674fa4aa6f12eada41dc50fa0882335899658..05cc2fa7bce15239d3ea9adf49f2e6d9cf586be1 100644 --- a/core/modules/book/src/Tests/BookTest.php +++ b/core/modules/book/src/Tests/BookTest.php @@ -80,7 +80,7 @@ protected function setUp() { * * @return \Drupal\node\NodeInterface[] */ - function createBook() { + public function createBook() { // Create new book. $this->drupalLogin($this->bookAuthor); @@ -151,7 +151,7 @@ public function testBookNavigationCacheContext() { /** * Tests saving the book outline on an empty book. */ - function testEmptyBook() { + public function testEmptyBook() { // Create a new empty book. $this->drupalLogin($this->bookAuthor); $book = $this->createBookNode('new'); @@ -166,7 +166,7 @@ function testEmptyBook() { /** * Tests book functionality through node interfaces. */ - function testBook() { + public function testBook() { // Create new book. $nodes = $this->createBook(); $book = $this->book; @@ -247,7 +247,7 @@ function testBook() { * @param array $breadcrumb * The nodes that should be displayed in the breadcrumb. */ - function checkBookNode(EntityInterface $node, $nodes, $previous = FALSE, $up = FALSE, $next = FALSE, array $breadcrumb) { + public function checkBookNode(EntityInterface $node, $nodes, $previous = FALSE, $up = FALSE, $next = FALSE, array $breadcrumb) { // $number does not use drupal_static as it should not be reset // since it uniquely identifies each call to checkBookNode(). static $number = 0; @@ -319,7 +319,7 @@ function checkBookNode(EntityInterface $node, $nodes, $previous = FALSE, $up = F * @return string * A regular expression that locates sub-nodes of the outline. */ - function generateOutlinePattern($nodes) { + public function generateOutlinePattern($nodes) { $outline = ''; foreach ($nodes as $node) { $outline .= '(node\/' . $node->id() . ')(.*?)(' . $node->label() . ')(.*?)'; @@ -339,7 +339,7 @@ function generateOutlinePattern($nodes) { * @return \Drupal\node\NodeInterface * The created node. */ - function createBookNode($book_nid, $parent = NULL) { + public function createBookNode($book_nid, $parent = NULL) { // $number does not use drupal_static as it should not be reset // since it uniquely identifies each call to createBookNode(). static $number = 0; // Used to ensure that when sorted nodes stay in same order. @@ -373,7 +373,7 @@ function createBookNode($book_nid, $parent = NULL) { /** * Tests book export ("printer-friendly version") functionality. */ - function testBookExport() { + public function testBookExport() { // Create a book. $nodes = $this->createBook(); @@ -418,7 +418,7 @@ function testBookExport() { /** * Tests the functionality of the book navigation block. */ - function testBookNavigationBlock() { + public function testBookNavigationBlock() { $this->drupalLogin($this->adminUser); // Enable the block. @@ -495,7 +495,7 @@ public function testGetTableOfContents() { /** * Tests the book navigation block when an access module is installed. */ - function testNavigationBlockOnAccessModuleInstalled() { + public function testNavigationBlockOnAccessModuleInstalled() { $this->drupalLogin($this->adminUser); $block = $this->drupalPlaceBlock('book_navigation', ['block_mode' => 'book pages']); @@ -526,7 +526,7 @@ function testNavigationBlockOnAccessModuleInstalled() { /** * Tests the access for deleting top-level book nodes. */ - function testBookDelete() { + public function testBookDelete() { $node_storage = $this->container->get('entity.manager')->getStorage('node'); $nodes = $this->createBook(); $this->drupalLogin($this->adminUser); diff --git a/core/modules/ckeditor/src/CKEditorPluginBase.php b/core/modules/ckeditor/src/CKEditorPluginBase.php index 99f26630f23ccf1a1632fddf6b28e858f8f5ddab..af284fc71bfc7def0b70f07568aa7a5ad51b6924 100644 --- a/core/modules/ckeditor/src/CKEditorPluginBase.php +++ b/core/modules/ckeditor/src/CKEditorPluginBase.php @@ -33,21 +33,21 @@ abstract class CKEditorPluginBase extends PluginBase implements CKEditorPluginIn /** * {@inheritdoc} */ - function isInternal() { + public function isInternal() { return FALSE; } /** * {@inheritdoc} */ - function getDependencies(Editor $editor) { + public function getDependencies(Editor $editor) { return []; } /** * {@inheritdoc} */ - function getLibraries(Editor $editor) { + public function getLibraries(Editor $editor) { return []; } diff --git a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/DrupalImage.php b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/DrupalImage.php index 90d4eae8f4792612653b261e436fe71d02d7f921..587cf85e7811fd98513361f0df515dfcc50a8f03 100644 --- a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/DrupalImage.php +++ b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/DrupalImage.php @@ -79,7 +79,7 @@ public function settingsForm(array $form, FormStateInterface $form_state, Editor * @see \Drupal\editor\Form\EditorImageDialog * @see editor_image_upload_settings_form() */ - function validateImageUploadSettings(array $element, FormStateInterface $form_state) { + public function validateImageUploadSettings(array $element, FormStateInterface $form_state) { $settings = &$form_state->getValue(['editor', 'settings', 'plugins', 'drupalimage', 'image_upload']); $form_state->get('editor')->setImageUploadSettings($settings); $form_state->unsetValue(['editor', 'settings', 'plugins', 'drupalimage']); diff --git a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/DrupalImageCaption.php b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/DrupalImageCaption.php index 4241c3ca027833e8555acd1dbc564b0c2ac8bd8b..64e764ebf565652e521e7a3728881e1e03864364 100644 --- a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/DrupalImageCaption.php +++ b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/DrupalImageCaption.php @@ -77,7 +77,7 @@ public function getCssFiles(Editor $editor) { /** * {@inheritdoc} */ - function isEnabled(Editor $editor) { + public function isEnabled(Editor $editor) { if (!$editor->hasAssociatedFilterFormat()) { return FALSE; } diff --git a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Language.php b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Language.php index 31ce08fc07aab845915825d43d787be5876f8eb3..ffae4096cf28a2410f8def7bd27d5735d6e97cd7 100644 --- a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Language.php +++ b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Language.php @@ -126,7 +126,7 @@ public function settingsForm(array $form, FormStateInterface $form_state, Editor /** * {@inheritdoc} */ - function getCssFiles(Editor $editor) { + public function getCssFiles(Editor $editor) { return [ drupal_get_path('module', 'ckeditor') . '/css/plugins/language/ckeditor.language.css' ]; diff --git a/core/modules/ckeditor/src/Tests/CKEditorAdminTest.php b/core/modules/ckeditor/src/Tests/CKEditorAdminTest.php index 3541f0ff486b2d45bab1970541f5e5eeb58f1920..669dc5f85104e54399d12ef0066ddfb9edf22139 100644 --- a/core/modules/ckeditor/src/Tests/CKEditorAdminTest.php +++ b/core/modules/ckeditor/src/Tests/CKEditorAdminTest.php @@ -48,7 +48,7 @@ protected function setUp() { /** * Tests configuring a text editor for an existing text format. */ - function testExistingFormat() { + public function testExistingFormat() { $ckeditor = $this->container->get('plugin.manager.editor')->createInstance('ckeditor'); $this->drupalLogin($this->adminUser); @@ -222,7 +222,7 @@ function testExistingFormat() { * This test only needs to ensure that the basics of the CKEditor * configuration form work; details are tested in testExistingFormat(). */ - function testNewFormat() { + public function testNewFormat() { $this->drupalLogin($this->adminUser); $this->drupalGet('admin/config/content/formats/add'); diff --git a/core/modules/ckeditor/src/Tests/CKEditorLoadingTest.php b/core/modules/ckeditor/src/Tests/CKEditorLoadingTest.php index 2f5052bd2779d63e9a5eb39ba8e07e7e6ef6341e..438aeba289326f5b73a19e4ff6a767aa95eeb923 100644 --- a/core/modules/ckeditor/src/Tests/CKEditorLoadingTest.php +++ b/core/modules/ckeditor/src/Tests/CKEditorLoadingTest.php @@ -74,7 +74,7 @@ protected function setUp() { /** * Tests loading of CKEditor CSS, JS and JS settings. */ - function testLoading() { + public function testLoading() { // The untrusted user: // - has access to 1 text format (plain_text); // - doesn't have access to the filtered_html text format, so: no text editor. @@ -197,7 +197,7 @@ public function testLoadingWithoutInternalButtons() { /** * Tests loading of theme's CKEditor stylesheets defined in the .info file. */ - function testExternalStylesheets() { + public function testExternalStylesheets() { $theme_handler = \Drupal::service('theme_handler'); // Case 1: Install theme which has an absolute external CSS URL. $theme_handler->install(['test_ckeditor_stylesheets_external']); diff --git a/core/modules/ckeditor/src/Tests/CKEditorStylesComboAdminTest.php b/core/modules/ckeditor/src/Tests/CKEditorStylesComboAdminTest.php index d70980ef410f7d15f64ef94a3664951a0e35ff8d..1a2f7679b84725d41d017658168a95ffc33f70ba 100644 --- a/core/modules/ckeditor/src/Tests/CKEditorStylesComboAdminTest.php +++ b/core/modules/ckeditor/src/Tests/CKEditorStylesComboAdminTest.php @@ -59,7 +59,7 @@ protected function setUp() { /** * Tests StylesCombo settings for an existing text format. */ - function testExistingFormat() { + public function testExistingFormat() { $ckeditor = $this->container->get('plugin.manager.editor')->createInstance('ckeditor'); $default_settings = $ckeditor->getDefaultSettings(); diff --git a/core/modules/ckeditor/tests/modules/src/Kernel/CKEditorPluginManagerTest.php b/core/modules/ckeditor/tests/modules/src/Kernel/CKEditorPluginManagerTest.php index fc79273487e091ce7223448e9cf24bbd9d76cce3..eb02d37adad14ad526b429c3e2abf568c2445fee 100644 --- a/core/modules/ckeditor/tests/modules/src/Kernel/CKEditorPluginManagerTest.php +++ b/core/modules/ckeditor/tests/modules/src/Kernel/CKEditorPluginManagerTest.php @@ -50,7 +50,7 @@ protected function setUp() { /** * Tests the enabling of plugins. */ - function testEnabledPlugins() { + public function testEnabledPlugins() { $this->manager = $this->container->get('plugin.manager.ckeditor.plugin'); $editor = Editor::load('filtered_html'); @@ -132,7 +132,7 @@ function testEnabledPlugins() { /** * Tests the iframe instance CSS files of plugins. */ - function testCssFiles() { + public function testCssFiles() { $this->manager = $this->container->get('plugin.manager.ckeditor.plugin'); $editor = Editor::load('filtered_html'); diff --git a/core/modules/ckeditor/tests/modules/src/Kernel/CKEditorTest.php b/core/modules/ckeditor/tests/modules/src/Kernel/CKEditorTest.php index 4bfda7e46b5a57805bd78bae0cc06ef0baf85301..4fbead9a3565cdfc96b3a5c2301d9c0b1acce8eb 100644 --- a/core/modules/ckeditor/tests/modules/src/Kernel/CKEditorTest.php +++ b/core/modules/ckeditor/tests/modules/src/Kernel/CKEditorTest.php @@ -68,7 +68,7 @@ protected function setUp() { /** * Tests CKEditor::getJSSettings(). */ - function testGetJSSettings() { + public function testGetJSSettings() { $editor = Editor::load('filtered_html'); // Default toolbar. @@ -216,7 +216,7 @@ function testGetJSSettings() { /** * Tests CKEditor::buildToolbarJSSetting(). */ - function testBuildToolbarJSSetting() { + public function testBuildToolbarJSSetting() { $editor = Editor::load('filtered_html'); // Default toolbar. @@ -247,7 +247,7 @@ function testBuildToolbarJSSetting() { /** * Tests CKEditor::buildContentsCssJSSetting(). */ - function testBuildContentsCssJSSetting() { + public function testBuildContentsCssJSSetting() { $editor = Editor::load('filtered_html'); // Default toolbar. @@ -284,7 +284,7 @@ function testBuildContentsCssJSSetting() { /** * Tests Internal::getConfig(). */ - function testInternalGetConfig() { + public function testInternalGetConfig() { $editor = Editor::load('filtered_html'); $internal_plugin = $this->container->get('plugin.manager.ckeditor.plugin')->createInstance('internal'); @@ -305,7 +305,7 @@ function testInternalGetConfig() { /** * Tests StylesCombo::getConfig(). */ - function testStylesComboGetConfig() { + public function testStylesComboGetConfig() { $editor = Editor::load('filtered_html'); $stylescombo_plugin = $this->container->get('plugin.manager.ckeditor.plugin')->createInstance('stylescombo'); @@ -364,7 +364,7 @@ function testStylesComboGetConfig() { /** * Tests language list availability in CKEditor. */ - function testLanguages() { + public function testLanguages() { // Get CKEditor supported language codes and spot-check. $this->enableModules(['language']); $this->installConfig(['language']); @@ -389,7 +389,7 @@ function testLanguages() { /** * Tests that CKEditor plugins participate in JS translation. */ - function testJSTranslation() { + public function testJSTranslation() { $this->enableModules(['language', 'locale']); $this->installSchema('locale', 'locales_source'); $this->installSchema('locale', 'locales_location'); diff --git a/core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/Llama.php b/core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/Llama.php index 012579de89de552970cf7e61f0645076b720560f..3b8951caec91ff98349365371580a0d90c4135bf 100644 --- a/core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/Llama.php +++ b/core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/Llama.php @@ -29,28 +29,28 @@ class Llama extends PluginBase implements CKEditorPluginInterface { /** * {@inheritdoc} */ - function getDependencies(Editor $editor) { + public function getDependencies(Editor $editor) { return []; } /** * {@inheritdoc} */ - function getLibraries(Editor $editor) { + public function getLibraries(Editor $editor) { return []; } /** * {@inheritdoc} */ - function isInternal() { + public function isInternal() { return FALSE; } /** * {@inheritdoc} */ - function getFile() { + public function getFile() { return drupal_get_path('module', 'ckeditor_test') . '/js/llama.js'; } diff --git a/core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/LlamaButton.php b/core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/LlamaButton.php index 4568192e03dd535f32d61b9b7e1b530ba8aa4a5a..b357811c06c37f1bec0f987e8f9d41b3fa322c8f 100644 --- a/core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/LlamaButton.php +++ b/core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/LlamaButton.php @@ -17,7 +17,7 @@ class LlamaButton extends Llama implements CKEditorPluginButtonsInterface { /** * {@inheritdoc} */ - function getButtons() { + public function getButtons() { return [ 'Llama' => [ 'label' => t('Insert Llama'), @@ -28,7 +28,7 @@ function getButtons() { /** * {@inheritdoc} */ - function getFile() { + public function getFile() { return drupal_get_path('module', 'ckeditor_test') . '/js/llama_button.js'; } diff --git a/core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/LlamaContextual.php b/core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/LlamaContextual.php index 01cb992625c88b4bbb43619542591653c7c1b752..5ece17acadf9e1c9d03ae5ae07376e1b1cfa588e 100644 --- a/core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/LlamaContextual.php +++ b/core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/LlamaContextual.php @@ -18,7 +18,7 @@ class LlamaContextual extends Llama implements CKEditorPluginContextualInterface /** * {@inheritdoc} */ - function isEnabled(Editor $editor) { + public function isEnabled(Editor $editor) { // Automatically enable this plugin if the Underline button is enabled. $settings = $editor->getSettings(); foreach ($settings['toolbar']['rows'] as $row) { @@ -34,7 +34,7 @@ function isEnabled(Editor $editor) { /** * {@inheritdoc} */ - function getFile() { + public function getFile() { return drupal_get_path('module', 'ckeditor_test') . '/js/llama_contextual.js'; } diff --git a/core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/LlamaContextualAndButton.php b/core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/LlamaContextualAndButton.php index 5e1955fbd302fab440c7f025189e9b8e994fe8b9..2894fc905f367c40f2de92d18d352ccb7da29873 100644 --- a/core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/LlamaContextualAndButton.php +++ b/core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/LlamaContextualAndButton.php @@ -22,7 +22,7 @@ class LlamaContextualAndButton extends Llama implements CKEditorPluginContextual /** * {@inheritdoc} */ - function isEnabled(Editor $editor) { + public function isEnabled(Editor $editor) { // Automatically enable this plugin if the Strike button is enabled. $settings = $editor->getSettings(); foreach ($settings['toolbar']['rows'] as $row) { @@ -38,7 +38,7 @@ function isEnabled(Editor $editor) { /** * {@inheritdoc} */ - function getButtons() { + public function getButtons() { return [ 'Llama' => [ 'label' => t('Insert Llama'), @@ -49,14 +49,14 @@ function getButtons() { /** * {@inheritdoc} */ - function getFile() { + public function getFile() { return drupal_get_path('module', 'ckeditor_test') . '/js/llama_contextual_and_button.js'; } /** * {@inheritdoc} */ - function settingsForm(array $form, FormStateInterface $form_state, Editor $editor) { + public function settingsForm(array $form, FormStateInterface $form_state, Editor $editor) { // Defaults. $config = ['ultra_llama_mode' => FALSE]; $settings = $editor->getSettings(); diff --git a/core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/LlamaCss.php b/core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/LlamaCss.php index d3b9a7f6235cdbf4d4ab6a6b85c01775084174bd..e0901dc84ff706a65fd535d39734ea577ab599a2 100644 --- a/core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/LlamaCss.php +++ b/core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/LlamaCss.php @@ -19,7 +19,7 @@ class LlamaCss extends Llama implements CKEditorPluginButtonsInterface, CKEditor /** * {@inheritdoc} */ - function getButtons() { + public function getButtons() { return [ 'LlamaCSS' => [ 'label' => t('Insert Llama CSS'), @@ -30,7 +30,7 @@ function getButtons() { /** * {@inheritdoc} */ - function getCssFiles(Editor $editor) { + public function getCssFiles(Editor $editor) { return [ drupal_get_path('module', 'ckeditor_test') . '/css/llama.css' ]; @@ -39,7 +39,7 @@ function getCssFiles(Editor $editor) { /** * {@inheritdoc} */ - function getFile() { + public function getFile() { return drupal_get_path('module', 'ckeditor_test') . '/js/llama_css.js'; } diff --git a/core/modules/color/tests/src/Functional/ColorConfigSchemaTest.php b/core/modules/color/tests/src/Functional/ColorConfigSchemaTest.php index e55275deb78fbc01f7c4ef64914d104d582a0a4d..f93f3587b1fe77994868507a956b45736fef6951 100644 --- a/core/modules/color/tests/src/Functional/ColorConfigSchemaTest.php +++ b/core/modules/color/tests/src/Functional/ColorConfigSchemaTest.php @@ -40,7 +40,7 @@ protected function setUp() { /** * Tests whether the color config schema is valid. */ - function testValidColorConfigSchema() { + public function testValidColorConfigSchema() { $settings_path = 'admin/appearance/settings/bartik'; $edit['scheme'] = ''; $edit['palette[bg]'] = '#123456'; diff --git a/core/modules/color/tests/src/Functional/ColorSafePreviewTest.php b/core/modules/color/tests/src/Functional/ColorSafePreviewTest.php index e80202fd79591c3f2c4c45fe2a790a17d8be6dea..9f6914c996c003c9048938d7bb85b849b08d3066 100644 --- a/core/modules/color/tests/src/Functional/ColorSafePreviewTest.php +++ b/core/modules/color/tests/src/Functional/ColorSafePreviewTest.php @@ -39,7 +39,7 @@ protected function setUp() { /** * Ensures color preview.html is sanitized. */ - function testColorPreview() { + public function testColorPreview() { // Install the color test theme. \Drupal::service('theme_handler')->install(['color_test_theme']); $this->drupalLogin($this->bigUser); diff --git a/core/modules/color/tests/src/Functional/ColorTest.php b/core/modules/color/tests/src/Functional/ColorTest.php index 8416913396deb5ec22ca8e1544f21e9d3699ed8e..11ff1e737fbb4d2be39a31d655e8f1463c2b02a2 100644 --- a/core/modules/color/tests/src/Functional/ColorTest.php +++ b/core/modules/color/tests/src/Functional/ColorTest.php @@ -84,7 +84,7 @@ protected function setUp() { /** * Tests the Color module functionality. */ - function testColor() { + public function testColor() { foreach ($this->themes as $theme => $test_values) { $this->_testColor($theme, $test_values); } @@ -99,7 +99,7 @@ function testColor() { * An associative array of test settings (i.e. 'Main background', 'Text * color', 'Color set', etc) for the theme which being tested. */ - function _testColor($theme, $test_values) { + public function _testColor($theme, $test_values) { $this->config('system.theme') ->set('default', $theme) ->save(); @@ -151,7 +151,7 @@ function _testColor($theme, $test_values) { /** * Tests whether the provided color is valid. */ - function testValidColor() { + public function testValidColor() { $this->config('system.theme') ->set('default', 'bartik') ->save(); @@ -176,7 +176,7 @@ function testValidColor() { /** * Test whether the custom logo is used in the color preview. */ - function testLogoSettingOverride() { + public function testLogoSettingOverride() { $this->drupalLogin($this->bigUser); $edit = [ 'default_logo' => FALSE, @@ -192,7 +192,7 @@ function testLogoSettingOverride() { /** * Test whether the scheme can be set, viewed anonymously and reset. */ - function testOverrideAndResetScheme() { + public function testOverrideAndResetScheme() { $settings_path = 'admin/appearance/settings/bartik'; $this->config('system.theme') ->set('default', 'bartik') diff --git a/core/modules/comment/src/Plugin/views/argument/UserUid.php b/core/modules/comment/src/Plugin/views/argument/UserUid.php index 1fc59929df0d273a93992a080585692b57eb6929..7023102d8326a7fa62126da4f8163c37284e64e5 100644 --- a/core/modules/comment/src/Plugin/views/argument/UserUid.php +++ b/core/modules/comment/src/Plugin/views/argument/UserUid.php @@ -49,7 +49,7 @@ public static function create(ContainerInterface $container, array $configuratio return new static($configuration, $plugin_id, $plugin_definition, $container->get('database')); } - function title() { + public function title() { if (!$this->argument) { $title = \Drupal::config('user.settings')->get('anonymous'); } diff --git a/core/modules/comment/src/Tests/CommentActionsTest.php b/core/modules/comment/src/Tests/CommentActionsTest.php index 8b741e79272a89d93202f2551141e995b71a0d38..56d34e4a597c19e072dcdebc49f57a901217863d 100644 --- a/core/modules/comment/src/Tests/CommentActionsTest.php +++ b/core/modules/comment/src/Tests/CommentActionsTest.php @@ -22,7 +22,7 @@ class CommentActionsTest extends CommentTestBase { /** * Tests comment publish and unpublish actions. */ - function testCommentPublishUnpublishActions() { + public function testCommentPublishUnpublishActions() { $this->drupalLogin($this->webUser); $comment_text = $this->randomMachineName(); $subject = $this->randomMachineName(); @@ -42,7 +42,7 @@ function testCommentPublishUnpublishActions() { /** * Tests the unpublish comment by keyword action. */ - function testCommentUnpublishByKeyword() { + public function testCommentUnpublishByKeyword() { $this->drupalLogin($this->adminUser); $keyword_1 = $this->randomMachineName(); $keyword_2 = $this->randomMachineName(); diff --git a/core/modules/comment/src/Tests/CommentAdminTest.php b/core/modules/comment/src/Tests/CommentAdminTest.php index 74e6e459691371ba9ec66086b24256cf08ab84d4..980ad30a2601dd92b8cbd72c3cdeed2a3123d4be 100644 --- a/core/modules/comment/src/Tests/CommentAdminTest.php +++ b/core/modules/comment/src/Tests/CommentAdminTest.php @@ -21,7 +21,7 @@ protected function setUp() { /** * Test comment approval functionality through admin/content/comment. */ - function testApprovalAdminInterface() { + public function testApprovalAdminInterface() { // Set anonymous comments to require approval. user_role_change_permissions(RoleInterface::ANONYMOUS_ID, [ 'access comments' => TRUE, @@ -103,7 +103,7 @@ function testApprovalAdminInterface() { /** * Tests comment approval functionality through the node interface. */ - function testApprovalNodeInterface() { + public function testApprovalNodeInterface() { // Set anonymous comments to require approval. user_role_change_permissions(RoleInterface::ANONYMOUS_ID, [ 'access comments' => TRUE, diff --git a/core/modules/comment/src/Tests/CommentAnonymousTest.php b/core/modules/comment/src/Tests/CommentAnonymousTest.php index 7c94e5af87110f5c80a19502319641d849944739..d60c0739f3aa46a3533951f13b0f66d3a753915c 100644 --- a/core/modules/comment/src/Tests/CommentAnonymousTest.php +++ b/core/modules/comment/src/Tests/CommentAnonymousTest.php @@ -30,7 +30,7 @@ protected function setUp() { /** * Tests anonymous comment functionality. */ - function testAnonymous() { + public function testAnonymous() { $this->drupalLogin($this->adminUser); $this->setCommentAnonymous(COMMENT_ANONYMOUS_MAYNOT_CONTACT); $this->drupalLogout(); diff --git a/core/modules/comment/src/Tests/CommentBlockTest.php b/core/modules/comment/src/Tests/CommentBlockTest.php index fca7223a41c45a29ecff06fb7ca50e192611f36d..37cc5de6209bdabba9b78635abd8c3a11f6eca0b 100644 --- a/core/modules/comment/src/Tests/CommentBlockTest.php +++ b/core/modules/comment/src/Tests/CommentBlockTest.php @@ -36,7 +36,7 @@ protected function setUp() { /** * Tests the recent comments block. */ - function testRecentCommentBlock() { + public function testRecentCommentBlock() { $this->drupalLogin($this->adminUser); $block = $this->drupalPlaceBlock('views_block:comments_recent-block_1'); diff --git a/core/modules/comment/src/Tests/CommentCSSTest.php b/core/modules/comment/src/Tests/CommentCSSTest.php index 3c48f698cda62140f2ed5d7975b87cf365e8dfa9..b50e9527a012cef54bd654726895cbf1844af977 100644 --- a/core/modules/comment/src/Tests/CommentCSSTest.php +++ b/core/modules/comment/src/Tests/CommentCSSTest.php @@ -27,7 +27,7 @@ protected function setUp() { /** * Tests CSS classes on comments. */ - function testCommentClasses() { + public function testCommentClasses() { // Create all permutations for comments, users, and nodes. $parameters = [ 'node_uid' => [0, $this->webUser->id()], diff --git a/core/modules/comment/src/Tests/CommentFieldsTest.php b/core/modules/comment/src/Tests/CommentFieldsTest.php index fa8a72a6a8ad3d9bb3eb046ee791667c60c4ae99..a463314a72236aec04015cdeacc501cce4810637 100644 --- a/core/modules/comment/src/Tests/CommentFieldsTest.php +++ b/core/modules/comment/src/Tests/CommentFieldsTest.php @@ -24,7 +24,7 @@ class CommentFieldsTest extends CommentTestBase { /** * Tests that the default 'comment_body' field is correctly added. */ - function testCommentDefaultFields() { + public function testCommentDefaultFields() { // Do not make assumptions on default node types created by the test // installation profile, and create our own. $this->drupalCreateContentType(['type' => 'test_node_type']); @@ -183,7 +183,7 @@ public function testCommentFieldCreate() { /** * Tests that comment module works when installed after a content module. */ - function testCommentInstallAfterContentModule() { + public function testCommentInstallAfterContentModule() { // Create a user to do module administration. $this->adminUser = $this->drupalCreateUser(['access administration pages', 'administer modules']); $this->drupalLogin($this->adminUser); diff --git a/core/modules/comment/src/Tests/CommentLanguageTest.php b/core/modules/comment/src/Tests/CommentLanguageTest.php index b047b403410a2857049037b582a8b49f495dd6df..eee0862ec6d22313db8c0098ad52f589107ceef9 100644 --- a/core/modules/comment/src/Tests/CommentLanguageTest.php +++ b/core/modules/comment/src/Tests/CommentLanguageTest.php @@ -76,7 +76,7 @@ protected function setUp() { /** * Test that comment language is properly set. */ - function testCommentLanguage() { + public function testCommentLanguage() { // Create two nodes, one for english and one for french, and comment each // node using both english and french as content language by changing URL diff --git a/core/modules/comment/src/Tests/CommentNodeAccessTest.php b/core/modules/comment/src/Tests/CommentNodeAccessTest.php index 60f8bbdd5ad07d5a937a6ebb0a3f64e08cb685d4..ffbffa1ff95c2e65b69ce89febba88eba256090c 100644 --- a/core/modules/comment/src/Tests/CommentNodeAccessTest.php +++ b/core/modules/comment/src/Tests/CommentNodeAccessTest.php @@ -43,7 +43,7 @@ protected function setUp() { /** * Test that threaded comments can be viewed. */ - function testThreadedCommentView() { + public function testThreadedCommentView() { // Set comments to have subject required and preview disabled. $this->drupalLogin($this->adminUser); $this->setCommentPreview(DRUPAL_DISABLED); diff --git a/core/modules/comment/src/Tests/CommentNodeChangesTest.php b/core/modules/comment/src/Tests/CommentNodeChangesTest.php index 7724f9979a0488135bbaf4943bcbedd9e7d082f5..148198d001f8187e99458aa88ddbc2ca27a425b0 100644 --- a/core/modules/comment/src/Tests/CommentNodeChangesTest.php +++ b/core/modules/comment/src/Tests/CommentNodeChangesTest.php @@ -16,7 +16,7 @@ class CommentNodeChangesTest extends CommentTestBase { /** * Tests that comments are deleted with the node. */ - function testNodeDeletion() { + public function testNodeDeletion() { $this->drupalLogin($this->webUser); $comment = $this->postComment($this->node, $this->randomMachineName(), $this->randomMachineName()); $this->assertTrue($comment->id(), 'The comment could be loaded.'); diff --git a/core/modules/comment/src/Tests/CommentNonNodeTest.php b/core/modules/comment/src/Tests/CommentNonNodeTest.php index bc40c9d8adff71d448c304bb02b12d04cf25eaf3..3c285d8f1c39292314996c4f936350a430261100 100644 --- a/core/modules/comment/src/Tests/CommentNonNodeTest.php +++ b/core/modules/comment/src/Tests/CommentNonNodeTest.php @@ -108,7 +108,7 @@ protected function setUp() { * @return \Drupal\comment\CommentInterface * The new comment entity. */ - function postComment(EntityInterface $entity, $comment, $subject = '', $contact = NULL) { + public function postComment(EntityInterface $entity, $comment, $subject = '', $contact = NULL) { $edit = []; $edit['comment_body[0][value]'] = $comment; @@ -180,7 +180,7 @@ function postComment(EntityInterface $entity, $comment, $subject = '', $contact * @return bool * Boolean indicating whether the comment was found. */ - function commentExists(CommentInterface $comment = NULL, $reply = FALSE) { + public function commentExists(CommentInterface $comment = NULL, $reply = FALSE) { if ($comment) { $regex = '/' . ($reply ? '
(.*?)' : ''); $regex .= 'getRawContent()); } @@ -215,7 +215,7 @@ function commentContactInfoAvailable() { * @param bool $approval * Operation is found on approval page. */ - function performCommentOperation($comment, $operation, $approval = FALSE) { + public function performCommentOperation($comment, $operation, $approval = FALSE) { $edit = []; $edit['operation'] = $operation; $edit['comments[' . $comment->id() . ']'] = TRUE; @@ -239,7 +239,7 @@ function performCommentOperation($comment, $operation, $approval = FALSE) { * @return int * Comment ID. */ - function getUnapprovedComment($subject) { + public function getUnapprovedComment($subject) { $this->drupalGet('admin/content/comment/approval'); preg_match('/href="(.*?)#comment-([^"]+)"(.*?)>(' . $subject . ')/', $this->getRawContent(), $match); @@ -249,7 +249,7 @@ function getUnapprovedComment($subject) { /** * Tests anonymous comment functionality. */ - function testCommentFunctionality() { + public function testCommentFunctionality() { $limited_user = $this->drupalCreateUser([ 'administer entity_test fields' ]); diff --git a/core/modules/comment/src/Tests/CommentPagerTest.php b/core/modules/comment/src/Tests/CommentPagerTest.php index 1bfda557f50256fecdc63c74dc3f5af24a9cb999..9c4897840363d01528549f2ca1f8aabf8b8f8d00 100644 --- a/core/modules/comment/src/Tests/CommentPagerTest.php +++ b/core/modules/comment/src/Tests/CommentPagerTest.php @@ -15,7 +15,7 @@ class CommentPagerTest extends CommentTestBase { /** * Confirms comment paging works correctly with flat and threaded comments. */ - function testCommentPaging() { + public function testCommentPaging() { $this->drupalLogin($this->adminUser); // Set comment variables. @@ -93,7 +93,7 @@ function testCommentPaging() { /** * Confirms comment paging works correctly with flat and threaded comments. */ - function testCommentPermalink() { + public function testCommentPermalink() { $this->drupalLogin($this->adminUser); // Set comment variables. @@ -125,7 +125,7 @@ function testCommentPermalink() { /** * Tests comment ordering and threading. */ - function testCommentOrderingThreading() { + public function testCommentOrderingThreading() { $this->drupalLogin($this->adminUser); // Set comment variables. @@ -205,7 +205,7 @@ function testCommentOrderingThreading() { * @param array $expected_order * An array of keys from $comments describing the expected order. */ - function assertCommentOrder(array $comments, array $expected_order) { + public function assertCommentOrder(array $comments, array $expected_order) { $expected_cids = []; // First, rekey the expected order by cid. @@ -224,7 +224,7 @@ function assertCommentOrder(array $comments, array $expected_order) { /** * Tests calculation of first page with new comment. */ - function testCommentNewPageIndicator() { + public function testCommentNewPageIndicator() { $this->drupalLogin($this->adminUser); // Set comment variables. @@ -304,7 +304,7 @@ function testCommentNewPageIndicator() { /** * Confirms comment paging works correctly with two pagers. */ - function testTwoPagers() { + public function testTwoPagers() { // Add another field to article content-type. $this->addDefaultCommentField('node', 'article', 'comment_2'); // Set default to display comment list with unique pager id. diff --git a/core/modules/comment/src/Tests/CommentPreviewTest.php b/core/modules/comment/src/Tests/CommentPreviewTest.php index 039c6ab10bab5ddb05c70d9d37eebc346abc272c..1b07fe600b08abd105d1d9ecea533b661b887318 100644 --- a/core/modules/comment/src/Tests/CommentPreviewTest.php +++ b/core/modules/comment/src/Tests/CommentPreviewTest.php @@ -26,7 +26,7 @@ class CommentPreviewTest extends CommentTestBase { /** * Tests comment preview. */ - function testCommentPreview() { + public function testCommentPreview() { // As admin user, configure comment settings. $this->drupalLogin($this->adminUser); $this->setCommentPreview(DRUPAL_OPTIONAL); @@ -123,7 +123,7 @@ public function testCommentPreviewDuplicateSubmission() { /** * Tests comment edit, preview, and save. */ - function testCommentEditPreviewSave() { + public function testCommentEditPreviewSave() { $web_user = $this->drupalCreateUser(['access comments', 'post comments', 'skip comment approval', 'edit own comments']); $this->drupalLogin($this->adminUser); $this->setCommentPreview(DRUPAL_OPTIONAL); diff --git a/core/modules/comment/src/Tests/CommentRssTest.php b/core/modules/comment/src/Tests/CommentRssTest.php index 5c9fe3d667f13229e8a7dd345a04f9c083d7a090..35cad71fa99b6436100df70679ca434be9b0cd6f 100644 --- a/core/modules/comment/src/Tests/CommentRssTest.php +++ b/core/modules/comment/src/Tests/CommentRssTest.php @@ -42,7 +42,7 @@ protected function setUp() { /** * Tests comments as part of an RSS feed. */ - function testCommentRss() { + public function testCommentRss() { // Find comment in RSS feed. $this->drupalLogin($this->webUser); $this->postComment($this->node, $this->randomMachineName(), $this->randomMachineName()); diff --git a/core/modules/comment/src/Tests/CommentStatisticsTest.php b/core/modules/comment/src/Tests/CommentStatisticsTest.php index bd0838ca5d2d14941084164163797ca868b73257..0d1ec3a0451c4264a2c8b06e4a56861649631c8e 100644 --- a/core/modules/comment/src/Tests/CommentStatisticsTest.php +++ b/core/modules/comment/src/Tests/CommentStatisticsTest.php @@ -38,7 +38,7 @@ protected function setUp() { /** * Tests the node comment statistics. */ - function testCommentNodeCommentStatistics() { + public function testCommentNodeCommentStatistics() { $node_storage = $this->container->get('entity.manager')->getStorage('node'); // Set comments to have subject and preview disabled. $this->drupalLogin($this->adminUser); diff --git a/core/modules/comment/src/Tests/CommentTestBase.php b/core/modules/comment/src/Tests/CommentTestBase.php index 716b3bd96fea10decc8ffc11673b69a3589c2d33..c42d9883c62e7143877173b688bc18c523028c34 100644 --- a/core/modules/comment/src/Tests/CommentTestBase.php +++ b/core/modules/comment/src/Tests/CommentTestBase.php @@ -184,7 +184,7 @@ public function postComment($entity, $comment, $subject = '', $contact = NULL, $ * @return bool * Boolean indicating whether the comment was found. */ - function commentExists(CommentInterface $comment = NULL, $reply = FALSE) { + public function commentExists(CommentInterface $comment = NULL, $reply = FALSE) { if ($comment) { $comment_element = $this->cssSelect('.comment-wrapper ' . ($reply ? '.indented ' : '') . '#comment-' . $comment->id() . ' ~ article'); if (empty($comment_element)) { @@ -214,7 +214,7 @@ function commentExists(CommentInterface $comment = NULL, $reply = FALSE) { * @param \Drupal\comment\CommentInterface $comment * Comment to delete. */ - function deleteComment(CommentInterface $comment) { + public function deleteComment(CommentInterface $comment) { $this->drupalPostForm('comment/' . $comment->id() . '/delete', [], t('Delete')); $this->assertText(t('The comment and all its replies have been deleted.'), 'Comment deleted.'); } @@ -289,7 +289,7 @@ public function setCommentForm($enabled, $field_name = 'comment') { * - 1: Contact information allowed but not required. * - 2: Contact information required. */ - function setCommentAnonymous($level) { + public function setCommentAnonymous($level) { $this->setCommentSettings('anonymous', $level, format_string('Anonymous commenting set to level @level.', ['@level' => $level])); } @@ -333,7 +333,7 @@ public function setCommentSettings($name, $value, $message, $field_name = 'comme * @return bool * Contact info is available. */ - function commentContactInfoAvailable() { + public function commentContactInfoAvailable() { return preg_match('/(input).*?(name="name").*?(input).*?(name="mail").*?(input).*?(name="homepage")/s', $this->getRawContent()); } @@ -347,7 +347,7 @@ function commentContactInfoAvailable() { * @param bool $approval * Operation is found on approval page. */ - function performCommentOperation(CommentInterface $comment, $operation, $approval = FALSE) { + public function performCommentOperation(CommentInterface $comment, $operation, $approval = FALSE) { $edit = []; $edit['operation'] = $operation; $edit['comments[' . $comment->id() . ']'] = TRUE; @@ -371,7 +371,7 @@ function performCommentOperation(CommentInterface $comment, $operation, $approva * @return int * Comment id. */ - function getUnapprovedComment($subject) { + public function getUnapprovedComment($subject) { $this->drupalGet('admin/content/comment/approval'); preg_match('/href="(.*?)#comment-([^"]+)"(.*?)>(' . $subject . ')/', $this->getRawContent(), $match); diff --git a/core/modules/comment/src/Tests/CommentThreadingTest.php b/core/modules/comment/src/Tests/CommentThreadingTest.php index 2dbf5bdea8575971a9a1c9accbd6a2f6f70bf8a8..8f412b22f74b48b0ba5c851d44557a88c93a2f0a 100644 --- a/core/modules/comment/src/Tests/CommentThreadingTest.php +++ b/core/modules/comment/src/Tests/CommentThreadingTest.php @@ -13,7 +13,7 @@ class CommentThreadingTest extends CommentTestBase { /** * Tests the comment threading. */ - function testCommentThreading() { + public function testCommentThreading() { // Set comments to have a subject with preview disabled. $this->drupalLogin($this->adminUser); $this->setCommentPreview(DRUPAL_DISABLED); diff --git a/core/modules/comment/src/Tests/CommentTokenReplaceTest.php b/core/modules/comment/src/Tests/CommentTokenReplaceTest.php index 325aecb2daa429a37a913d0a3da49865218685af..6caea1789c5ccc42ce5952fb31c6b8b9490c499e 100644 --- a/core/modules/comment/src/Tests/CommentTokenReplaceTest.php +++ b/core/modules/comment/src/Tests/CommentTokenReplaceTest.php @@ -29,7 +29,7 @@ class CommentTokenReplaceTest extends CommentTestBase { /** * Creates a comment, then tests the tokens generated from it. */ - function testCommentTokenReplacement() { + public function testCommentTokenReplacement() { $token_service = \Drupal::token(); $language_interface = \Drupal::languageManager()->getCurrentLanguage(); $url_options = [ diff --git a/core/modules/comment/src/Tests/CommentTranslationUITest.php b/core/modules/comment/src/Tests/CommentTranslationUITest.php index 3157e23bddb5fc7f9f9439ecb1e68b6d3fd36d14..4613d66ecc707e07a18f1363ea88016d6a1d0db2 100644 --- a/core/modules/comment/src/Tests/CommentTranslationUITest.php +++ b/core/modules/comment/src/Tests/CommentTranslationUITest.php @@ -60,7 +60,7 @@ protected function setUp() { /** * {@inheritdoc} */ - function setupBundle() { + public function setupBundle() { parent::setupBundle(); $this->drupalCreateContentType(['type' => $this->nodeBundle, 'name' => $this->nodeBundle]); // Add a comment field to the article content type. @@ -181,7 +181,7 @@ protected function doTestAuthoringInfo() { /** * Tests translate link on comment content admin page. */ - function testTranslateLinkCommentAdminPage() { + public function testTranslateLinkCommentAdminPage() { $this->adminUser = $this->drupalCreateUser(array_merge(parent::getTranslatorPermissions(), ['access administration pages', 'administer comments', 'skip comment approval'])); $this->drupalLogin($this->adminUser); diff --git a/core/modules/comment/src/Tests/CommentUninstallTest.php b/core/modules/comment/src/Tests/CommentUninstallTest.php index 9f9d36ad012da400112775a45498e9b3b7aab218..7873915f03a105c049e0d2441fe99e3ba233f7d4 100644 --- a/core/modules/comment/src/Tests/CommentUninstallTest.php +++ b/core/modules/comment/src/Tests/CommentUninstallTest.php @@ -36,7 +36,7 @@ protected function setUp() { * * @throws \Drupal\Core\Extension\ModuleUninstallValidatorException */ - function testCommentUninstallWithField() { + public function testCommentUninstallWithField() { // Ensure that the field exists before uninstallation. $field_storage = FieldStorageConfig::loadByName('comment', 'comment_body'); $this->assertNotNull($field_storage, 'The comment_body field exists.'); @@ -55,7 +55,7 @@ function testCommentUninstallWithField() { /** * Tests if uninstallation succeeds if the field has been deleted beforehand. */ - function testCommentUninstallWithoutField() { + public function testCommentUninstallWithoutField() { // Manually delete the comment_body field before module uninstallation. $field_storage = FieldStorageConfig::loadByName('comment', 'comment_body'); $this->assertNotNull($field_storage, 'The comment_body field exists.'); diff --git a/core/modules/comment/src/Tests/Views/ArgumentUserUIDTest.php b/core/modules/comment/src/Tests/Views/ArgumentUserUIDTest.php index 3365918ff9532f000af38ebcfb3af9914a8565c3..d3526dc2846572d868eeda4007819fbd5707fad9 100644 --- a/core/modules/comment/src/Tests/Views/ArgumentUserUIDTest.php +++ b/core/modules/comment/src/Tests/Views/ArgumentUserUIDTest.php @@ -20,7 +20,7 @@ class ArgumentUserUIDTest extends CommentTestBase { */ public static $testViews = ['test_comment_user_uid']; - function testCommentUserUIDTest() { + public function testCommentUserUIDTest() { // Add an additional comment which is not created by the user. $new_user = User::create(['name' => 'new user']); $new_user->save(); diff --git a/core/modules/comment/src/Tests/Views/CommentFieldFilterTest.php b/core/modules/comment/src/Tests/Views/CommentFieldFilterTest.php index 040fc7dadb1d9dc6734dc766e8f15e0bc9985e57..48f7d6d25563156730e6b08bff9c16ae58f8503f 100644 --- a/core/modules/comment/src/Tests/Views/CommentFieldFilterTest.php +++ b/core/modules/comment/src/Tests/Views/CommentFieldFilterTest.php @@ -31,7 +31,7 @@ class CommentFieldFilterTest extends CommentTestBase { */ public $commentTitles = []; - function setUp() { + public function setUp() { parent::setUp(); $this->drupalLogin($this->drupalCreateUser(['access comments'])); diff --git a/core/modules/comment/src/Tests/Views/FilterUserUIDTest.php b/core/modules/comment/src/Tests/Views/FilterUserUIDTest.php index c4570cee328857d5781faa05b1ff57f632ba1aa3..442a0e762b4a748c82b2f933176f217ca4a3651a 100644 --- a/core/modules/comment/src/Tests/Views/FilterUserUIDTest.php +++ b/core/modules/comment/src/Tests/Views/FilterUserUIDTest.php @@ -22,7 +22,7 @@ class FilterUserUIDTest extends CommentTestBase { */ public static $testViews = ['test_comment_user_uid']; - function testCommentUserUIDTest() { + public function testCommentUserUIDTest() { $view = Views::getView('test_comment_user_uid'); $view->setDisplay(); $view->removeHandler('default', 'argument', 'uid_touch'); diff --git a/core/modules/config/src/ConfigSubscriber.php b/core/modules/config/src/ConfigSubscriber.php index aebc86e61cac519b49cfa28a10e97f589ddad215..94405a1cd08289e75c30115f067f734665a9d364 100644 --- a/core/modules/config/src/ConfigSubscriber.php +++ b/core/modules/config/src/ConfigSubscriber.php @@ -29,7 +29,7 @@ public function onConfigImporterValidate(ConfigImporterEvent $event) { /** * {@inheritdoc} */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { $events[ConfigEvents::IMPORT_VALIDATE][] = ['onConfigImporterValidate', 20]; return $events; } diff --git a/core/modules/config/src/Tests/ConfigEntityListTest.php b/core/modules/config/src/Tests/ConfigEntityListTest.php index 161944b9812a9d19887bbd30344df2633d8f14bd..e9950ea424b2a32ec93b73af0e139abb98cb618b 100644 --- a/core/modules/config/src/Tests/ConfigEntityListTest.php +++ b/core/modules/config/src/Tests/ConfigEntityListTest.php @@ -34,7 +34,7 @@ protected function setUp() { /** * Tests entity list builder methods. */ - function testList() { + public function testList() { $controller = \Drupal::entityManager()->getListBuilder('config_test'); // Test getStorage() method. @@ -147,7 +147,7 @@ function testList() { /** * Tests the listing UI. */ - function testListUI() { + public function testListUI() { // Log in as an administrative user to access the full menu trail. $this->drupalLogin($this->drupalCreateUser(['access administration pages', 'administer site configuration'])); diff --git a/core/modules/config/src/Tests/ConfigEntityTest.php b/core/modules/config/src/Tests/ConfigEntityTest.php index 77b35cc040dd43a17d0ac9147fdb518ead8d2e34..c0dc97bc7b56297ab700c89015faaba90416c901 100644 --- a/core/modules/config/src/Tests/ConfigEntityTest.php +++ b/core/modules/config/src/Tests/ConfigEntityTest.php @@ -32,7 +32,7 @@ class ConfigEntityTest extends WebTestBase { /** * Tests CRUD operations. */ - function testCRUD() { + public function testCRUD() { $default_langcode = \Drupal::languageManager()->getDefaultLanguage()->getId(); // Verify default properties on a newly created empty entity. $empty = entity_create('config_test'); @@ -230,7 +230,7 @@ function testCRUD() { /** * Tests CRUD operations through the UI. */ - function testCRUDUI() { + public function testCRUDUI() { $this->drupalLogin($this->drupalCreateUser(['administer site configuration'])); $id = strtolower($this->randomMachineName()); diff --git a/core/modules/config/src/Tests/ConfigExportUITest.php b/core/modules/config/src/Tests/ConfigExportUITest.php index 839aa26cadeb98b89e8a9401ba907f12a7174da1..c9f53b36fde5026722a9a249a513f63705754bfe 100644 --- a/core/modules/config/src/Tests/ConfigExportUITest.php +++ b/core/modules/config/src/Tests/ConfigExportUITest.php @@ -39,7 +39,7 @@ protected function setUp() { /** * Tests export of configuration. */ - function testExport() { + public function testExport() { // Verify the export page with export submit button is available. $this->drupalGet('admin/config/development/configuration/full/export'); $this->assertFieldById('edit-submit', t('Export')); diff --git a/core/modules/config/src/Tests/ConfigImportUITest.php b/core/modules/config/src/Tests/ConfigImportUITest.php index 1b63c2abe63711626d887fe27eb27ed621b6f663..31654b357744de1d63778b35e381c42d4f703ce8 100644 --- a/core/modules/config/src/Tests/ConfigImportUITest.php +++ b/core/modules/config/src/Tests/ConfigImportUITest.php @@ -39,7 +39,7 @@ protected function setUp() { /** * Tests importing configuration. */ - function testImport() { + public function testImport() { $name = 'system.site'; $dynamic_name = 'config_test.dynamic.new'; /** @var \Drupal\Core\Config\StorageInterface $sync */ @@ -221,7 +221,7 @@ function testImport() { /** * Tests concurrent importing of configuration. */ - function testImportLock() { + public function testImportLock() { // Create updated configuration object. $new_site_name = 'Config import test ' . $this->randomString(); $this->prepareSiteNameUpdate($new_site_name); @@ -248,7 +248,7 @@ function testImportLock() { /** * Tests verification of site UUID before importing configuration. */ - function testImportSiteUuidValidation() { + public function testImportSiteUuidValidation() { $sync = \Drupal::service('config.storage.sync'); // Create updated configuration object. $config_data = $this->config('system.site')->get(); @@ -265,7 +265,7 @@ function testImportSiteUuidValidation() { /** * Tests the screen that shows differences between active and sync. */ - function testImportDiff() { + public function testImportDiff() { $sync = $this->container->get('config.storage.sync'); $config_name = 'config_test.system'; $change_key = 'foo'; @@ -377,7 +377,7 @@ public function testConfigUninstallConfigException() { $this->assertText('Can not uninstall the Configuration module as part of a configuration synchronization through the user interface.'); } - function prepareSiteNameUpdate($new_site_name) { + public function prepareSiteNameUpdate($new_site_name) { $sync = $this->container->get('config.storage.sync'); // Create updated configuration object. $config_data = $this->config('system.site')->get(); @@ -388,7 +388,7 @@ function prepareSiteNameUpdate($new_site_name) { /** * Tests an import that results in an error. */ - function testImportErrorLog() { + public function testImportErrorLog() { $name_primary = 'config_test.dynamic.primary'; $name_secondary = 'config_test.dynamic.secondary'; $sync = $this->container->get('config.storage.sync'); diff --git a/core/modules/config/src/Tests/ConfigImportUploadTest.php b/core/modules/config/src/Tests/ConfigImportUploadTest.php index 9792213a688d17b890fa198638e8c8595cecf6e9..5e2129513cf3201a20dc66112b316e73d6e2ccbd 100644 --- a/core/modules/config/src/Tests/ConfigImportUploadTest.php +++ b/core/modules/config/src/Tests/ConfigImportUploadTest.php @@ -35,7 +35,7 @@ protected function setUp() { /** * Tests importing configuration. */ - function testImport() { + public function testImport() { // Verify access to the config upload form. $this->drupalGet('admin/config/development/configuration/full/import'); $this->assertResponse(200); diff --git a/core/modules/config/src/Tests/ConfigInstallWebTest.php b/core/modules/config/src/Tests/ConfigInstallWebTest.php index 79b50a0a672241ed4fa17045d96ff5f4ffbf9f92..63ecb5bb68d664df6ea96d59f3ca5943a9964df5 100644 --- a/core/modules/config/src/Tests/ConfigInstallWebTest.php +++ b/core/modules/config/src/Tests/ConfigInstallWebTest.php @@ -36,7 +36,7 @@ protected function setUp() { /** * Tests module re-installation. */ - function testIntegrationModuleReinstallation() { + public function testIntegrationModuleReinstallation() { $default_config = 'config_integration_test.settings'; $default_configuration_entity = 'config_test.dynamic.config_integration_test'; diff --git a/core/modules/config/tests/config_collection_install_test/src/EventSubscriber.php b/core/modules/config/tests/config_collection_install_test/src/EventSubscriber.php index 76714a5b97d7bf13e72fc8c8b95c8fe73823166b..ae386612842df8a586fafbfc5b2edf03609b1e61 100644 --- a/core/modules/config/tests/config_collection_install_test/src/EventSubscriber.php +++ b/core/modules/config/tests/config_collection_install_test/src/EventSubscriber.php @@ -42,7 +42,7 @@ public function addCollections(ConfigCollectionInfo $collection_info) { /** * {@inheritdoc} */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { $events[ConfigEvents::COLLECTION_INFO][] = ['addCollections']; return $events; } diff --git a/core/modules/config/tests/config_events_test/src/EventSubscriber.php b/core/modules/config/tests/config_events_test/src/EventSubscriber.php index 39e8eb80fc1da1a3bd9c2a4c3f0aaad200e0f506..98417c02e95ea5c05d895fb3579f8b6388c126c6 100644 --- a/core/modules/config/tests/config_events_test/src/EventSubscriber.php +++ b/core/modules/config/tests/config_events_test/src/EventSubscriber.php @@ -48,7 +48,7 @@ public function configEventRecorder(ConfigCrudEvent $event, $name) { /** * {@inheritdoc} */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { $events[ConfigEvents::SAVE][] = ['configEventRecorder']; $events[ConfigEvents::DELETE][] = ['configEventRecorder']; $events[ConfigEvents::RENAME][] = ['configEventRecorder']; diff --git a/core/modules/config/tests/config_import_test/src/EventSubscriber.php b/core/modules/config/tests/config_import_test/src/EventSubscriber.php index e0ef923a390832243de28642e5cd3011bc5c3dc9..5f8ef86c045cfc734a69457d9607bad612903db5 100644 --- a/core/modules/config/tests/config_import_test/src/EventSubscriber.php +++ b/core/modules/config/tests/config_import_test/src/EventSubscriber.php @@ -131,7 +131,7 @@ public function onConfigDelete(ConfigCrudEvent $event) { * @return array * An array of event listener definitions. */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { $events[ConfigEvents::SAVE][] = ['onConfigSave', 40]; $events[ConfigEvents::DELETE][] = ['onConfigDelete', 40]; $events[ConfigEvents::IMPORT_VALIDATE] = ['onConfigImporterValidate']; diff --git a/core/modules/config/tests/config_test/src/ConfigTestController.php b/core/modules/config/tests/config_test/src/ConfigTestController.php index 6799dc1b6f033efa98eac35c259d6e51f6594a17..d352eca1641ef4d62319710d5349e5e68686cd4d 100644 --- a/core/modules/config/tests/config_test/src/ConfigTestController.php +++ b/core/modules/config/tests/config_test/src/ConfigTestController.php @@ -33,7 +33,7 @@ public function editTitle(ConfigTest $config_test) { * @return \Symfony\Component\HttpFoundation\RedirectResponse * A redirect response to the config_test listing page. */ - function enable(ConfigTest $config_test) { + public function enable(ConfigTest $config_test) { $config_test->enable()->save(); return new RedirectResponse($config_test->url('collection', ['absolute' => TRUE])); } @@ -47,7 +47,7 @@ function enable(ConfigTest $config_test) { * @return \Symfony\Component\HttpFoundation\RedirectResponse * A redirect response to the config_test listing page. */ - function disable(ConfigTest $config_test) { + public function disable(ConfigTest $config_test) { $config_test->disable()->save(); return new RedirectResponse($config_test->url('collection', ['absolute' => TRUE])); } diff --git a/core/modules/config/tests/src/Functional/ConfigDependencyWebTest.php b/core/modules/config/tests/src/Functional/ConfigDependencyWebTest.php index ba80401bc4d94b3c16f9a7a9881243c03fb6c9ca..696a36e8cb2916c80f0a159abd7f2d4dd8eea5e1 100644 --- a/core/modules/config/tests/src/Functional/ConfigDependencyWebTest.php +++ b/core/modules/config/tests/src/Functional/ConfigDependencyWebTest.php @@ -29,7 +29,7 @@ class ConfigDependencyWebTest extends BrowserTestBase { * * @see \Drupal\Core\Config\Entity\ConfigDependencyDeleteFormTrait */ - function testConfigDependencyDeleteFormTrait() { + public function testConfigDependencyDeleteFormTrait() { $this->drupalLogin($this->drupalCreateUser(['administer site configuration'])); /** @var \Drupal\Core\Config\Entity\ConfigEntityStorage $storage */ diff --git a/core/modules/config/tests/src/Functional/ConfigEntityListMultilingualTest.php b/core/modules/config/tests/src/Functional/ConfigEntityListMultilingualTest.php index 5d99252d9c94a8a00c2248819fb0d83b4c7b097e..7c5fa1fac19fe29e4a19d9c35c4cbc51d9427d73 100644 --- a/core/modules/config/tests/src/Functional/ConfigEntityListMultilingualTest.php +++ b/core/modules/config/tests/src/Functional/ConfigEntityListMultilingualTest.php @@ -34,7 +34,7 @@ protected function setUp() { /** * Tests the listing UI with different language scenarios. */ - function testListUI() { + public function testListUI() { // Log in as an administrative user to access the full menu trail. $this->drupalLogin($this->drupalCreateUser(['access administration pages', 'administer site configuration'])); diff --git a/core/modules/config/tests/src/Functional/ConfigEntityStatusUITest.php b/core/modules/config/tests/src/Functional/ConfigEntityStatusUITest.php index 4ad4d59b9d2df47db0ea8f7e87615e63ccf48c7c..af68f33bdc20e11522cd131c67222d83a9f16c0e 100644 --- a/core/modules/config/tests/src/Functional/ConfigEntityStatusUITest.php +++ b/core/modules/config/tests/src/Functional/ConfigEntityStatusUITest.php @@ -21,7 +21,7 @@ class ConfigEntityStatusUITest extends BrowserTestBase { /** * Tests status operations. */ - function testCRUD() { + public function testCRUD() { $this->drupalLogin($this->drupalCreateUser(['administer site configuration'])); $id = strtolower($this->randomMachineName()); diff --git a/core/modules/config/tests/src/Functional/ConfigInstallProfileOverrideTest.php b/core/modules/config/tests/src/Functional/ConfigInstallProfileOverrideTest.php index 88218b9899f29eb9610776ef4a489afd4f1f7835..1f5232c939ef8b8aba21b6529a818589f44e3691 100644 --- a/core/modules/config/tests/src/Functional/ConfigInstallProfileOverrideTest.php +++ b/core/modules/config/tests/src/Functional/ConfigInstallProfileOverrideTest.php @@ -28,7 +28,7 @@ class ConfigInstallProfileOverrideTest extends BrowserTestBase { /** * Tests install profile config changes. */ - function testInstallProfileConfigOverwrite() { + public function testInstallProfileConfigOverwrite() { $config_name = 'system.cron'; // The expected configuration from the system module. $expected_original_data = [ diff --git a/core/modules/config/tests/src/Functional/ConfigLanguageOverrideWebTest.php b/core/modules/config/tests/src/Functional/ConfigLanguageOverrideWebTest.php index 5fdd1a1441758dc97a5008b5fee92e43c4671166..092ad2b377f808f60ea375ba6d0be594bc502100 100644 --- a/core/modules/config/tests/src/Functional/ConfigLanguageOverrideWebTest.php +++ b/core/modules/config/tests/src/Functional/ConfigLanguageOverrideWebTest.php @@ -34,7 +34,7 @@ protected function setUp() { /** * Tests translating the site name. */ - function testSiteNameTranslation() { + public function testSiteNameTranslation() { $adminUser = $this->drupalCreateUser(['administer site configuration', 'administer languages']); $this->drupalLogin($adminUser); diff --git a/core/modules/contact/src/Tests/ContactPersonalTest.php b/core/modules/contact/src/Tests/ContactPersonalTest.php index d80484f4298b7dbe29471c3e3bfee3e079de8bab..afb7746e0bb131264e90fec6844067fde8518517 100644 --- a/core/modules/contact/src/Tests/ContactPersonalTest.php +++ b/core/modules/contact/src/Tests/ContactPersonalTest.php @@ -58,7 +58,7 @@ protected function setUp() { /** * Tests that mails for contact messages are correctly sent. */ - function testSendPersonalContactMessage() { + public function testSendPersonalContactMessage() { // Ensure that the web user's email needs escaping. $mail = $this->webUser->getUsername() . '&escaped@example.com'; $this->webUser->setEmail($mail)->save(); @@ -103,7 +103,7 @@ function testSendPersonalContactMessage() { /** * Tests access to the personal contact form. */ - function testPersonalContactAccess() { + public function testPersonalContactAccess() { // Test allowed access to admin user's contact form. $this->drupalLogin($this->webUser); $this->drupalGet('user/' . $this->adminUser->id() . '/contact'); @@ -223,7 +223,7 @@ function testPersonalContactAccess() { /** * Tests the personal contact form flood protection. */ - function testPersonalContactFlood() { + public function testPersonalContactFlood() { $flood_limit = 3; $this->config('contact.settings')->set('flood.limit', $flood_limit)->save(); @@ -248,7 +248,7 @@ function testPersonalContactFlood() { /** * Tests the personal contact form based access when an admin adds users. */ - function testAdminContact() { + public function testAdminContact() { user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, ['access user contact forms']); $this->checkContactAccess(200); $this->checkContactAccess(403, FALSE); diff --git a/core/modules/contact/src/Tests/ContactSitewideTest.php b/core/modules/contact/src/Tests/ContactSitewideTest.php index 0721cf4dc9d8c78804a393c511a78ccade9f6d54..4a5b1f731b939a31bad0c71681ac3d9eb320329d 100644 --- a/core/modules/contact/src/Tests/ContactSitewideTest.php +++ b/core/modules/contact/src/Tests/ContactSitewideTest.php @@ -42,7 +42,7 @@ protected function setUp() { /** * Tests configuration options and the site-wide contact form. */ - function testSiteWideContact() { + public function testSiteWideContact() { // Create and log in administrative user. $admin_user = $this->drupalCreateUser([ 'access site-wide contact form', @@ -349,7 +349,7 @@ function testSiteWideContact() { /** * Tests auto-reply on the site-wide contact form. */ - function testAutoReply() { + public function testAutoReply() { // Create and log in administrative user. $admin_user = $this->drupalCreateUser([ 'access site-wide contact form', @@ -431,7 +431,7 @@ function testAutoReply() { * @param array $third_party_settings * Array of third party settings to be added to the posted form data. */ - function addContactForm($id, $label, $recipients, $reply, $selected, $message = 'Your message has been sent.', $third_party_settings = []) { + public function addContactForm($id, $label, $recipients, $reply, $selected, $message = 'Your message has been sent.', $third_party_settings = []) { $edit = []; $edit['label'] = $label; $edit['id'] = $id; @@ -463,7 +463,7 @@ function addContactForm($id, $label, $recipients, $reply, $selected, $message = * @param string $redirect * The path where user will be redirect after this form has been submitted.. */ - function updateContactForm($id, $label, $recipients, $reply, $selected, $message = 'Your message has been sent.', $redirect = '/') { + public function updateContactForm($id, $label, $recipients, $reply, $selected, $message = 'Your message has been sent.', $redirect = '/') { $edit = []; $edit['label'] = $label; $edit['recipients'] = $recipients; @@ -488,7 +488,7 @@ function updateContactForm($id, $label, $recipients, $reply, $selected, $message * @param string $message * The message body. */ - function submitContact($name, $mail, $subject, $id, $message) { + public function submitContact($name, $mail, $subject, $id, $message) { $edit = []; $edit['name'] = $name; $edit['mail'] = $mail; @@ -505,7 +505,7 @@ function submitContact($name, $mail, $subject, $id, $message) { /** * Deletes all forms. */ - function deleteContactForms() { + public function deleteContactForms() { $contact_forms = ContactForm::loadMultiple();; foreach ($contact_forms as $id => $contact_form) { if ($id == 'personal') { diff --git a/core/modules/contact/tests/src/Functional/ContactAuthenticatedUserTest.php b/core/modules/contact/tests/src/Functional/ContactAuthenticatedUserTest.php index 306fe5d41cc68e9285ecfcc70e38be5755074eca..43cf3ce0fbbe54bbff06ce853f309bf8b6ac3fe6 100644 --- a/core/modules/contact/tests/src/Functional/ContactAuthenticatedUserTest.php +++ b/core/modules/contact/tests/src/Functional/ContactAuthenticatedUserTest.php @@ -21,7 +21,7 @@ class ContactAuthenticatedUserTest extends BrowserTestBase { /** * Tests that name and email fields are not present for authenticated users. */ - function testContactSiteWideTextfieldsLoggedInTestCase() { + public function testContactSiteWideTextfieldsLoggedInTestCase() { $this->drupalLogin($this->drupalCreateUser(['access site-wide contact form'])); $this->drupalGet('contact'); diff --git a/core/modules/content_translation/src/ContentTranslationHandler.php b/core/modules/content_translation/src/ContentTranslationHandler.php index 9a6050d794218ae5d99ca3cf48759c360ce90ad3..c1688b9d64775e32f02b700953f44b854de5f035 100644 --- a/core/modules/content_translation/src/ContentTranslationHandler.php +++ b/core/modules/content_translation/src/ContentTranslationHandler.php @@ -610,7 +610,7 @@ public function entityFormEntityBuild($entity_type, EntityInterface $entity, arr * * Validates the submitted content translation metadata. */ - function entityFormValidate($form, FormStateInterface $form_state) { + public function entityFormValidate($form, FormStateInterface $form_state) { if (!$form_state->isValueEmpty('content_translation')) { $translation = $form_state->getValue('content_translation'); // Validate the "authored by" field. @@ -630,7 +630,7 @@ function entityFormValidate($form, FormStateInterface $form_state) { * Updates metadata fields, which should be updated only after the validation * has run and before the entity is saved. */ - function entityFormSubmit($form, FormStateInterface $form_state) { + public function entityFormSubmit($form, FormStateInterface $form_state) { /** @var \Drupal\Core\Entity\ContentEntityFormInterface $form_object */ $form_object = $form_state->getFormObject(); /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */ @@ -673,7 +673,7 @@ public function entityFormSourceChange($form, FormStateInterface $form_state) { * * Takes care of entity deletion. */ - function entityFormDelete($form, FormStateInterface $form_state) { + public function entityFormDelete($form, FormStateInterface $form_state) { $form_object = $form_state->getFormObject()->getEntity(); $entity = $form_object->getEntity(); if (count($entity->getTranslationLanguages()) > 1) { @@ -686,7 +686,7 @@ function entityFormDelete($form, FormStateInterface $form_state) { * * Takes care of content translation deletion. */ - function entityFormDeleteTranslation($form, FormStateInterface $form_state) { + public function entityFormDeleteTranslation($form, FormStateInterface $form_state) { /** @var \Drupal\Core\Entity\ContentEntityFormInterface $form_object */ $form_object = $form_state->getFormObject(); /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */ diff --git a/core/modules/content_translation/src/ContentTranslationManager.php b/core/modules/content_translation/src/ContentTranslationManager.php index 70adc289bf26e44cd4fcde36e781290d8c3a1c83..da8bd1c618140077de9d7ad931f73a279e59cff4 100644 --- a/core/modules/content_translation/src/ContentTranslationManager.php +++ b/core/modules/content_translation/src/ContentTranslationManager.php @@ -40,7 +40,7 @@ public function __construct(EntityManagerInterface $manager, ContentTranslationU /** * {@inheritdoc} */ - function getTranslationHandler($entity_type_id) { + public function getTranslationHandler($entity_type_id) { return $this->entityManager->getHandler($entity_type_id, 'translation'); } diff --git a/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php b/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php index aed653b9036c0b5ceb9e925a969dc3f67c941888..7a1c598047b7d2d55d77daa47717bb1e7bc1415c 100644 --- a/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php +++ b/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php @@ -43,7 +43,7 @@ protected function setUp() { /** * Tests that the settings UI works as expected. */ - function testSettingsUI() { + public function testSettingsUI() { // Check for the content_translation_menu_links_discovered_alter() changes. $this->drupalGet('admin/config'); $this->assertLink('Content language and translation'); @@ -200,7 +200,7 @@ function testSettingsUI() { /** * Tests the language settings checkbox on account settings page. */ - function testAccountLanguageSettingsUI() { + public function testAccountLanguageSettingsUI() { // Make sure the checkbox is available and not checked by default. $this->drupalGet('admin/config/people/accounts'); $this->assertField('language[content_translation]'); @@ -245,7 +245,7 @@ protected function assertSettings($entity_type, $bundle, $enabled, $edit) { /** * Tests that field setting depends on bundle translatability. */ - function testFieldTranslatableSettingsUI() { + public function testFieldTranslatableSettingsUI() { // At least one field needs to be translatable to enable article for // translation. Create an extra field to be used for this purpose. We use // the UI to test our form alterations. @@ -280,7 +280,7 @@ function testFieldTranslatableSettingsUI() { /** * Tests the translatable settings checkbox for untranslatable entities. */ - function testNonTranslatableTranslationSettingsUI() { + public function testNonTranslatableTranslationSettingsUI() { $this->drupalGet('admin/config/regional/content-language'); $this->assertNoField('settings[entity_test][entity_test][translatable]'); } diff --git a/core/modules/content_translation/src/Tests/ContentTranslationSyncImageTest.php b/core/modules/content_translation/src/Tests/ContentTranslationSyncImageTest.php index 10b3c5e0b63ca86572cce47e5c4b2fd361c67609..30ff32de5224908e1bb4f4f73f656f17366c4f7c 100644 --- a/core/modules/content_translation/src/Tests/ContentTranslationSyncImageTest.php +++ b/core/modules/content_translation/src/Tests/ContentTranslationSyncImageTest.php @@ -82,7 +82,7 @@ protected function getEditorPermissions() { /** * Tests image field field synchronization. */ - function testImageFieldSync() { + public function testImageFieldSync() { // Check that the alt and title fields are enabled for the image field. $this->drupalLogin($this->editor); $this->drupalGet('entity_test_mul/structure/' . $this->entityTypeId . '/fields/' . $this->entityTypeId . '.' . $this->entityTypeId . '.' . $this->fieldName); diff --git a/core/modules/content_translation/src/Tests/ContentTranslationUITestBase.php b/core/modules/content_translation/src/Tests/ContentTranslationUITestBase.php index c6d1a5d4453a8b15c70e2bb5b4cabf90fba4d8d2..e7a7dfc9ddff08e88c4ae368433898457fa889d4 100644 --- a/core/modules/content_translation/src/Tests/ContentTranslationUITestBase.php +++ b/core/modules/content_translation/src/Tests/ContentTranslationUITestBase.php @@ -56,7 +56,7 @@ abstract class ContentTranslationUITestBase extends ContentTranslationTestBase { /** * Tests the basic translation UI. */ - function testTranslationUI() { + public function testTranslationUI() { $this->doTestBasicTranslation(); $this->doTestTranslationOverview(); $this->doTestOutdatedStatus(); diff --git a/core/modules/content_translation/src/Tests/ContentTranslationWorkflowsTest.php b/core/modules/content_translation/src/Tests/ContentTranslationWorkflowsTest.php index ac26a39abb5facab0bcc358c997fa7f60db0c42a..66469ebb4f1f3c9c79af3e237cb6f1636d0ef234 100644 --- a/core/modules/content_translation/src/Tests/ContentTranslationWorkflowsTest.php +++ b/core/modules/content_translation/src/Tests/ContentTranslationWorkflowsTest.php @@ -79,7 +79,7 @@ protected function setupEntity() { /** * Test simple and editorial translation workflows. */ - function testWorkflows() { + public function testWorkflows() { // Test workflows for the editor. $expected_status = [ 'edit' => 200, diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationUISkipTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationUISkipTest.php index 02755e001a003b93c43761cc3dab1ddbb9a210c6..77c176e78e884e07c09931f34cae357ad0831dbf 100644 --- a/core/modules/content_translation/tests/src/Functional/ContentTranslationUISkipTest.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationUISkipTest.php @@ -21,7 +21,7 @@ class ContentTranslationUISkipTest extends BrowserTestBase { /** * Tests the content_translation_ui_skip key functionality. */ - function testUICheckSkip() { + public function testUICheckSkip() { $admin_user = $this->drupalCreateUser([ 'translate any entity', 'administer content translation', diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php index accc3ca8c239ef23db2ad2db845e7d20123d2ed7..370a6ed409ebca8bfd47c4a7728554e00c23030e 100644 --- a/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php @@ -53,7 +53,7 @@ abstract class ContentTranslationUITestBase extends ContentTranslationTestBase { /** * Tests the basic translation UI. */ - function testTranslationUI() { + public function testTranslationUI() { $this->doTestBasicTranslation(); $this->doTestTranslationOverview(); $this->doTestOutdatedStatus(); diff --git a/core/modules/content_translation/tests/src/Kernel/ContentTranslationConfigImportTest.php b/core/modules/content_translation/tests/src/Kernel/ContentTranslationConfigImportTest.php index 732d74be289cfa6d543502cbf37aea0bb1acc480..b8776a26a1b1733909f35bc324cc8456de65ca78 100644 --- a/core/modules/content_translation/tests/src/Kernel/ContentTranslationConfigImportTest.php +++ b/core/modules/content_translation/tests/src/Kernel/ContentTranslationConfigImportTest.php @@ -58,7 +58,7 @@ protected function setUp() { /** * Tests config import updates. */ - function testConfigImportUpdates() { + public function testConfigImportUpdates() { $entity_type_id = 'entity_test_mul'; $config_id = $entity_type_id . '.' . $entity_type_id; $config_name = 'language.content_settings.' . $config_id; diff --git a/core/modules/content_translation/tests/src/Kernel/ContentTranslationSettingsApiTest.php b/core/modules/content_translation/tests/src/Kernel/ContentTranslationSettingsApiTest.php index 9b64ba83d401cf9c4179ece0d862fda885604e2e..3626045fbf3a61d0bd5145f26c1224fb3e618dd8 100644 --- a/core/modules/content_translation/tests/src/Kernel/ContentTranslationSettingsApiTest.php +++ b/core/modules/content_translation/tests/src/Kernel/ContentTranslationSettingsApiTest.php @@ -29,7 +29,7 @@ protected function setUp() { /** * Tests that enabling translation via the API triggers schema updates. */ - function testSettingsApi() { + public function testSettingsApi() { $this->container->get('content_translation.manager')->setEnabled('entity_test_mul', 'entity_test_mul', TRUE); $result = db_field_exists('entity_test_mul_property_data', 'content_translation_source') && diff --git a/core/modules/contextual/src/Tests/ContextualDynamicContextTest.php b/core/modules/contextual/src/Tests/ContextualDynamicContextTest.php index e2c57fc1681447ebbcee22df48700719dd0c52f6..90b73d7006d16f7f555da53578353e0d6dc6cf50 100644 --- a/core/modules/contextual/src/Tests/ContextualDynamicContextTest.php +++ b/core/modules/contextual/src/Tests/ContextualDynamicContextTest.php @@ -64,7 +64,7 @@ protected function setUp() { * Ensures that contextual link placeholders always exist, even if the user is * not allowed to use contextual links. */ - function testDifferentPermissions() { + public function testDifferentPermissions() { $this->drupalLogin($this->editorUser); // Create three nodes in the following order: diff --git a/core/modules/contextual/tests/src/Kernel/ContextualUnitTest.php b/core/modules/contextual/tests/src/Kernel/ContextualUnitTest.php index 1d86da06f091f9a17d3b0ff41a5e523334627940..f42bf20f80d5071a514ddbb6b06980e32b70e1fa 100644 --- a/core/modules/contextual/tests/src/Kernel/ContextualUnitTest.php +++ b/core/modules/contextual/tests/src/Kernel/ContextualUnitTest.php @@ -22,7 +22,7 @@ class ContextualUnitTest extends KernelTestBase { /** * Provides testcases for testContextualLinksToId() and */ - function _contextual_links_id_testcases() { + public function _contextual_links_id_testcases() { // Test branch conditions: // - one group. // - one dynamic path argument. @@ -110,7 +110,7 @@ function _contextual_links_id_testcases() { /** * Tests _contextual_links_to_id(). */ - function testContextualLinksToId() { + public function testContextualLinksToId() { $tests = $this->_contextual_links_id_testcases(); foreach ($tests as $test) { $this->assertIdentical(_contextual_links_to_id($test['links']), $test['id']); @@ -120,7 +120,7 @@ function testContextualLinksToId() { /** * Tests _contextual_id_to_links(). */ - function testContextualIdToLinks() { + public function testContextualIdToLinks() { $tests = $this->_contextual_links_id_testcases(); foreach ($tests as $test) { $this->assertIdentical(_contextual_id_to_links($test['id']), $test['links']); diff --git a/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDatelistWidget.php b/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDatelistWidget.php index d1309767f47e2e459a2a2fc09be4d3b4558fd464..276d92c431911eb27c8f9c10e3e2c4e82eb75e65 100644 --- a/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDatelistWidget.php +++ b/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDatelistWidget.php @@ -88,7 +88,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen /** * {@inheritdoc} */ - function settingsForm(array $form, FormStateInterface $form_state) { + public function settingsForm(array $form, FormStateInterface $form_state) { $element = parent::settingsForm($form, $form_state); $element['date_order'] = [ diff --git a/core/modules/datetime/src/Tests/DateTimeFieldTest.php b/core/modules/datetime/src/Tests/DateTimeFieldTest.php index aeed9bc7a0c242e09c44fd8d3462df2ffe40f319..827c811f56a354ffe1e5f83c81c86139ba2739e7 100644 --- a/core/modules/datetime/src/Tests/DateTimeFieldTest.php +++ b/core/modules/datetime/src/Tests/DateTimeFieldTest.php @@ -36,7 +36,7 @@ protected function getTestFieldType() { /** * Tests date field functionality. */ - function testDateField() { + public function testDateField() { $field_name = $this->fieldStorage->getName(); // Loop through defined timezones to test that date-only fields work at the @@ -205,7 +205,7 @@ function testDateField() { /** * Tests date and time field. */ - function testDatetimeField() { + public function testDatetimeField() { $field_name = $this->fieldStorage->getName(); // Change the field to a datetime field. $this->fieldStorage->setSetting('datetime_type', 'datetime'); @@ -348,7 +348,7 @@ function testDatetimeField() { /** * Tests Date List Widget functionality. */ - function testDatelistWidget() { + public function testDatelistWidget() { $field_name = $this->fieldStorage->getName(); // Ensure field is set to a date only field. @@ -593,7 +593,7 @@ protected function datelistDataProvider() { /** * Test default value functionality. */ - function testDefaultValue() { + public function testDefaultValue() { // Create a test content type. $this->drupalCreateContentType(['type' => 'date_content']); @@ -715,7 +715,7 @@ function testDefaultValue() { /** * Test that invalid values are caught and marked as invalid. */ - function testInvalidField() { + public function testInvalidField() { // Change the field to a datetime field. $this->fieldStorage->setSetting('datetime_type', 'datetime'); $this->fieldStorage->save(); diff --git a/core/modules/dblog/src/Tests/DbLogTest.php b/core/modules/dblog/src/Tests/DbLogTest.php index 878f632b00efda607cd8e980d10a6ac1e9244579..79cc0380541f816e91570bae641e29a60d0bbd9c 100644 --- a/core/modules/dblog/src/Tests/DbLogTest.php +++ b/core/modules/dblog/src/Tests/DbLogTest.php @@ -58,7 +58,7 @@ protected function setUp() { * Database Logging module functionality through both the admin and user * interfaces. */ - function testDbLog() { + public function testDbLog() { // Log in the admin user. $this->drupalLogin($this->adminUser); diff --git a/core/modules/dblog/tests/src/Functional/ConnectionFailureTest.php b/core/modules/dblog/tests/src/Functional/ConnectionFailureTest.php index 44b045782dafbf5164bddb05091348f67d689884..37c855ae2cc8769d2e8bd951d8be32255d76f01a 100644 --- a/core/modules/dblog/tests/src/Functional/ConnectionFailureTest.php +++ b/core/modules/dblog/tests/src/Functional/ConnectionFailureTest.php @@ -17,7 +17,7 @@ class ConnectionFailureTest extends BrowserTestBase { /** * Tests logging of connection failures. */ - function testConnectionFailureLogging() { + public function testConnectionFailureLogging() { $logger = \Drupal::service('logger.factory'); // MySQL errors like "1153 - Got a packet bigger than 'max_allowed_packet' diff --git a/core/modules/editor/src/Element.php b/core/modules/editor/src/Element.php index 901731019be0e8bff051204e5a9e64839f378a7d..9f8ab916141f2cceeeb656a21fc24213cd48a33a 100644 --- a/core/modules/editor/src/Element.php +++ b/core/modules/editor/src/Element.php @@ -32,7 +32,7 @@ public function __construct(PluginManagerInterface $plugin_manager) { /** * Additional #pre_render callback for 'text_format' elements. */ - function preRenderTextFormat(array $element) { + public function preRenderTextFormat(array $element) { // Allow modules to programmatically enforce no client-side editor by // setting the #editor property to FALSE. if (isset($element['#editor']) && !$element['#editor']) { diff --git a/core/modules/editor/src/Plugin/InPlaceEditor/Editor.php b/core/modules/editor/src/Plugin/InPlaceEditor/Editor.php index 27a700bd1e7fdc7e6f3b239aa99d94fef5389449..dab14ef01f5d3dbe9da42d343e2d481162c24c2f 100644 --- a/core/modules/editor/src/Plugin/InPlaceEditor/Editor.php +++ b/core/modules/editor/src/Plugin/InPlaceEditor/Editor.php @@ -43,7 +43,7 @@ public function isCompatible(FieldItemListInterface $items) { /** * {@inheritdoc} */ - function getMetadata(FieldItemListInterface $items) { + public function getMetadata(FieldItemListInterface $items) { $format_id = $items[0]->format; $metadata['format'] = $format_id; $metadata['formatHasTransformations'] = $this->textFormatHasTransformationFilters($format_id); diff --git a/core/modules/editor/src/Tests/EditorSecurityTest.php b/core/modules/editor/src/Tests/EditorSecurityTest.php index 0c29a58d5ba84c7ce31f226f193d7725dba5eecc..d00fe0e684352ba8a356c9ba8964e5749900ae67 100644 --- a/core/modules/editor/src/Tests/EditorSecurityTest.php +++ b/core/modules/editor/src/Tests/EditorSecurityTest.php @@ -222,7 +222,7 @@ protected function setUp() { * * Tests 8 scenarios. Tests only with a text editor that is not XSS-safe. */ - function testInitialSecurity() { + public function testInitialSecurity() { $expected = [ [ 'node_id' => 1, @@ -302,7 +302,7 @@ function testInitialSecurity() { * format and contains a '; @@ -56,7 +56,7 @@ function testSearchLabelXSS() { /** * Tests the failed search text, and various other text on the search page. */ - function testSearchText() { + public function testSearchText() { $this->drupalLogin($this->searchingUser); $this->drupalGet('search/node'); $this->assertText(t('Enter your keywords')); diff --git a/core/modules/search/src/Tests/SearchPreprocessLangcodeTest.php b/core/modules/search/src/Tests/SearchPreprocessLangcodeTest.php index 322ba2288981a02395007dd09fb878338ed731eb..ab264a1a85b89610f9dee92835606dfcdb863d5b 100644 --- a/core/modules/search/src/Tests/SearchPreprocessLangcodeTest.php +++ b/core/modules/search/src/Tests/SearchPreprocessLangcodeTest.php @@ -38,7 +38,7 @@ protected function setUp() { /** * Tests that hook_search_preprocess() returns the correct langcode. */ - function testPreprocessLangcode() { + public function testPreprocessLangcode() { // Create a node. $this->node = $this->drupalCreateNode(['body' => [[]], 'langcode' => 'en']); @@ -63,7 +63,7 @@ function testPreprocessLangcode() { /** * Tests stemming for hook_search_preprocess(). */ - function testPreprocessStemming() { + public function testPreprocessStemming() { // Create a node. $this->node = $this->drupalCreateNode([ 'title' => 'we are testing', diff --git a/core/modules/search/src/Tests/SearchQueryAlterTest.php b/core/modules/search/src/Tests/SearchQueryAlterTest.php index 133b0f3d7ed9007ec987eb0789ea853db9e3f228..66269dd6c4e5c2c9b48b20589d81e0f95b2857c8 100644 --- a/core/modules/search/src/Tests/SearchQueryAlterTest.php +++ b/core/modules/search/src/Tests/SearchQueryAlterTest.php @@ -18,7 +18,7 @@ class SearchQueryAlterTest extends SearchTestBase { /** * Tests that the query alter works. */ - function testQueryAlter() { + public function testQueryAlter() { // Log in with sufficient privileges. $this->drupalLogin($this->drupalCreateUser(['create page content', 'search content'])); diff --git a/core/modules/search/src/ViewsSearchQuery.php b/core/modules/search/src/ViewsSearchQuery.php index e61a7e0a1c6229f5f05520ffd05194efb8b4faa1..ca804a889bd15171206abd70e06b304b2b2bf4f1 100644 --- a/core/modules/search/src/ViewsSearchQuery.php +++ b/core/modules/search/src/ViewsSearchQuery.php @@ -69,7 +69,7 @@ public function publicParseSearchExpression() { * item from a \Drupal\Core\Database\Query\Condition::conditions array, * which must have a 'field' element. */ - function conditionReplaceString($search, $replace, &$condition) { + public function conditionReplaceString($search, $replace, &$condition) { if ($condition['field'] instanceof Condition) { $conditions =& $condition['field']->conditions(); foreach ($conditions as $key => &$subcondition) { diff --git a/core/modules/search/tests/src/Functional/SearchCommentCountToggleTest.php b/core/modules/search/tests/src/Functional/SearchCommentCountToggleTest.php index 14ae5572e466cc72353e2243326f4f2c44dd074c..7cd9f8562d983691ce35c13cfa01a366fd39beae 100644 --- a/core/modules/search/tests/src/Functional/SearchCommentCountToggleTest.php +++ b/core/modules/search/tests/src/Functional/SearchCommentCountToggleTest.php @@ -79,7 +79,7 @@ protected function setUp() { /** * Verify that comment count display toggles properly on comment status of node */ - function testSearchCommentCountToggle() { + public function testSearchCommentCountToggle() { // Search for the nodes by string in the node body. $edit = [ 'keys' => "'SearchCommentToggleTestCase'", diff --git a/core/modules/search/tests/src/Functional/SearchExactTest.php b/core/modules/search/tests/src/Functional/SearchExactTest.php index ca876ae2926dfe6bd806c408053dd82271748c14..04163918e540131599e5d6569c451dfc8cf69592 100644 --- a/core/modules/search/tests/src/Functional/SearchExactTest.php +++ b/core/modules/search/tests/src/Functional/SearchExactTest.php @@ -11,7 +11,7 @@ class SearchExactTest extends SearchTestBase { /** * Tests that the correct number of pager links are found for both keywords and phrases. */ - function testExactQuery() { + public function testExactQuery() { // Log in with sufficient privileges. $user = $this->drupalCreateUser(['create page content', 'search content']); $this->drupalLogin($user); diff --git a/core/modules/search/tests/src/Functional/SearchKeywordsConditionsTest.php b/core/modules/search/tests/src/Functional/SearchKeywordsConditionsTest.php index 287596ab3e354063e94b892f135a316010b2bc6a..26bff66bdffbca044349b7240161cfabd745fbe3 100644 --- a/core/modules/search/tests/src/Functional/SearchKeywordsConditionsTest.php +++ b/core/modules/search/tests/src/Functional/SearchKeywordsConditionsTest.php @@ -41,7 +41,7 @@ protected function setUp() { /** * Verify the keywords are captured and conditions respected. */ - function testSearchKeywordsConditions() { + public function testSearchKeywordsConditions() { // No keys, not conditions - no results. $this->drupalGet('search/dummy_path'); $this->assertNoText('Dummy search snippet to display'); diff --git a/core/modules/search/tests/src/Functional/SearchMultilingualEntityTest.php b/core/modules/search/tests/src/Functional/SearchMultilingualEntityTest.php index 717ffc51957c13da3532c8ec0206b8c1a7b5d842..3dfc1179c0d388b9f7e20ce169336d6517f772d2 100644 --- a/core/modules/search/tests/src/Functional/SearchMultilingualEntityTest.php +++ b/core/modules/search/tests/src/Functional/SearchMultilingualEntityTest.php @@ -114,7 +114,7 @@ protected function setUp() { /** * Tests the indexing throttle and search results with multilingual nodes. */ - function testMultilingualSearch() { + public function testMultilingualSearch() { // Index only 2 nodes per cron run. We cannot do this setting in the UI, // because it doesn't go this low. $this->config('search.settings')->set('index.cron_limit', 2)->save(); diff --git a/core/modules/search/tests/src/Functional/SearchNodeDiacriticsTest.php b/core/modules/search/tests/src/Functional/SearchNodeDiacriticsTest.php index 32aa102de697fdc66369fedcb50461ef8e011d8a..848e35762c4487dab476b380be41862cd9ac3912 100644 --- a/core/modules/search/tests/src/Functional/SearchNodeDiacriticsTest.php +++ b/core/modules/search/tests/src/Functional/SearchNodeDiacriticsTest.php @@ -28,7 +28,7 @@ protected function setUp() { /** * Tests that search returns results with diacritics in the search phrase. */ - function testPhraseSearchPunctuation() { + public function testPhraseSearchPunctuation() { $body_text = 'The Enricþment Center is cómmīŦŧęđ to the well BɆĬŇĜ of æll påŔťıçȉpǎǹţș. '; $body_text .= 'Also meklēt (see #731298)'; $this->drupalCreateNode(['body' => [['value' => $body_text]]]); diff --git a/core/modules/search/tests/src/Functional/SearchNodePunctuationTest.php b/core/modules/search/tests/src/Functional/SearchNodePunctuationTest.php index 8c8958cea85984f759e916e90931d18bcbea9b67..59354460edc4919478feeccd197c49d286144ec4 100644 --- a/core/modules/search/tests/src/Functional/SearchNodePunctuationTest.php +++ b/core/modules/search/tests/src/Functional/SearchNodePunctuationTest.php @@ -28,7 +28,7 @@ protected function setUp() { /** * Tests that search works with punctuation and HTML entities. */ - function testPhraseSearchPunctuation() { + public function testPhraseSearchPunctuation() { $node = $this->drupalCreateNode(['body' => [['value' => "The bunny's ears were fluffy."]]]); $node2 = $this->drupalCreateNode(['body' => [['value' => 'Dignissim Aliquam & Quieligo meus natu quae quia te. Damnum© erat— neo pneum. Facilisi feugiat ibidem ratis.']]]); diff --git a/core/modules/search/tests/src/Functional/SearchPageOverrideTest.php b/core/modules/search/tests/src/Functional/SearchPageOverrideTest.php index fe6e9805e70a40c4ed37597bc146ae3cc21e35b7..4dfca49d187ab222c8c702a6e37463df19220ad8 100644 --- a/core/modules/search/tests/src/Functional/SearchPageOverrideTest.php +++ b/core/modules/search/tests/src/Functional/SearchPageOverrideTest.php @@ -34,7 +34,7 @@ protected function setUp() { $this->drupalLogin($this->searchUser); } - function testSearchPageHook() { + public function testSearchPageHook() { $keys = 'bike shed ' . $this->randomMachineName(); $this->drupalGet("search/dummy_path", ['query' => ['keys' => $keys]]); $this->assertText('Dummy search snippet', 'Dummy search snippet is shown'); diff --git a/core/modules/search/tests/src/Functional/SearchSimplifyTest.php b/core/modules/search/tests/src/Functional/SearchSimplifyTest.php index a70b65e4d3313ba583d4926bd50d618c482abe97..bd3bbb43d6a1cbfd4fdc9e23a72a11232a83fee5 100644 --- a/core/modules/search/tests/src/Functional/SearchSimplifyTest.php +++ b/core/modules/search/tests/src/Functional/SearchSimplifyTest.php @@ -12,7 +12,7 @@ class SearchSimplifyTest extends SearchTestBase { /** * Tests that all Unicode characters simplify correctly. */ - function testSearchSimplifyUnicode() { + public function testSearchSimplifyUnicode() { // This test uses a file that was constructed so that the even lines are // boundary characters, and the odd lines are valid word characters. (It // was generated as a sequence of all the Unicode characters, and then the @@ -64,7 +64,7 @@ function testSearchSimplifyUnicode() { /** * Tests that search_simplify() does the right thing with punctuation. */ - function testSearchSimplifyPunctuation() { + public function testSearchSimplifyPunctuation() { $cases = [ ['20.03/94-28,876', '20039428876', 'Punctuation removed from numbers'], ['great...drupal--module', 'great drupal module', 'Multiple dot and dashes are word boundaries'], diff --git a/core/modules/search/tests/src/Functional/SearchTokenizerTest.php b/core/modules/search/tests/src/Functional/SearchTokenizerTest.php index 03667bc77b43e400a441b9faa66ba4fb6919c057..7215312d01797ca774a0cf8d8002693d2482cdb0 100644 --- a/core/modules/search/tests/src/Functional/SearchTokenizerTest.php +++ b/core/modules/search/tests/src/Functional/SearchTokenizerTest.php @@ -18,7 +18,7 @@ class SearchTokenizerTest extends SearchTestBase { * character classes are tokenized properly. See PREG_CLASS_CKJ for more * information. */ - function testTokenizer() { + public function testTokenizer() { // Set the minimum word size to 1 (to split all CJK characters) and make // sure CJK tokenizing is turned on. $this->config('search.settings') @@ -106,7 +106,7 @@ function testTokenizer() { * This is just a sanity check - it verifies that strings of letters are * not tokenized. */ - function testNoTokenizer() { + public function testNoTokenizer() { // Set the minimum word size to 1 (to split all CJK characters) and make // sure CJK tokenizing is turned on. $this->config('search.settings') @@ -128,7 +128,7 @@ function testNoTokenizer() { * converts a number to the corresponding unicode character. Adapted from * functions supplied in comments on several functions on php.net. */ - function code2utf($num) { + public function code2utf($num) { if ($num < 128) { return chr($num); } diff --git a/core/modules/search/tests/src/Kernel/SearchExcerptTest.php b/core/modules/search/tests/src/Kernel/SearchExcerptTest.php index 02844b01114bdbf553772c5f7bb82d21fc234c04..e10075d09ae15bc94ab34901725febed1dd09a80 100644 --- a/core/modules/search/tests/src/Kernel/SearchExcerptTest.php +++ b/core/modules/search/tests/src/Kernel/SearchExcerptTest.php @@ -27,7 +27,7 @@ class SearchExcerptTest extends KernelTestBase { * contains either highlighted keywords or the original marked * up string if no keywords matched the string. */ - function testSearchExcerpt() { + public function testSearchExcerpt() { // Make some text with entities and tags. $text = 'The quick brown fox & jumps

over

the lazy dog'; $expected = 'The quick brown fox & jumps over the lazy dog'; @@ -74,7 +74,7 @@ function testSearchExcerpt() { * search_simplify(). This test passes keywords that match simplified words * and compares them with strings that contain the original unsimplified word. */ - function testSearchExcerptSimplified() { + public function testSearchExcerptSimplified() { $start_time = microtime(TRUE); $lorem1 = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam vitae arcu at leo cursus laoreet. Curabitur dui tortor, adipiscing malesuada tempor in, bibendum ac diam. Cras non tellus a libero pellentesque condimentum. What is a Drupalism? Suspendisse ac lacus libero. Ut non est vel nisl faucibus interdum nec sed leo. Pellentesque sem risus, vulputate eu semper eget, auctor in libero.'; diff --git a/core/modules/search/tests/src/Kernel/SearchMatchTest.php b/core/modules/search/tests/src/Kernel/SearchMatchTest.php index 13c926765e888205fd2913f0bf24be39ec3e6c7f..7037646bc8636f52121b149665cdebccfbc05c16 100644 --- a/core/modules/search/tests/src/Kernel/SearchMatchTest.php +++ b/core/modules/search/tests/src/Kernel/SearchMatchTest.php @@ -37,7 +37,7 @@ protected function setUp() { /** * Test search indexing. */ - function testMatching() { + public function testMatching() { $this->_setup(); $this->_testQueries(); } @@ -45,7 +45,7 @@ function testMatching() { /** * Set up a small index of items to test against. */ - function _setup() { + public function _setup() { $this->config('search.settings')->set('index.minimum_word_size', 3)->save(); for ($i = 1; $i <= 7; ++$i) { @@ -77,7 +77,7 @@ function _setup() { * 6 enim am minim veniam es cillum * 7 am minim veniam es cillum dolore eu */ - function getText($n) { + public function getText($n) { $words = explode(' ', "Ipsum dolore sit am. Ut enim am minim veniam. Es cillum dolore eu."); return implode(' ', array_slice($words, $n - 1, $n)); } @@ -92,7 +92,7 @@ function getText($n) { * 11 came over from germany * 12 over from germany swimming */ - function getText2($n) { + public function getText2($n) { $words = explode(' ', "Dear King Philip came over from Germany swimming."); return implode(' ', array_slice($words, $n - 1, $n)); } @@ -100,7 +100,7 @@ function getText2($n) { /** * Run predefine queries looking for indexed terms. */ - function _testQueries() { + public function _testQueries() { // Note: OR queries that include short words in OR groups are only accepted // if the ORed terms are ANDed with at least one long word in the rest of // the query. Examples: @@ -218,7 +218,7 @@ function _testQueries() { * * Verify if a query produces the correct results. */ - function _testQueryMatching($query, $set, $results) { + public function _testQueryMatching($query, $set, $results) { // Get result IDs. $found = []; foreach ($set as $item) { @@ -236,7 +236,7 @@ function _testQueryMatching($query, $set, $results) { * * Verify if a query produces normalized, monotonous scores. */ - function _testQueryScores($query, $set, $results) { + public function _testQueryScores($query, $set, $results) { // Get result scores. $scores = []; foreach ($set as $item) { diff --git a/core/modules/serialization/tests/src/Kernel/EntityResolverTest.php b/core/modules/serialization/tests/src/Kernel/EntityResolverTest.php index a470d98a74004a167d107d1e67f195b15814d1ea..38af46e9949712efe273f1b514ab4a6be48e8a89 100644 --- a/core/modules/serialization/tests/src/Kernel/EntityResolverTest.php +++ b/core/modules/serialization/tests/src/Kernel/EntityResolverTest.php @@ -54,7 +54,7 @@ protected function setUp() { /** * Test that fields referencing UUIDs can be denormalized. */ - function testUuidEntityResolver() { + public function testUuidEntityResolver() { // Create an entity to get the UUID from. $entity = EntityTestMulRev::create(['type' => 'entity_test_mulrev']); $entity->set('name', 'foobar'); diff --git a/core/modules/shortcut/src/Tests/ShortcutSetsTest.php b/core/modules/shortcut/src/Tests/ShortcutSetsTest.php index e4c7fb77a165dca446fb146dc3bd2bb0d1b85e05..e34518e0ae0100e693ff2b79b5de0f0c1c5a6440 100644 --- a/core/modules/shortcut/src/Tests/ShortcutSetsTest.php +++ b/core/modules/shortcut/src/Tests/ShortcutSetsTest.php @@ -30,7 +30,7 @@ protected function setUp() { /** * Tests creating a shortcut set. */ - function testShortcutSetAdd() { + public function testShortcutSetAdd() { $this->drupalGet('admin/config/user-interface/shortcut'); $this->clickLink(t('Add shortcut set')); $edit = [ @@ -47,7 +47,7 @@ function testShortcutSetAdd() { /** * Tests editing a shortcut set. */ - function testShortcutSetEdit() { + public function testShortcutSetEdit() { $set = $this->set; $shortcuts = $set->getShortcuts(); @@ -100,7 +100,7 @@ function testShortcutSetEdit() { /** * Tests switching a user's own shortcut set. */ - function testShortcutSetSwitchOwn() { + public function testShortcutSetSwitchOwn() { $new_set = $this->generateShortcutSet($this->randomMachineName()); // Attempt to switch the default shortcut set to the newly created shortcut @@ -114,7 +114,7 @@ function testShortcutSetSwitchOwn() { /** * Tests switching another user's shortcut set. */ - function testShortcutSetAssign() { + public function testShortcutSetAssign() { $new_set = $this->generateShortcutSet($this->randomMachineName()); \Drupal::entityManager()->getStorage('shortcut_set')->assignUser($new_set, $this->shortcutUser); @@ -125,7 +125,7 @@ function testShortcutSetAssign() { /** * Tests switching a user's shortcut set and creating one at the same time. */ - function testShortcutSetSwitchCreate() { + public function testShortcutSetSwitchCreate() { $edit = [ 'set' => 'new', 'id' => strtolower($this->randomMachineName()), @@ -140,7 +140,7 @@ function testShortcutSetSwitchCreate() { /** * Tests switching a user's shortcut set without providing a new set name. */ - function testShortcutSetSwitchNoSetName() { + public function testShortcutSetSwitchNoSetName() { $edit = ['set' => 'new']; $this->drupalPostForm('user/' . $this->adminUser->id() . '/shortcuts', $edit, t('Change set')); $this->assertText(t('The new set label is required.')); @@ -152,7 +152,7 @@ function testShortcutSetSwitchNoSetName() { /** * Tests renaming a shortcut set. */ - function testShortcutSetRename() { + public function testShortcutSetRename() { $set = $this->set; $new_label = $this->randomMachineName(); @@ -166,7 +166,7 @@ function testShortcutSetRename() { /** * Tests unassigning a shortcut set. */ - function testShortcutSetUnassign() { + public function testShortcutSetUnassign() { $new_set = $this->generateShortcutSet($this->randomMachineName()); $shortcut_set_storage = \Drupal::entityManager()->getStorage('shortcut_set'); @@ -180,7 +180,7 @@ function testShortcutSetUnassign() { /** * Tests deleting a shortcut set. */ - function testShortcutSetDelete() { + public function testShortcutSetDelete() { $new_set = $this->generateShortcutSet($this->randomMachineName()); $this->drupalPostForm('admin/config/user-interface/shortcut/manage/' . $new_set->id() . '/delete', [], t('Delete')); @@ -191,7 +191,7 @@ function testShortcutSetDelete() { /** * Tests deleting the default shortcut set. */ - function testShortcutSetDeleteDefault() { + public function testShortcutSetDeleteDefault() { $this->drupalGet('admin/config/user-interface/shortcut/manage/default/delete'); $this->assertResponse(403); } @@ -199,7 +199,7 @@ function testShortcutSetDeleteDefault() { /** * Tests creating a new shortcut set with a defined set name. */ - function testShortcutSetCreateWithSetName() { + public function testShortcutSetCreateWithSetName() { $random_name = $this->randomMachineName(); $new_set = $this->generateShortcutSet($random_name, $random_name); $sets = ShortcutSet::loadMultiple(); diff --git a/core/modules/shortcut/src/Tests/ShortcutTestBase.php b/core/modules/shortcut/src/Tests/ShortcutTestBase.php index 7fd5a4535d9b519bfb4acb3cc255b7ebb7ba05ad..1e3196ceb4d1fe113606082e5fb37e8b715d5d92 100644 --- a/core/modules/shortcut/src/Tests/ShortcutTestBase.php +++ b/core/modules/shortcut/src/Tests/ShortcutTestBase.php @@ -93,7 +93,7 @@ protected function setUp() { /** * Creates a generic shortcut set. */ - function generateShortcutSet($label = '', $id = NULL) { + public function generateShortcutSet($label = '', $id = NULL) { $set = ShortcutSet::create([ 'id' => isset($id) ? $id : strtolower($this->randomMachineName()), 'label' => empty($label) ? $this->randomString() : $label, @@ -116,7 +116,7 @@ function generateShortcutSet($label = '', $id = NULL) { * @return array * Array of the requested information from each link. */ - function getShortcutInformation(ShortcutSetInterface $set, $key) { + public function getShortcutInformation(ShortcutSetInterface $set, $key) { $info = []; \Drupal::entityManager()->getStorage('shortcut')->resetCache(); foreach ($set->getShortcuts() as $shortcut) { diff --git a/core/modules/simpletest/src/KernelTestBase.php b/core/modules/simpletest/src/KernelTestBase.php index 9b7495af29a78cf33a04b720f8c54e60b5076165..8c92ec7dad4b12cb1687a3ef767c96ba72565cbf 100644 --- a/core/modules/simpletest/src/KernelTestBase.php +++ b/core/modules/simpletest/src/KernelTestBase.php @@ -90,7 +90,7 @@ abstract class KernelTestBase extends TestBase { /** * {@inheritdoc} */ - function __construct($test_id = NULL) { + public function __construct($test_id = NULL) { parent::__construct($test_id); $this->skipClasses[__CLASS__] = TRUE; } diff --git a/core/modules/simpletest/src/NodeCreationTrait.php b/core/modules/simpletest/src/NodeCreationTrait.php index 86321a2b99acbbc4bc91f0df3c3d3e6fb2316322..20dc3f8379d80ca13c7363292d291ababaacb41f 100644 --- a/core/modules/simpletest/src/NodeCreationTrait.php +++ b/core/modules/simpletest/src/NodeCreationTrait.php @@ -22,7 +22,7 @@ trait NodeCreationTrait { * @return \Drupal\node\NodeInterface * A node entity matching $title. */ - function getNodeByTitle($title, $reset = FALSE) { + public function getNodeByTitle($title, $reset = FALSE) { if ($reset) { \Drupal::entityTypeManager()->getStorage('node')->resetCache(); } diff --git a/core/modules/simpletest/src/TestServiceProvider.php b/core/modules/simpletest/src/TestServiceProvider.php index 817b68e5420064ba8f55e1756df35c7fffcbcc27..de3117fd2aab751df451221d9873d15b0f23300b 100644 --- a/core/modules/simpletest/src/TestServiceProvider.php +++ b/core/modules/simpletest/src/TestServiceProvider.php @@ -17,7 +17,7 @@ class TestServiceProvider implements ServiceProviderInterface, ServiceModifierIn /** * {@inheritdoc} */ - function register(ContainerBuilder $container) { + public function register(ContainerBuilder $container) { if (static::$currentTest && method_exists(static::$currentTest, 'containerBuild')) { static::$currentTest->containerBuild($container); } diff --git a/core/modules/simpletest/src/Tests/BrokenSetUpTest.php b/core/modules/simpletest/src/Tests/BrokenSetUpTest.php index 673d5b9a8a0a022ce639c2dc9123667cdf573005..febb9cfda75c82dc57af55a02f964ebae8e2b792 100644 --- a/core/modules/simpletest/src/Tests/BrokenSetUpTest.php +++ b/core/modules/simpletest/src/Tests/BrokenSetUpTest.php @@ -71,7 +71,7 @@ protected function tearDown() { /** * Runs this test case from within the simpletest child site. */ - function testMethod() { + public function testMethod() { // If the test is being run from the main site, run it again from the web // interface within the simpletest child site. if (!$this->isInChildSite()) { diff --git a/core/modules/simpletest/src/Tests/BrowserTest.php b/core/modules/simpletest/src/Tests/BrowserTest.php index be9e006978ed264ec6df80ed5a5bf86a8a9b408b..fdfaff851d8fb036b1416897aa0d5ef5fe515e3b 100644 --- a/core/modules/simpletest/src/Tests/BrowserTest.php +++ b/core/modules/simpletest/src/Tests/BrowserTest.php @@ -37,7 +37,7 @@ protected function setUp() { /** * Test \Drupal\simpletest\WebTestBase::getAbsoluteUrl(). */ - function testGetAbsoluteUrl() { + public function testGetAbsoluteUrl() { $url = 'user/login'; $this->drupalGet($url); @@ -58,7 +58,7 @@ function testGetAbsoluteUrl() { /** * Tests XPath escaping. */ - function testXPathEscaping() { + public function testXPathEscaping() { $testpage = <<< EOF diff --git a/core/modules/simpletest/src/Tests/InstallationProfileModuleTestsTest.php b/core/modules/simpletest/src/Tests/InstallationProfileModuleTestsTest.php index a4365f810e6a21ccfef890a83e68376844d3409c..379aed4499026af41190d6bea62e6d9933ab1148 100644 --- a/core/modules/simpletest/src/Tests/InstallationProfileModuleTestsTest.php +++ b/core/modules/simpletest/src/Tests/InstallationProfileModuleTestsTest.php @@ -49,7 +49,7 @@ protected function setUp() { /** * Tests existence of test case located in an installation profile module. */ - function testInstallationProfileTests() { + public function testInstallationProfileTests() { $this->drupalGet('admin/config/development/testing'); $this->assertText('Drupal\drupal_system_listing_compatible_test\Tests\SystemListingCompatibleTest'); $edit = [ diff --git a/core/modules/simpletest/src/Tests/KernelTestBaseTest.php b/core/modules/simpletest/src/Tests/KernelTestBaseTest.php index 2ed63b3af40082ebfa03d18d64c6db3783501a1c..1e9e75da0b91a47ee38527c75aa50d86fca4b092 100644 --- a/core/modules/simpletest/src/Tests/KernelTestBaseTest.php +++ b/core/modules/simpletest/src/Tests/KernelTestBaseTest.php @@ -50,7 +50,7 @@ function simpletest_test_stub_settings_function() {} /** * Tests expected behavior of setUp(). */ - function testSetUp() { + public function testSetUp() { $modules = ['entity_test']; $table = 'entity_test'; @@ -79,7 +79,7 @@ function testSetUp() { /** * Tests expected load behavior of enableModules(). */ - function testEnableModulesLoad() { + public function testEnableModulesLoad() { $module = 'field_test'; // Verify that the module does not exist yet. @@ -103,7 +103,7 @@ function testEnableModulesLoad() { /** * Tests expected installation behavior of enableModules(). */ - function testEnableModulesInstall() { + public function testEnableModulesInstall() { $module = 'module_test'; $table = 'module_test'; @@ -134,7 +134,7 @@ function testEnableModulesInstall() { /** * Tests installing modules with DependencyInjection services. */ - function testEnableModulesInstallContainer() { + public function testEnableModulesInstallContainer() { // Install Node module. $this->enableModules(['user', 'field', 'node']); @@ -151,7 +151,7 @@ function testEnableModulesInstallContainer() { /** * Tests expected behavior of installSchema(). */ - function testInstallSchema() { + public function testInstallSchema() { $module = 'entity_test'; $table = 'entity_test_example'; // Verify that we can install a table from the module schema. @@ -200,7 +200,7 @@ function testInstallSchema() { /** * Tests expected behavior of installEntitySchema(). */ - function testInstallEntitySchema() { + public function testInstallEntitySchema() { $entity = 'entity_test'; // The entity_test Entity has a field that depends on the User module. $this->enableModules(['user']); @@ -212,7 +212,7 @@ function testInstallEntitySchema() { /** * Tests expected behavior of installConfig(). */ - function testInstallConfig() { + public function testInstallConfig() { // The user module has configuration that depends on system. $this->enableModules(['system']); $module = 'user'; @@ -237,7 +237,7 @@ function testInstallConfig() { /** * Tests that the module list is retained after enabling/installing/disabling. */ - function testEnableModulesFixedList() { + public function testEnableModulesFixedList() { // Install system module. $this->container->get('module_installer')->install(['system', 'menu_link_content']); $entity_manager = \Drupal::entityManager(); @@ -290,7 +290,7 @@ function testEnableModulesFixedList() { /** * Tests that ThemeManager works right after loading a module. */ - function testEnableModulesTheme() { + public function testEnableModulesTheme() { /** @var \Drupal\Core\Render\RendererInterface $renderer */ $renderer = $this->container->get('renderer'); $original_element = $element = [ @@ -311,7 +311,7 @@ function testEnableModulesTheme() { /** * Tests that there is no theme by default. */ - function testNoThemeByDefault() { + public function testNoThemeByDefault() { $themes = $this->config('core.extension')->get('theme'); $this->assertEqual($themes, []); diff --git a/core/modules/simpletest/src/Tests/SimpleTestTest.php b/core/modules/simpletest/src/Tests/SimpleTestTest.php index d1f2a20cfda657f1b4221d813bb728b2d56e7bd8..a32c1423692bd3d7eae973aa441a8b23d0238e8e 100644 --- a/core/modules/simpletest/src/Tests/SimpleTestTest.php +++ b/core/modules/simpletest/src/Tests/SimpleTestTest.php @@ -110,7 +110,7 @@ class: Drupal\Core\Cache\MemoryBackendFactory /** * Ensures the tests selected through the web interface are run and displayed. */ - function testWebTestRunner() { + public function testWebTestRunner() { $this->passMessage = t('SimpleTest pass.'); $this->failMessage = t('SimpleTest fail.'); $this->validPermission = 'access administration pages'; @@ -148,7 +148,7 @@ function testWebTestRunner() { * Here we force test results which must match the expected results from * confirmStubResults(). */ - function stubTest() { + public function stubTest() { // Ensure the .htkey file exists since this is only created just before a // request. This allows the stub test to make requests. The event does not // fire here and drupal_generate_test_ua() can not generate a key for a @@ -232,14 +232,14 @@ function stubTest() { /** * Assert nothing. */ - function assertNothing() { + public function assertNothing() { $this->pass("This is nothing."); } /** * Confirm that the stub test produced the desired results. */ - function confirmStubTestResults() { + public function confirmStubTestResults() { $this->assertAssertion(t('Unable to install modules %modules due to missing modules %missing.', ['%modules' => 'non_existent_module', '%missing' => 'non_existent_module']), 'Other', 'Fail', 'SimpleTestTest.php', 'Drupal\simpletest\Tests\SimpleTestTest->setUp()'); $this->assertAssertion($this->passMessage, 'Other', 'Pass', 'SimpleTestTest.php', 'Drupal\simpletest\Tests\SimpleTestTest->stubTest()'); @@ -274,7 +274,7 @@ function confirmStubTestResults() { /** * Fetch the test id from the test results. */ - function getTestIdFromResults() { + public function getTestIdFromResults() { foreach ($this->childTestResults['assertions'] as $assertion) { if (preg_match('@^Test ID is ([0-9]*)\.$@', $assertion['message'], $matches)) { return $matches[1]; @@ -299,7 +299,7 @@ function getTestIdFromResults() { * * @return Assertion result. */ - function assertAssertion($message, $type, $status, $file, $function) { + public function assertAssertion($message, $type, $status, $file, $function) { $message = trim(strip_tags($message)); $found = FALSE; foreach ($this->childTestResults['assertions'] as $assertion) { @@ -318,7 +318,7 @@ function assertAssertion($message, $type, $status, $file, $function) { /** * Get the results from a test and store them in the class array $results. */ - function getTestResults() { + public function getTestResults() { $results = []; if ($this->parse()) { if ($details = $this->getResultFieldSet()) { @@ -347,7 +347,7 @@ function getTestResults() { /** * Get the details containing the results for group this test is in. */ - function getResultFieldSet() { + public function getResultFieldSet() { $all_details = $this->xpath('//details'); foreach ($all_details as $details) { if ($this->asText($details->summary) == __CLASS__) { @@ -366,7 +366,7 @@ function getResultFieldSet() { * @return * Extracted text. */ - function asText(\SimpleXMLElement $element) { + public function asText(\SimpleXMLElement $element) { if (!is_object($element)) { return $this->fail('The element is not an element.'); } diff --git a/core/modules/simpletest/src/Tests/TimeZoneTest.php b/core/modules/simpletest/src/Tests/TimeZoneTest.php index 2f33eaa42d64a8ba025fc125a39329d7b2568785..9a98c790205645ce2df7c755349f04c6e65ca50f 100644 --- a/core/modules/simpletest/src/Tests/TimeZoneTest.php +++ b/core/modules/simpletest/src/Tests/TimeZoneTest.php @@ -28,7 +28,7 @@ protected function setUp() { /** * Tests that user accounts have the default time zone set. */ - function testAccountTimeZones() { + public function testAccountTimeZones() { $expected = 'Australia/Sydney'; $this->assertEqual($this->rootUser->getTimeZone(), $expected, 'Root user has correct time zone.'); $this->assertEqual($this->adminUser->getTimeZone(), $expected, 'Admin user has correct time zone.'); diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php index b1a0258b5718206721901efe0a38856907010754..986410d1979969cbbc9d2a5c7391b004f53d85e8 100644 --- a/core/modules/simpletest/src/WebTestBase.php +++ b/core/modules/simpletest/src/WebTestBase.php @@ -203,7 +203,7 @@ abstract class WebTestBase extends TestBase { /** * Constructor for \Drupal\simpletest\WebTestBase. */ - function __construct($test_id = NULL) { + public function __construct($test_id = NULL) { parent::__construct($test_id); $this->skipClasses[__CLASS__] = TRUE; $this->classLoader = require DRUPAL_ROOT . '/autoload.php'; diff --git a/core/modules/simpletest/tests/src/Functional/FolderTest.php b/core/modules/simpletest/tests/src/Functional/FolderTest.php index 92844d8ed9ff51b0b97bdff925a2106f79ccd2e6..e57813fa71c3956efa44fc626d8640c4d48d6f54 100644 --- a/core/modules/simpletest/tests/src/Functional/FolderTest.php +++ b/core/modules/simpletest/tests/src/Functional/FolderTest.php @@ -19,7 +19,7 @@ class FolderTest extends BrowserTestBase { */ public static $modules = ['image']; - function testFolderSetup() { + public function testFolderSetup() { $directory = file_default_scheme() . '://styles'; $this->assertTrue(file_prepare_directory($directory, FALSE), 'Directory created.'); } diff --git a/core/modules/simpletest/tests/src/Functional/MailCaptureTest.php b/core/modules/simpletest/tests/src/Functional/MailCaptureTest.php index 1193e478ed8d9701f1b4ee6ecba7affcf3ba3de2..f610eaf429de0999b232b1349399ce3b166ba431 100644 --- a/core/modules/simpletest/tests/src/Functional/MailCaptureTest.php +++ b/core/modules/simpletest/tests/src/Functional/MailCaptureTest.php @@ -18,7 +18,7 @@ class MailCaptureTest extends BrowserTestBase { /** * Test to see if the wrapper function is executed correctly. */ - function testMailSend() { + public function testMailSend() { // Create an email. $subject = $this->randomString(64); $body = $this->randomString(128); diff --git a/core/modules/simpletest/tests/src/Functional/MissingDependentModuleUnitTest.php b/core/modules/simpletest/tests/src/Functional/MissingDependentModuleUnitTest.php index 885a44c706e2eaa2f4c5b9ff6c5c0a7005856af4..acd55dd0146ef5695b6422d7a09f38c3f7707e39 100644 --- a/core/modules/simpletest/tests/src/Functional/MissingDependentModuleUnitTest.php +++ b/core/modules/simpletest/tests/src/Functional/MissingDependentModuleUnitTest.php @@ -15,7 +15,7 @@ class MissingDependentModuleUnitTest extends BrowserTestBase { /** * Ensure that this test will not be loaded despite its dependency. */ - function testFail() { + public function testFail() { $this->fail('Running test with missing required module.'); } diff --git a/core/modules/simpletest/tests/src/Functional/OtherInstallationProfileTestsTest.php b/core/modules/simpletest/tests/src/Functional/OtherInstallationProfileTestsTest.php index 04736ec0ed28e5174420e90d633ca5b648bc1283..09ec7b4dbc8c0583bcd70ebbcb96e221098c3370 100644 --- a/core/modules/simpletest/tests/src/Functional/OtherInstallationProfileTestsTest.php +++ b/core/modules/simpletest/tests/src/Functional/OtherInstallationProfileTestsTest.php @@ -50,7 +50,7 @@ protected function setUp() { /** * Tests that tests located in another installation profile appear. */ - function testOtherInstallationProfile() { + public function testOtherInstallationProfile() { // Assert the existence of a test in a different installation profile than // the current. $this->drupalGet('admin/config/development/testing'); diff --git a/core/modules/simpletest/tests/src/Functional/UserHelpersTest.php b/core/modules/simpletest/tests/src/Functional/UserHelpersTest.php index ace0e49a28e0bf07ce14e96563656f454906786f..53ea3079f86c543a2c757aa38759a436e952c80f 100644 --- a/core/modules/simpletest/tests/src/Functional/UserHelpersTest.php +++ b/core/modules/simpletest/tests/src/Functional/UserHelpersTest.php @@ -14,7 +14,7 @@ class UserHelpersTest extends BrowserTestBase { /** * Tests WebTestBase::drupalUserIsLoggedIn(). */ - function testDrupalUserIsLoggedIn() { + public function testDrupalUserIsLoggedIn() { $first_user = $this->drupalCreateUser(); $second_user = $this->drupalCreateUser(); diff --git a/core/modules/statistics/src/Tests/StatisticsAdminTest.php b/core/modules/statistics/src/Tests/StatisticsAdminTest.php index 35af86b268762c9ba796de2269fce149ad0b8ea1..3ce0457d43b10fbaf9d51dda224b5bd377d505f9 100644 --- a/core/modules/statistics/src/Tests/StatisticsAdminTest.php +++ b/core/modules/statistics/src/Tests/StatisticsAdminTest.php @@ -58,7 +58,7 @@ protected function setUp() { /** * Verifies that the statistics settings page works. */ - function testStatisticsSettings() { + public function testStatisticsSettings() { $config = $this->config('statistics.settings'); $this->assertFalse($config->get('count_content_views'), 'Count content view log is disabled by default.'); @@ -101,7 +101,7 @@ function testStatisticsSettings() { /** * Tests that when a node is deleted, the node counter is deleted too. */ - function testDeleteNode() { + public function testDeleteNode() { $this->config('statistics.settings')->set('count_content_views', 1)->save(); $this->drupalGet('node/' . $this->testNode->id()); @@ -132,7 +132,7 @@ function testDeleteNode() { /** * Tests that cron clears day counts and expired access logs. */ - function testExpiredLogs() { + public function testExpiredLogs() { $this->config('statistics.settings') ->set('count_content_views', 1) ->save(); diff --git a/core/modules/statistics/src/Tests/StatisticsLoggingTest.php b/core/modules/statistics/src/Tests/StatisticsLoggingTest.php index a7ed5ba0a4050d5b70404c756a58dccc1dc11a4a..152c95ae60dda8467c1bfc428ff6baa3dd25c980 100644 --- a/core/modules/statistics/src/Tests/StatisticsLoggingTest.php +++ b/core/modules/statistics/src/Tests/StatisticsLoggingTest.php @@ -88,7 +88,7 @@ protected function setUp() { /** * Verifies node hit counter logging and script placement. */ - function testLogging() { + public function testLogging() { $path = 'node/' . $this->node->id(); $module_path = drupal_get_path('module', 'statistics'); $stats_path = base_path() . $module_path . '/statistics.php'; diff --git a/core/modules/statistics/src/Tests/StatisticsReportsTest.php b/core/modules/statistics/src/Tests/StatisticsReportsTest.php index 1524623eee23c937bba38d94cdcaae22f7f2f3a4..ea597f40bbfb2301259d7be5834e2ac08b12767b 100644 --- a/core/modules/statistics/src/Tests/StatisticsReportsTest.php +++ b/core/modules/statistics/src/Tests/StatisticsReportsTest.php @@ -17,7 +17,7 @@ class StatisticsReportsTest extends StatisticsTestBase { /** * Tests the "popular content" block. */ - function testPopularContentBlock() { + public function testPopularContentBlock() { // Clear the block cache to load the Statistics module's block definitions. $this->container->get('plugin.manager.block')->clearCachedDefinitions(); diff --git a/core/modules/statistics/tests/src/Functional/StatisticsTokenReplaceTest.php b/core/modules/statistics/tests/src/Functional/StatisticsTokenReplaceTest.php index 8cf95adb4f7c93d4b19283df4dba45c024a7f9b9..8402d221af0e3fcef82240b16744ff441827dce8 100644 --- a/core/modules/statistics/tests/src/Functional/StatisticsTokenReplaceTest.php +++ b/core/modules/statistics/tests/src/Functional/StatisticsTokenReplaceTest.php @@ -12,7 +12,7 @@ class StatisticsTokenReplaceTest extends StatisticsTestBase { /** * Creates a node, then tests the statistics tokens generated from it. */ - function testStatisticsTokenReplacement() { + public function testStatisticsTokenReplacement() { $language_interface = \Drupal::languageManager()->getCurrentLanguage(); // Create user and node. diff --git a/core/modules/syslog/src/Tests/SyslogTest.php b/core/modules/syslog/src/Tests/SyslogTest.php index f4ab7080eeeeaa1e5838ad15db27fb72eac050ad..47ecb3ffc9b21982c8e905de14216bb47d6ad314 100644 --- a/core/modules/syslog/src/Tests/SyslogTest.php +++ b/core/modules/syslog/src/Tests/SyslogTest.php @@ -21,7 +21,7 @@ class SyslogTest extends WebTestBase { /** * Tests the syslog settings page. */ - function testSettings() { + public function testSettings() { $admin_user = $this->drupalCreateUser(['administer site configuration']); $this->drupalLogin($admin_user); diff --git a/core/modules/system/src/Tests/Ajax/AjaxInGroupTest.php b/core/modules/system/src/Tests/Ajax/AjaxInGroupTest.php index cb45e2dcf0b81bd435ac3be8a6309825c3501feb..4116f5f892b3ca8fd15a64a55e23ecb8067130dd 100644 --- a/core/modules/system/src/Tests/Ajax/AjaxInGroupTest.php +++ b/core/modules/system/src/Tests/Ajax/AjaxInGroupTest.php @@ -17,7 +17,7 @@ protected function setUp() { /** * Submits forms with select and checkbox elements via Ajax. */ - function testSimpleAjaxFormValue() { + public function testSimpleAjaxFormValue() { $this->drupalGet('/ajax_forms_test_get_form'); $this->assertText('Test group'); $this->assertText('AJAX checkbox in a group'); diff --git a/core/modules/system/src/Tests/Ajax/CommandsTest.php b/core/modules/system/src/Tests/Ajax/CommandsTest.php index b09d42a0447cc88b103b5aa0bb64741f40431eaa..6970cc30df89537aeef380bdeba6459ffe4c0818 100644 --- a/core/modules/system/src/Tests/Ajax/CommandsTest.php +++ b/core/modules/system/src/Tests/Ajax/CommandsTest.php @@ -32,7 +32,7 @@ class CommandsTest extends AjaxTestBase { /** * Tests the various Ajax Commands. */ - function testAjaxCommands() { + public function testAjaxCommands() { $form_path = 'ajax_forms_test_ajax_commands_form'; $web_user = $this->drupalCreateUser(['access content']); $this->drupalLogin($web_user); diff --git a/core/modules/system/src/Tests/Ajax/ElementValidationTest.php b/core/modules/system/src/Tests/Ajax/ElementValidationTest.php index ceb5405c167d0756483847c88ed095ed76318adb..d20f453be48fd9c65a6285af812d3c41520276db 100644 --- a/core/modules/system/src/Tests/Ajax/ElementValidationTest.php +++ b/core/modules/system/src/Tests/Ajax/ElementValidationTest.php @@ -16,7 +16,7 @@ class ElementValidationTest extends AjaxTestBase { * filled in, and we want to see if the activation of the "drivertext" * Ajax-enabled field fails due to the required field being empty. */ - function testAjaxElementValidation() { + public function testAjaxElementValidation() { $edit = ['drivertext' => t('some dumb text')]; // Post with 'drivertext' as the triggering element. diff --git a/core/modules/system/src/Tests/Ajax/FormValuesTest.php b/core/modules/system/src/Tests/Ajax/FormValuesTest.php index 3d7bc91bced47e2b3585317df692d530779cfbf5..9f4b521752538d4f93b238e9ecbb0dbd141ea31b 100644 --- a/core/modules/system/src/Tests/Ajax/FormValuesTest.php +++ b/core/modules/system/src/Tests/Ajax/FormValuesTest.php @@ -19,7 +19,7 @@ protected function setUp() { /** * Submits forms with select and checkbox elements via Ajax. */ - function testSimpleAjaxFormValue() { + public function testSimpleAjaxFormValue() { // Verify form values of a select element. foreach (['red', 'green', 'blue'] as $item) { $edit = [ diff --git a/core/modules/system/src/Tests/Ajax/MultiFormTest.php b/core/modules/system/src/Tests/Ajax/MultiFormTest.php index 59f60bf5719eaaaf0412f6ec002e169a4d0a8c47..9ca2a667814c6bcee993f16b1fdfac0c1187e3ba 100644 --- a/core/modules/system/src/Tests/Ajax/MultiFormTest.php +++ b/core/modules/system/src/Tests/Ajax/MultiFormTest.php @@ -50,7 +50,7 @@ protected function setUp() { /** * Tests that pages with the 'node_page_form' included twice work correctly. */ - function testMultiForm() { + public function testMultiForm() { // HTML IDs for elements within the field are potentially modified with // each Ajax submission, but these variables are stable and help target the // desired elements. diff --git a/core/modules/system/src/Tests/Batch/PageTest.php b/core/modules/system/src/Tests/Batch/PageTest.php index 0f24c0fd8074ac80a742a38277aa88b54ab6a42f..dbdf18c3d2f13c76903ba2cd802561972c376fc0 100644 --- a/core/modules/system/src/Tests/Batch/PageTest.php +++ b/core/modules/system/src/Tests/Batch/PageTest.php @@ -21,7 +21,7 @@ class PageTest extends WebTestBase { /** * Tests that the batch API progress page uses the correct theme. */ - function testBatchProgressPageTheme() { + public function testBatchProgressPageTheme() { // Make sure that the page which starts the batch (an administrative page) // is using a different theme than would normally be used by the batch API. $this->container->get('theme_handler')->install(['seven', 'bartik']); @@ -46,7 +46,7 @@ function testBatchProgressPageTheme() { /** * Tests that the batch API progress page shows the title correctly. */ - function testBatchProgressPageTitle() { + public function testBatchProgressPageTitle() { // Visit an administrative page that runs a test batch, and check that the // title shown during batch execution (which the batch callback function // saved as a variable) matches the theme used on the administrative page. @@ -59,7 +59,7 @@ function testBatchProgressPageTitle() { /** * Tests that the progress messages are correct. */ - function testBatchProgressMessages() { + public function testBatchProgressMessages() { // Go to the initial step only. $this->maximumMetaRefreshCount = 0; $this->drupalGet('batch-test/test-title'); diff --git a/core/modules/system/src/Tests/Batch/ProcessingTest.php b/core/modules/system/src/Tests/Batch/ProcessingTest.php index 53557ed7a8246fc279096c54e8f98a7f9ea9884f..6b90cc804ca5d5507b3a610efc701a7a4ddf690e 100644 --- a/core/modules/system/src/Tests/Batch/ProcessingTest.php +++ b/core/modules/system/src/Tests/Batch/ProcessingTest.php @@ -22,7 +22,7 @@ class ProcessingTest extends WebTestBase { /** * Tests batches triggered outside of form submission. */ - function testBatchNoForm() { + public function testBatchNoForm() { // Displaying the page triggers batch 1. $this->drupalGet('batch-test/no-form'); $this->assertBatchMessages($this->_resultMessages('batch_1'), 'Batch for step 2 performed successfully.'); @@ -33,7 +33,7 @@ function testBatchNoForm() { /** * Tests batches that redirect in the batch finished callback. */ - function testBatchRedirectFinishedCallback() { + public function testBatchRedirectFinishedCallback() { // Displaying the page triggers batch 1. $this->drupalGet('batch-test/finish-redirect'); $this->assertBatchMessages($this->_resultMessages('batch_1'), 'Batch for step 2 performed successfully.'); @@ -45,7 +45,7 @@ function testBatchRedirectFinishedCallback() { /** * Tests batches defined in a form submit handler. */ - function testBatchForm() { + public function testBatchForm() { // Batch 0: no operation. $edit = ['batch' => 'batch_0']; $this->drupalPostForm('batch-test', $edit, 'Submit'); @@ -89,7 +89,7 @@ function testBatchForm() { /** * Tests batches defined in a multistep form. */ - function testBatchFormMultistep() { + public function testBatchFormMultistep() { $this->drupalGet('batch-test/multistep'); $this->assertNoEscaped('<', 'No escaped markup is present.'); $this->assertText('step 1', 'Form is displayed in step 1.'); @@ -119,7 +119,7 @@ function testBatchFormMultistep() { /** * Tests batches defined in different submit handlers on the same form. */ - function testBatchFormMultipleBatches() { + public function testBatchFormMultipleBatches() { // Batches 1, 2 and 3 are triggered in sequence by different submit // handlers. Each submit handler modify the submitted 'value'. $value = rand(0, 255); @@ -138,7 +138,7 @@ function testBatchFormMultipleBatches() { * * Same as above, but the form is submitted through drupal_form_execute(). */ - function testBatchFormProgrammatic() { + public function testBatchFormProgrammatic() { // Batches 1, 2 and 3 are triggered in sequence by different submit // handlers. Each submit handler modify the submitted 'value'. $value = rand(0, 255); @@ -154,7 +154,7 @@ function testBatchFormProgrammatic() { /** * Test form submission during a batch operation. */ - function testDrupalFormSubmitInBatch() { + public function testDrupalFormSubmitInBatch() { // Displaying the page triggers a batch that programmatically submits a // form. $value = rand(0, 255); @@ -167,7 +167,7 @@ function testDrupalFormSubmitInBatch() { * * @see https://www.drupal.org/node/600836 */ - function testBatchLargePercentage() { + public function testBatchLargePercentage() { // Displaying the page triggers batch 5. $this->drupalGet('batch-test/large-percentage'); $this->assertBatchMessages($this->_resultMessages('batch_5'), 'Batch for step 2 performed successfully.'); @@ -187,7 +187,7 @@ function testBatchLargePercentage() { * @return * TRUE on pass, FALSE on fail. */ - function assertBatchMessages($texts, $message) { + public function assertBatchMessages($texts, $message) { $pattern = '|' . implode('.*', $texts) . '|s'; return $this->assertPattern($pattern, $message); } @@ -195,7 +195,7 @@ function assertBatchMessages($texts, $message) { /** * Returns expected execution stacks for the test batches. */ - function _resultStack($id, $value = 0) { + public function _resultStack($id, $value = 0) { $stack = []; switch ($id) { case 'batch_1': @@ -262,7 +262,7 @@ function _resultStack($id, $value = 0) { /** * Returns expected result messages for the test batches. */ - function _resultMessages($id) { + public function _resultMessages($id) { $messages = []; switch ($id) { diff --git a/core/modules/system/src/Tests/Cache/CacheTestBase.php b/core/modules/system/src/Tests/Cache/CacheTestBase.php index 0f0fe847112cb19034e7be447d1a74689f2eca0f..e1bf79828d762c3d47d92ee6c02665ce8b37ea00 100644 --- a/core/modules/system/src/Tests/Cache/CacheTestBase.php +++ b/core/modules/system/src/Tests/Cache/CacheTestBase.php @@ -74,7 +74,7 @@ protected function assertCacheExists($message, $var = NULL, $cid = NULL, $bin = * @param $bin * The bin the cache item was stored in. */ - function assertCacheRemoved($message, $cid = NULL, $bin = NULL) { + public function assertCacheRemoved($message, $cid = NULL, $bin = NULL) { if ($bin == NULL) { $bin = $this->defaultBin; } diff --git a/core/modules/system/src/Tests/Cache/GenericCacheBackendUnitTestBase.php b/core/modules/system/src/Tests/Cache/GenericCacheBackendUnitTestBase.php index c30ceffa91efda325aeaf7f9d29df1f01c692f6c..d47e88a51c37fc0abda346a9dd32579a765377b3 100644 --- a/core/modules/system/src/Tests/Cache/GenericCacheBackendUnitTestBase.php +++ b/core/modules/system/src/Tests/Cache/GenericCacheBackendUnitTestBase.php @@ -494,7 +494,7 @@ public function testDeleteAll() { * Test Drupal\Core\Cache\CacheBackendInterface::invalidate() and * Drupal\Core\Cache\CacheBackendInterface::invalidateMultiple(). */ - function testInvalidate() { + public function testInvalidate() { $backend = $this->getCacheBackend(); $backend->set('test1', 1); $backend->set('test2', 2); @@ -526,7 +526,7 @@ function testInvalidate() { /** * Tests Drupal\Core\Cache\CacheBackendInterface::invalidateTags(). */ - function testInvalidateTags() { + public function testInvalidateTags() { $backend = $this->getCacheBackend(); // Create two cache entries with the same tag and tag value. diff --git a/core/modules/system/src/Tests/Cache/SessionExistsCacheContextTest.php b/core/modules/system/src/Tests/Cache/SessionExistsCacheContextTest.php index b3c195d5651821c9291abefd99387581694af4d0..8815bf340f33ddf6d63073ff3fa13d8003b3a8f5 100644 --- a/core/modules/system/src/Tests/Cache/SessionExistsCacheContextTest.php +++ b/core/modules/system/src/Tests/Cache/SessionExistsCacheContextTest.php @@ -58,7 +58,7 @@ public function testCacheContext() { /** * Asserts whether a session cookie is present on the client or not. */ - function assertSessionCookieOnClient($expected_present) { + public function assertSessionCookieOnClient($expected_present) { $non_deleted_cookies = array_filter($this->cookies, function ($item) { return $item['value'] !== 'deleted'; }); $this->assertEqual($expected_present, isset($non_deleted_cookies[$this->getSessionName()]), 'Session cookie exists.'); } diff --git a/core/modules/system/src/Tests/Common/AddFeedTest.php b/core/modules/system/src/Tests/Common/AddFeedTest.php index b959d42524dcc2810baaef816cfd6515a96a3d29..40ff215dfd5107e200c199c606c36229e0db4279 100644 --- a/core/modules/system/src/Tests/Common/AddFeedTest.php +++ b/core/modules/system/src/Tests/Common/AddFeedTest.php @@ -15,7 +15,7 @@ class AddFeedTest extends WebTestBase { /** * Tests attaching feeds with paths, URLs, and titles. */ - function testBasicFeedAddNoTitle() { + public function testBasicFeedAddNoTitle() { $path = $this->randomMachineName(12); $external_url = 'http://' . $this->randomMachineName(12) . '/' . $this->randomMachineName(12); $fully_qualified_local_url = Url::fromUri('base:' . $this->randomMachineName(12), ['absolute' => TRUE])->toString(); @@ -70,7 +70,7 @@ function testBasicFeedAddNoTitle() { /** * Creates a pattern representing the RSS feed in the page. */ - function urlToRSSLinkPattern($url, $title = '') { + public function urlToRSSLinkPattern($url, $title = '') { // Escape any regular expression characters in the URL ('?' is the worst). $url = preg_replace('/([+?.*])/', '[$0]', $url); $generated_pattern = '%%'; @@ -82,7 +82,7 @@ function urlToRSSLinkPattern($url, $title = '') { * * @see https://www.drupal.org/node/1211668 */ - function testFeedIconEscaping() { + public function testFeedIconEscaping() { $variables = [ '#theme' => 'feed_icon', '#url' => 'node', diff --git a/core/modules/system/src/Tests/Common/AlterTest.php b/core/modules/system/src/Tests/Common/AlterTest.php index 2f19ab298f5422254fb7de8ccea5b8ea0593f3a8..863bd54de4a88a024cd9bb58bb5ceb864ae2ca88 100644 --- a/core/modules/system/src/Tests/Common/AlterTest.php +++ b/core/modules/system/src/Tests/Common/AlterTest.php @@ -21,7 +21,7 @@ class AlterTest extends WebTestBase { /** * Tests if the theme has been altered. */ - function testDrupalAlter() { + public function testDrupalAlter() { // This test depends on Bartik, so make sure that it is always the current // active theme. \Drupal::service('theme_handler')->install(['bartik']); diff --git a/core/modules/system/src/Tests/Common/EarlyRenderingControllerTest.php b/core/modules/system/src/Tests/Common/EarlyRenderingControllerTest.php index 196d4631128cd589252e5bea3585bda969e29908..1afdd4eeb37955d0b7501dd8259d8c88fb7a5b23 100644 --- a/core/modules/system/src/Tests/Common/EarlyRenderingControllerTest.php +++ b/core/modules/system/src/Tests/Common/EarlyRenderingControllerTest.php @@ -25,7 +25,7 @@ class EarlyRenderingControllerTest extends WebTestBase { /** * Tests theme preprocess functions being able to attach assets. */ - function testEarlyRendering() { + public function testEarlyRendering() { // Render array: non-early & early. $this->drupalGet(Url::fromRoute('early_rendering_controller_test.render_array')); $this->assertResponse(200); diff --git a/core/modules/system/src/Tests/Common/FormatDateTest.php b/core/modules/system/src/Tests/Common/FormatDateTest.php index c6a57c96b8df476c71d0ad37c40030d33fae0a59..c174e3432bd04388d174a00d664c4fa960b5c7ad 100644 --- a/core/modules/system/src/Tests/Common/FormatDateTest.php +++ b/core/modules/system/src/Tests/Common/FormatDateTest.php @@ -50,7 +50,7 @@ protected function setUp() { /** * Tests admin-defined formats in format_date(). */ - function testAdminDefinedFormatDate() { + public function testAdminDefinedFormatDate() { // Create and log in an admin user. $this->drupalLogin($this->drupalCreateUser(['administer site configuration'])); diff --git a/core/modules/system/src/Tests/Common/RenderWebTest.php b/core/modules/system/src/Tests/Common/RenderWebTest.php index 49449d477988d594bbbd46bb985dbceea9568913..ed0e0864026f065d45ecd6f9d3432c35dc5c3f4e 100644 --- a/core/modules/system/src/Tests/Common/RenderWebTest.php +++ b/core/modules/system/src/Tests/Common/RenderWebTest.php @@ -24,7 +24,7 @@ class RenderWebTest extends WebTestBase { /** * Asserts the cache context for the wrapper format is always present. */ - function testWrapperFormatCacheContext() { + public function testWrapperFormatCacheContext() { $this->drupalGet('common-test/type-link-active-class'); $this->assertIdentical(0, strpos($this->getRawContent(), "\nassertIdentical('text/html; charset=UTF-8', $this->drupalGetHeader('Content-Type')); @@ -43,7 +43,7 @@ function testWrapperFormatCacheContext() { * Tests rendering form elements without passing through * \Drupal::formBuilder()->doBuildForm(). */ - function testDrupalRenderFormElements() { + public function testDrupalRenderFormElements() { // Define a series of form elements. $element = [ '#type' => 'button', diff --git a/core/modules/system/src/Tests/Common/SimpleTestErrorCollectorTest.php b/core/modules/system/src/Tests/Common/SimpleTestErrorCollectorTest.php index 016d23c3ad5ce20e2d8b0aaa90d1b47274e86ac0..9af773b86cda026f7f2ef66680376f39ed282dd3 100644 --- a/core/modules/system/src/Tests/Common/SimpleTestErrorCollectorTest.php +++ b/core/modules/system/src/Tests/Common/SimpleTestErrorCollectorTest.php @@ -31,7 +31,7 @@ class SimpleTestErrorCollectorTest extends WebTestBase { /** * Tests that simpletest collects errors from the tested site. */ - function testErrorCollect() { + public function testErrorCollect() { $this->collectedErrors = []; $this->drupalGet('error-test/generate-warnings-with-report'); $this->assertEqual(count($this->collectedErrors), 3, 'Three errors were collected'); @@ -82,7 +82,7 @@ protected function error($message = '', $group = 'Other', array $caller = NULL) /** * Asserts that a collected error matches what we are expecting. */ - function assertError($error, $group, $function, $file, $message = NULL) { + public function assertError($error, $group, $function, $file, $message = NULL) { $this->assertEqual($error['group'], $group, format_string("Group was %group", ['%group' => $group])); $this->assertEqual($error['caller']['function'], $function, format_string("Function was %function", ['%function' => $function])); $this->assertEqual(drupal_basename($error['caller']['file']), $file, format_string("File was %file", ['%file' => $file])); diff --git a/core/modules/system/src/Tests/Common/UrlTest.php b/core/modules/system/src/Tests/Common/UrlTest.php index da839869764fcbce4fe3846567b2a003d86d539a..d72f8e5294c99f5e08122f8a4e025d995fe7707b 100644 --- a/core/modules/system/src/Tests/Common/UrlTest.php +++ b/core/modules/system/src/Tests/Common/UrlTest.php @@ -25,7 +25,7 @@ class UrlTest extends WebTestBase { /** * Confirms that invalid URLs are filtered in link generating functions. */ - function testLinkXSS() { + public function testLinkXSS() { // Test \Drupal::l(). $text = $this->randomMachineName(); $path = ""; @@ -42,7 +42,7 @@ function testLinkXSS() { /** * Tests that #type=link bubbles outbound route/path processors' metadata. */ - function testLinkBubbleableMetadata() { + public function testLinkBubbleableMetadata() { $cases = [ ['Regular link', 'internal:/user', [], ['contexts' => [], 'tags' => [], 'max-age' => Cache::PERMANENT], []], ['Regular link, absolute', 'internal:/user', ['absolute' => TRUE], ['contexts' => ['url.site'], 'tags' => [], 'max-age' => Cache::PERMANENT], []], @@ -71,7 +71,7 @@ function testLinkBubbleableMetadata() { /** * Tests that default and custom attributes are handled correctly on links. */ - function testLinkAttributes() { + public function testLinkAttributes() { /** @var \Drupal\Core\Render\RendererInterface $renderer */ $renderer = $this->container->get('renderer'); @@ -160,7 +160,7 @@ function testLinkAttributes() { /** * Tests that link functions support render arrays as 'text'. */ - function testLinkRenderArrayText() { + public function testLinkRenderArrayText() { /** @var \Drupal\Core\Render\RendererInterface $renderer */ $renderer = $this->container->get('renderer'); @@ -211,7 +211,7 @@ private function hasAttribute($attribute, $link, $class) { /** * Tests UrlHelper::filterQueryParameters(). */ - function testDrupalGetQueryParameters() { + public function testDrupalGetQueryParameters() { $original = [ 'a' => 1, 'b' => [ @@ -247,7 +247,7 @@ function testDrupalGetQueryParameters() { /** * Tests UrlHelper::parse(). */ - function testDrupalParseUrl() { + public function testDrupalParseUrl() { // Relative, absolute, and external URLs, without/with explicit script path, // without/with Drupal path. foreach (['', '/', 'https://www.drupal.org/'] as $absolute) { @@ -285,7 +285,7 @@ function testDrupalParseUrl() { /** * Tests external URL handling. */ - function testExternalUrls() { + public function testExternalUrls() { $test_url = 'https://www.drupal.org/'; // Verify external URL can contain a fragment. diff --git a/core/modules/system/src/Tests/Condition/ConditionFormTest.php b/core/modules/system/src/Tests/Condition/ConditionFormTest.php index 8d2ea6d330bed1e759c13c70bb263e7e6d7196df..42945b250a805f6a4f05f490dfe93c91c1cf4df1 100644 --- a/core/modules/system/src/Tests/Condition/ConditionFormTest.php +++ b/core/modules/system/src/Tests/Condition/ConditionFormTest.php @@ -21,7 +21,7 @@ class ConditionFormTest extends WebTestBase { /** * Submit the condition_node_type_test_form to test condition forms. */ - function testConfigForm() { + public function testConfigForm() { $this->drupalCreateContentType(['type' => 'page', 'name' => 'Page']); $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']); diff --git a/core/modules/system/src/Tests/Database/SelectPagerDefaultTest.php b/core/modules/system/src/Tests/Database/SelectPagerDefaultTest.php index e56c19f91f16682f21c878da34a76ebbc7d1487a..a264d33ea6099915632e0e655cd4bcf8c093c716 100644 --- a/core/modules/system/src/Tests/Database/SelectPagerDefaultTest.php +++ b/core/modules/system/src/Tests/Database/SelectPagerDefaultTest.php @@ -16,7 +16,7 @@ class SelectPagerDefaultTest extends DatabaseWebTestBase { * Note that we have to make an HTTP request to a test page handler * because the pager depends on GET parameters. */ - function testEvenPagerQuery() { + public function testEvenPagerQuery() { // To keep the test from being too brittle, we determine up front // what the page count should be dynamically, and pass the control // information forward to the actual query on the other side of the @@ -50,7 +50,7 @@ function testEvenPagerQuery() { * Note that we have to make an HTTP request to a test page handler * because the pager depends on GET parameters. */ - function testOddPagerQuery() { + public function testOddPagerQuery() { // To keep the test from being too brittle, we determine up front // what the page count should be dynamically, and pass the control // information forward to the actual query on the other side of the @@ -83,7 +83,7 @@ function testOddPagerQuery() { * * This is a regression test for #467984. */ - function testInnerPagerQuery() { + public function testInnerPagerQuery() { $query = db_select('test', 't') ->extend('Drupal\Core\Database\Query\PagerSelectExtender'); $query @@ -105,7 +105,7 @@ function testInnerPagerQuery() { * * This is a regression test for #467984. */ - function testHavingPagerQuery() { + public function testHavingPagerQuery() { $query = db_select('test', 't') ->extend('Drupal\Core\Database\Query\PagerSelectExtender'); $query @@ -124,7 +124,7 @@ function testHavingPagerQuery() { /** * Confirms that every pager gets a valid, non-overlapping element ID. */ - function testElementNumbers() { + public function testElementNumbers() { $request = Request::createFromGlobals(); $request->query->replace([ diff --git a/core/modules/system/src/Tests/Database/SelectTableSortDefaultTest.php b/core/modules/system/src/Tests/Database/SelectTableSortDefaultTest.php index 8ed05bd5c1fadbab0ba37da35ff39f7882092f02..97a676b162826e113cb90afa7e35eafc3d1135d6 100644 --- a/core/modules/system/src/Tests/Database/SelectTableSortDefaultTest.php +++ b/core/modules/system/src/Tests/Database/SelectTableSortDefaultTest.php @@ -15,7 +15,7 @@ class SelectTableSortDefaultTest extends DatabaseWebTestBase { * Note that we have to make an HTTP request to a test page handler * because the pager depends on GET parameters. */ - function testTableSortQuery() { + public function testTableSortQuery() { $sorts = [ ['field' => t('Task ID'), 'sort' => 'desc', 'first' => 'perform at superbowl', 'last' => 'eat'], ['field' => t('Task ID'), 'sort' => 'asc', 'first' => 'eat', 'last' => 'perform at superbowl'], @@ -43,7 +43,7 @@ function testTableSortQuery() { * If a tablesort's orderByHeader is called before another orderBy, then its * header happens first. */ - function testTableSortQueryFirst() { + public function testTableSortQueryFirst() { $sorts = [ ['field' => t('Task ID'), 'sort' => 'desc', 'first' => 'perform at superbowl', 'last' => 'eat'], ['field' => t('Task ID'), 'sort' => 'asc', 'first' => 'eat', 'last' => 'perform at superbowl'], @@ -71,7 +71,7 @@ function testTableSortQueryFirst() { * Specifically that no sort is set in a tableselect, and that header links * are correct. */ - function testTableSortDefaultSort() { + public function testTableSortDefaultSort() { $this->drupalGet('database_test/tablesort_default_sort'); // Verify that the table was displayed. Just the header is checked for diff --git a/core/modules/system/src/Tests/Database/TemporaryQueryTest.php b/core/modules/system/src/Tests/Database/TemporaryQueryTest.php index fd75df3655bfc5dea78af32ba091cbce3c5a28e5..d0dce74e46a252b0233fe86d3aef900e5df6cb22 100644 --- a/core/modules/system/src/Tests/Database/TemporaryQueryTest.php +++ b/core/modules/system/src/Tests/Database/TemporaryQueryTest.php @@ -19,14 +19,14 @@ class TemporaryQueryTest extends DatabaseWebTestBase { /** * Returns the number of rows of a table. */ - function countTableRows($table_name) { + public function countTableRows($table_name) { return db_select($table_name)->countQuery()->execute()->fetchField(); } /** * Confirms that temporary tables work and are limited to one request. */ - function testTemporaryQuery() { + public function testTemporaryQuery() { $this->drupalGet('database_test/db_query_temporary'); $data = json_decode($this->getRawContent()); if ($data) { diff --git a/core/modules/system/src/Tests/Entity/EntityFormTest.php b/core/modules/system/src/Tests/Entity/EntityFormTest.php index 8bcb0c591cdc4c075d38b63fa312c5c51248453d..2ebc35061782bebc71f06d3f3dabd6afeeeb7463 100644 --- a/core/modules/system/src/Tests/Entity/EntityFormTest.php +++ b/core/modules/system/src/Tests/Entity/EntityFormTest.php @@ -31,7 +31,7 @@ protected function setUp() { /** * Tests basic form CRUD functionality. */ - function testFormCRUD() { + public function testFormCRUD() { // All entity variations have to have the same results. foreach (entity_test_entity_types() as $entity_type) { $this->doTestFormCRUD($entity_type); @@ -53,7 +53,7 @@ public function testMultilingualFormCRUD() { * * @see entity_test_entity_form_display_alter() */ - function testEntityFormDisplayAlter() { + public function testEntityFormDisplayAlter() { $this->drupalGet('entity_test/add'); $altered_field = $this->xpath('//input[@name="field_test_text[0][value]" and @size="42"]'); $this->assertTrue(count($altered_field) === 1, 'The altered field has the correct size value.'); diff --git a/core/modules/system/src/Tests/Entity/EntityTranslationFormTest.php b/core/modules/system/src/Tests/Entity/EntityTranslationFormTest.php index e2854d272110e3ba233d5c5aace5b426063251e2..f5134249a72ab6fa872238b4e2fcbddfeaef9ad6 100644 --- a/core/modules/system/src/Tests/Entity/EntityTranslationFormTest.php +++ b/core/modules/system/src/Tests/Entity/EntityTranslationFormTest.php @@ -43,7 +43,7 @@ protected function setUp() { /** * Tests entity form language. */ - function testEntityFormLanguage() { + public function testEntityFormLanguage() { $this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']); $web_user = $this->drupalCreateUser(['create page content', 'edit own page content', 'administer content types']); diff --git a/core/modules/system/src/Tests/Entity/Update/UpdateApiEntityDefinitionUpdateTest.php b/core/modules/system/src/Tests/Entity/Update/UpdateApiEntityDefinitionUpdateTest.php index ceab801e3c0dee5268333505575e6a68322eee96..ddc52fe52cd4ff261317bde01b1d7e68afa74f82 100644 --- a/core/modules/system/src/Tests/Entity/Update/UpdateApiEntityDefinitionUpdateTest.php +++ b/core/modules/system/src/Tests/Entity/Update/UpdateApiEntityDefinitionUpdateTest.php @@ -134,7 +134,7 @@ public function testMultipleUpdates() { /** * Tests that entity updates are correctly reported in the status report page. */ - function testStatusReport() { + public function testStatusReport() { // Create a test entity. $entity = EntityTest::create(['name' => $this->randomString(), 'user_id' => mt_rand()]); $entity->save(); diff --git a/core/modules/system/src/Tests/Form/AlterTest.php b/core/modules/system/src/Tests/Form/AlterTest.php index e77cf301376e1537f681979f7134be615251d0e8..216e5d2014037a23022926b917909acb0bb14646 100644 --- a/core/modules/system/src/Tests/Form/AlterTest.php +++ b/core/modules/system/src/Tests/Form/AlterTest.php @@ -22,7 +22,7 @@ class AlterTest extends WebTestBase { /** * Tests execution order of hook_form_alter() and hook_form_FORM_ID_alter(). */ - function testExecutionOrder() { + public function testExecutionOrder() { $this->drupalGet('form-test/alter'); // Ensure that the order is first by module, then for a given module, the // id-specific one after the generic one. diff --git a/core/modules/system/src/Tests/Form/ArbitraryRebuildTest.php b/core/modules/system/src/Tests/Form/ArbitraryRebuildTest.php index 95324c96da30b5c1821e25cabdb74dcd74bf35e3..d6e99705e753975c69b0adaf407d0ee7b86968bc 100644 --- a/core/modules/system/src/Tests/Form/ArbitraryRebuildTest.php +++ b/core/modules/system/src/Tests/Form/ArbitraryRebuildTest.php @@ -48,7 +48,7 @@ protected function setUp() { /** * Tests a basic rebuild with the user registration form. */ - function testUserRegistrationRebuild() { + public function testUserRegistrationRebuild() { $edit = [ 'name' => 'foo', 'mail' => 'bar@example.com', @@ -62,7 +62,7 @@ function testUserRegistrationRebuild() { /** * Tests a rebuild caused by a multiple value field. */ - function testUserRegistrationMultipleField() { + public function testUserRegistrationMultipleField() { $edit = [ 'name' => 'foo', 'mail' => 'bar@example.com', diff --git a/core/modules/system/src/Tests/Form/CheckboxTest.php b/core/modules/system/src/Tests/Form/CheckboxTest.php index 0e17309d0fef81bc796303f17024ea4db5e117f2..61e7bd9ba5804cd3567a7408f1add70d09e8715d 100644 --- a/core/modules/system/src/Tests/Form/CheckboxTest.php +++ b/core/modules/system/src/Tests/Form/CheckboxTest.php @@ -19,7 +19,7 @@ class CheckboxTest extends WebTestBase { */ public static $modules = ['form_test']; - function testFormCheckbox() { + public function testFormCheckbox() { // Ensure that the checked state is determined and rendered correctly for // tricky combinations of default and return values. foreach ([FALSE, NULL, TRUE, 0, '0', '', 1, '1', 'foobar', '1foobar'] as $default_value) { diff --git a/core/modules/system/src/Tests/Form/ConfirmFormTest.php b/core/modules/system/src/Tests/Form/ConfirmFormTest.php index a26d493e6bb51bdbad4269bac5b480d69acd074d..31ede02a723e1a3d7552f005612a3df783cb1e84 100644 --- a/core/modules/system/src/Tests/Form/ConfirmFormTest.php +++ b/core/modules/system/src/Tests/Form/ConfirmFormTest.php @@ -20,7 +20,7 @@ class ConfirmFormTest extends WebTestBase { */ public static $modules = ['form_test']; - function testConfirmForm() { + public function testConfirmForm() { // Test the building of the form. $this->drupalGet('form-test/confirm-form'); $site_name = $this->config('system.site')->get('name'); diff --git a/core/modules/system/src/Tests/Form/ElementTest.php b/core/modules/system/src/Tests/Form/ElementTest.php index 5b63c6b11e96584cfccaf35554ec210ba39363d3..0e1c3ce0cb8a7579ddd1c08b2759e22f4d0faea5 100644 --- a/core/modules/system/src/Tests/Form/ElementTest.php +++ b/core/modules/system/src/Tests/Form/ElementTest.php @@ -21,7 +21,7 @@ class ElementTest extends WebTestBase { /** * Tests placeholder text for elements that support placeholders. */ - function testPlaceHolderText() { + public function testPlaceHolderText() { $this->drupalGet('form-test/placeholder-text'); $expected = 'placeholder-text'; // Test to make sure non-textarea elements have the proper placeholder text. @@ -44,7 +44,7 @@ function testPlaceHolderText() { /** * Tests expansion of #options for #type checkboxes and radios. */ - function testOptions() { + public function testOptions() { $this->drupalGet('form-test/checkboxes-radios'); // Verify that all options appear in their defined order. @@ -91,7 +91,7 @@ function testOptions() { /** * Tests wrapper ids for checkboxes and radios. */ - function testWrapperIds() { + public function testWrapperIds() { $this->drupalGet('form-test/checkboxes-radios'); // Verify that wrapper id is different from element id. @@ -106,7 +106,7 @@ function testWrapperIds() { /** * Tests button classes. */ - function testButtonClasses() { + public function testButtonClasses() { $this->drupalGet('form-test/button-class'); // Just contains(@class, "button") won't do because then // "button--foo" would contain "button". Instead, check @@ -120,7 +120,7 @@ function testButtonClasses() { /** * Tests the #group property. */ - function testGroupElements() { + public function testGroupElements() { $this->drupalGet('form-test/group-details'); $elements = $this->xpath('//div[@class="details-wrapper"]//div[@class="details-wrapper"]//label'); $this->assertTrue(count($elements) == 1); diff --git a/core/modules/system/src/Tests/Form/ElementsLabelsTest.php b/core/modules/system/src/Tests/Form/ElementsLabelsTest.php index 02f4659f1206deb29dd4b33a0a211393158007ea..2a57e5d70b15a0df7ee12f6222ea8dda256045d5 100644 --- a/core/modules/system/src/Tests/Form/ElementsLabelsTest.php +++ b/core/modules/system/src/Tests/Form/ElementsLabelsTest.php @@ -22,7 +22,7 @@ class ElementsLabelsTest extends WebTestBase { * Test form elements, labels, title attributes and required marks output * correctly and have the correct label option class if needed. */ - function testFormLabels() { + public function testFormLabels() { $this->drupalGet('form_test/form-labels'); // Check that the checkbox/radio processing is not interfering with @@ -99,7 +99,7 @@ function testFormLabels() { /** * Tests different display options for form element descriptions. */ - function testFormDescriptions() { + public function testFormDescriptions() { $this->drupalGet('form_test/form-descriptions'); // Check #description placement with #description_display='after'. @@ -126,7 +126,7 @@ function testFormDescriptions() { /** * Test forms in theme-less environments. */ - function testFormsInThemeLessEnvironments() { + public function testFormsInThemeLessEnvironments() { $form = $this->getFormWithLimitedProperties(); $render_service = $this->container->get('renderer'); // This should not throw any notices. diff --git a/core/modules/system/src/Tests/Form/ElementsTableSelectTest.php b/core/modules/system/src/Tests/Form/ElementsTableSelectTest.php index e09ba776aeb2e7c29f2f7380c51757743d02f8b0..208f85911d874a48cd4dba44767471f5e6ca2250 100644 --- a/core/modules/system/src/Tests/Form/ElementsTableSelectTest.php +++ b/core/modules/system/src/Tests/Form/ElementsTableSelectTest.php @@ -22,7 +22,7 @@ class ElementsTableSelectTest extends WebTestBase { /** * Test the display of checkboxes when #multiple is TRUE. */ - function testMultipleTrue() { + public function testMultipleTrue() { $this->drupalGet('form_test/tableselect/multiple-true'); @@ -40,7 +40,7 @@ function testMultipleTrue() { /** * Test the presence of ajax functionality for all options. */ - function testAjax() { + public function testAjax() { $rows = ['row1', 'row2', 'row3']; // Test checkboxes (#multiple == TRUE). foreach ($rows as $row) { @@ -61,7 +61,7 @@ function testAjax() { /** * Test the display of radios when #multiple is FALSE. */ - function testMultipleFalse() { + public function testMultipleFalse() { $this->drupalGet('form_test/tableselect/multiple-false'); $this->assertNoText(t('Empty text.'), 'Empty text should not be displayed.'); @@ -78,7 +78,7 @@ function testMultipleFalse() { /** * Tests the display when #colspan is set. */ - function testTableselectColSpan() { + public function testTableselectColSpan() { $this->drupalGet('form_test/tableselect/colspan'); $this->assertText(t('Three'), 'Presence of the third column'); @@ -103,7 +103,7 @@ function testTableselectColSpan() { /** * Test the display of the #empty text when #options is an empty array. */ - function testEmptyText() { + public function testEmptyText() { $this->drupalGet('form_test/tableselect/empty-text'); $this->assertText(t('Empty text.'), 'Empty text should be displayed.'); } @@ -111,7 +111,7 @@ function testEmptyText() { /** * Test the submission of single and multiple values when #multiple is TRUE. */ - function testMultipleTrueSubmit() { + public function testMultipleTrueSubmit() { // Test a submission with one checkbox checked. $edit = []; @@ -136,7 +136,7 @@ function testMultipleTrueSubmit() { /** * Test submission of values when #multiple is FALSE. */ - function testMultipleFalseSubmit() { + public function testMultipleFalseSubmit() { $edit['tableselect'] = 'row1'; $this->drupalPostForm('form_test/tableselect/multiple-false', $edit, 'Submit'); $this->assertText(t('Submitted: row1'), 'Selected radio button'); @@ -145,7 +145,7 @@ function testMultipleFalseSubmit() { /** * Test the #js_select property. */ - function testAdvancedSelect() { + public function testAdvancedSelect() { // When #multiple = TRUE a Select all checkbox should be displayed by default. $this->drupalGet('form_test/tableselect/advanced-select/multiple-true-default'); $this->assertFieldByXPath('//th[@class="select-all"]', NULL, 'Display a "Select all" checkbox by default when #multiple is TRUE.'); @@ -166,7 +166,7 @@ function testAdvancedSelect() { /** * Test the whether the option checker gives an error on invalid tableselect values for checkboxes. */ - function testMultipleTrueOptionchecker() { + public function testMultipleTrueOptionchecker() { list($header, $options) = _form_test_tableselect_get_data(); @@ -190,7 +190,7 @@ function testMultipleTrueOptionchecker() { /** * Test the whether the option checker gives an error on invalid tableselect values for radios. */ - function testMultipleFalseOptionchecker() { + public function testMultipleFalseOptionchecker() { list($header, $options) = _form_test_tableselect_get_data(); diff --git a/core/modules/system/src/Tests/Form/ElementsVerticalTabsTest.php b/core/modules/system/src/Tests/Form/ElementsVerticalTabsTest.php index 73d5dfabb702697a37b36605871b429ade33b792..3ef90e13a190d86bd491232d518b7f732bf6f498 100644 --- a/core/modules/system/src/Tests/Form/ElementsVerticalTabsTest.php +++ b/core/modules/system/src/Tests/Form/ElementsVerticalTabsTest.php @@ -47,7 +47,7 @@ protected function setUp() { * * Otherwise, collapse.js adds "SHOW" or "HIDE" labels to the tabs. */ - function testJavaScriptOrdering() { + public function testJavaScriptOrdering() { $this->drupalGet('form_test/vertical-tabs'); $position1 = strpos($this->content, 'core/misc/vertical-tabs.js'); $position2 = strpos($this->content, 'core/misc/collapse.js'); @@ -57,7 +57,7 @@ function testJavaScriptOrdering() { /** * Ensures that vertical tab markup is not shown if user has no tab access. */ - function testWrapperNotShownWhenEmpty() { + public function testWrapperNotShownWhenEmpty() { // Test admin user can see vertical tabs and wrapper. $this->drupalGet('form_test/vertical-tabs'); $wrapper = $this->xpath("//div[@data-vertical-tabs-panes]"); @@ -73,7 +73,7 @@ function testWrapperNotShownWhenEmpty() { /** * Ensures that default vertical tab is correctly selected. */ - function testDefaultTab() { + public function testDefaultTab() { $this->drupalGet('form_test/vertical-tabs'); $this->assertFieldByName('vertical_tabs__active_tab', 'edit-tab3', t('The default vertical tab is correctly selected.')); } @@ -81,7 +81,7 @@ function testDefaultTab() { /** * Ensures that vertical tab form values are cleaned. */ - function testDefaultTabCleaned() { + public function testDefaultTabCleaned() { $values = Json::decode($this->drupalPostForm('form_test/form-state-values-clean', [], t('Submit'))); $this->assertFalse(isset($values['vertical_tabs__active_tab']), SafeMarkup::format('%element was removed.', ['%element' => 'vertical_tabs__active_tab'])); } diff --git a/core/modules/system/src/Tests/Form/EmailTest.php b/core/modules/system/src/Tests/Form/EmailTest.php index ae925a996d6e79b381f35f98fa95fdf800a26fe6..a9d445d63323f7e3a8b7755c66f47225ecf88e5b 100644 --- a/core/modules/system/src/Tests/Form/EmailTest.php +++ b/core/modules/system/src/Tests/Form/EmailTest.php @@ -24,7 +24,7 @@ class EmailTest extends WebTestBase { /** * Tests that #type 'email' fields are properly validated. */ - function testFormEmail() { + public function testFormEmail() { $edit = []; $edit['email'] = 'invalid'; $edit['email_required'] = ' '; diff --git a/core/modules/system/src/Tests/Form/FormTest.php b/core/modules/system/src/Tests/Form/FormTest.php index fc6c648d1243dac0e66d77c5790dc8a94dca7cec..4b8d042faa28676846e0e2843c568ff2969f90b0 100644 --- a/core/modules/system/src/Tests/Form/FormTest.php +++ b/core/modules/system/src/Tests/Form/FormTest.php @@ -48,7 +48,7 @@ protected function setUp() { * * If the form field is found in $form_state->getErrors() then the test pass. */ - function testRequiredFields() { + public function testRequiredFields() { // Originates from https://www.drupal.org/node/117748. // Sets of empty strings and arrays. $empty_strings = ['""' => "", '"\n"' => "\n", '" "' => " ", '"\t"' => "\t", '" \n\t "' => " \n\t ", '"\n\n\n\n\n"' => "\n\n\n\n\n"]; @@ -163,7 +163,7 @@ function testRequiredFields() { * * @see \Drupal\form_test\Form\FormTestValidateRequiredForm */ - function testRequiredCheckboxesRadio() { + public function testRequiredCheckboxesRadio() { $form = \Drupal::formBuilder()->getForm('\Drupal\form_test\Form\FormTestValidateRequiredForm'); // Attempt to submit the form with no required fields set. @@ -312,7 +312,7 @@ public function testGetFormsCsrfToken() { * * @see \Drupal\form_test\Form\FormTestValidateRequiredNoTitleForm */ - function testRequiredTextfieldNoTitle() { + public function testRequiredTextfieldNoTitle() { // Attempt to submit the form with no required field set. $edit = []; $this->drupalPostForm('form-test/validate-required-no-title', $edit, 'Submit'); @@ -339,7 +339,7 @@ function testRequiredTextfieldNoTitle() { * * @see _form_test_checkbox() */ - function testCheckboxProcessing() { + public function testCheckboxProcessing() { // First, try to submit without the required checkbox. $edit = []; $this->drupalPostForm('form-test/checkbox', $edit, t('Submit')); @@ -367,7 +367,7 @@ function testCheckboxProcessing() { /** * Tests validation of #type 'select' elements. */ - function testSelect() { + public function testSelect() { $form = \Drupal::formBuilder()->getForm('Drupal\form_test\Form\FormTestSelectForm'); $this->drupalGet('form-test/select'); @@ -444,7 +444,7 @@ function testSelect() { /** * Tests a select element when #options is not set. */ - function testEmptySelect() { + public function testEmptySelect() { $this->drupalGet('form-test/empty-select'); $this->assertFieldByXPath("//select[1]", NULL, 'Select element found.'); $this->assertNoFieldByXPath("//select[1]/option", NULL, 'No option element found.'); @@ -453,7 +453,7 @@ function testEmptySelect() { /** * Tests validation of #type 'number' and 'range' elements. */ - function testNumber() { + public function testNumber() { $form = \Drupal::formBuilder()->getForm('\Drupal\form_test\Form\FormTestNumberForm'); // Array with all the error messages to be checked. @@ -517,7 +517,7 @@ function testNumber() { /** * Tests default value handling of #type 'range' elements. */ - function testRange() { + public function testRange() { $values = json_decode($this->drupalPostForm('form-test/range', [], 'Submit')); $this->assertEqual($values->with_default_value, 18); $this->assertEqual($values->float, 10.5); @@ -531,7 +531,7 @@ function testRange() { /** * Tests validation of #type 'color' elements. */ - function testColorValidation() { + public function testColorValidation() { // Keys are inputs, values are expected results. $values = [ '' => '#000000', @@ -568,7 +568,7 @@ function testColorValidation() { * * @see _form_test_disabled_elements() */ - function testDisabledElements() { + public function testDisabledElements() { // Get the raw form in its original state. $form_state = new FormState(); $form = (new FormTestDisabledElementsForm())->buildForm([], $form_state); @@ -626,7 +626,7 @@ function testDisabledElements() { /** * Assert that the values submitted to a form matches the default values of the elements. */ - function assertFormValuesDefault($values, $form) { + public function assertFormValuesDefault($values, $form) { foreach (Element::children($form) as $key) { if (isset($form[$key]['#default_value'])) { if (isset($form[$key]['#expected_value'])) { @@ -653,7 +653,7 @@ function assertFormValuesDefault($values, $form) { * * @see _form_test_disabled_elements() */ - function testDisabledMarkup() { + public function testDisabledMarkup() { $this->drupalGet('form-test/disabled-elements'); $form = \Drupal::formBuilder()->getForm('\Drupal\form_test\Form\FormTestDisabledElementsForm'); $type_map = [ @@ -715,7 +715,7 @@ function testDisabledMarkup() { * * @see _form_test_input_forgery() */ - function testInputForgery() { + public function testInputForgery() { $this->drupalGet('form-test/input-forgery'); $checkbox = $this->xpath('//input[@name="checkboxes[two]"]'); $checkbox[0]['value'] = 'FORGERY'; @@ -726,7 +726,7 @@ function testInputForgery() { /** * Tests required attribute. */ - function testRequiredAttribute() { + public function testRequiredAttribute() { $this->drupalGet('form-test/required-attribute'); $expected = 'required'; // Test to make sure the elements have the proper required attribute. diff --git a/core/modules/system/src/Tests/Form/LanguageSelectElementTest.php b/core/modules/system/src/Tests/Form/LanguageSelectElementTest.php index d52eab49b13e8a45ec713667653da408ca6b0ffe..d443d4b647620e51f911cf5a78fecbf811705e61 100644 --- a/core/modules/system/src/Tests/Form/LanguageSelectElementTest.php +++ b/core/modules/system/src/Tests/Form/LanguageSelectElementTest.php @@ -25,7 +25,7 @@ class LanguageSelectElementTest extends WebTestBase { /** * Tests that the options printed by the language select element are correct. */ - function testLanguageSelectElementOptions() { + public function testLanguageSelectElementOptions() { // Add some languages. ConfigurableLanguage::create([ 'id' => 'aaa', @@ -68,7 +68,7 @@ function testLanguageSelectElementOptions() { * * This happens when the language module is disabled. */ - function testHiddenLanguageSelectElement() { + public function testHiddenLanguageSelectElement() { // Disable the language module, so that the language select field will not // be rendered. $this->container->get('module_installer')->uninstall(['language']); diff --git a/core/modules/system/src/Tests/Form/ProgrammaticTest.php b/core/modules/system/src/Tests/Form/ProgrammaticTest.php index 5f6eac07ac41d35551e0d22a1992c343fcf10d2c..d365fb6bf56bac3d5eeac9b18d8b9acd253593d6 100644 --- a/core/modules/system/src/Tests/Form/ProgrammaticTest.php +++ b/core/modules/system/src/Tests/Form/ProgrammaticTest.php @@ -22,7 +22,7 @@ class ProgrammaticTest extends WebTestBase { /** * Test the programmatic form submission workflow. */ - function testSubmissionWorkflow() { + public function testSubmissionWorkflow() { // Backup the current batch status and reset it to avoid conflicts while // processing the dummy form submit handler. $current_batch = $batch =& batch_get(); diff --git a/core/modules/system/src/Tests/Form/RebuildTest.php b/core/modules/system/src/Tests/Form/RebuildTest.php index e759ff6c540f205cf21a44dabdac594567659e08..2e138bdfb322ce200baf9a1a431321569fc04eeb 100644 --- a/core/modules/system/src/Tests/Form/RebuildTest.php +++ b/core/modules/system/src/Tests/Form/RebuildTest.php @@ -42,7 +42,7 @@ protected function setUp() { /** * Tests preservation of values. */ - function testRebuildPreservesValues() { + public function testRebuildPreservesValues() { $edit = [ 'checkbox_1_default_off' => TRUE, 'checkbox_1_default_on' => FALSE, @@ -67,7 +67,7 @@ function testRebuildPreservesValues() { * The 'action' attribute of a form should not change after an Ajax submission * followed by a non-Ajax submission, which triggers a validation error. */ - function testPreserveFormActionAfterAJAX() { + public function testPreserveFormActionAfterAJAX() { // Create a multi-valued field for 'page' nodes to use for Ajax testing. $field_name = 'field_ajax_test'; FieldStorageConfig::create([ diff --git a/core/modules/system/src/Tests/Form/StateValuesCleanAdvancedTest.php b/core/modules/system/src/Tests/Form/StateValuesCleanAdvancedTest.php index 39fed3bea3ad948be11a2ec0e42604ae65ff614b..976209e7b2e11d6a231e546e7887fa5b4b8e8c40 100644 --- a/core/modules/system/src/Tests/Form/StateValuesCleanAdvancedTest.php +++ b/core/modules/system/src/Tests/Form/StateValuesCleanAdvancedTest.php @@ -28,7 +28,7 @@ class StateValuesCleanAdvancedTest extends WebTestBase { /** * Tests \Drupal\Core\Form\FormState::cleanValues(). */ - function testFormStateValuesCleanAdvanced() { + public function testFormStateValuesCleanAdvanced() { // Get an image for uploading. $image_files = $this->drupalGetTestFiles('image'); diff --git a/core/modules/system/src/Tests/Form/StateValuesCleanTest.php b/core/modules/system/src/Tests/Form/StateValuesCleanTest.php index 4e1da6143253103a9f39a8a08c48dae8944778ff..8e79ac29d405545a480a151e861bc0e4f2304915 100644 --- a/core/modules/system/src/Tests/Form/StateValuesCleanTest.php +++ b/core/modules/system/src/Tests/Form/StateValuesCleanTest.php @@ -24,7 +24,7 @@ class StateValuesCleanTest extends WebTestBase { /** * Tests \Drupal\Core\Form\FormState::cleanValues(). */ - function testFormStateValuesClean() { + public function testFormStateValuesClean() { $values = Json::decode($this->drupalPostForm('form_test/form-state-values-clean', [], t('Submit'))); // Setup the expected result. diff --git a/core/modules/system/src/Tests/Form/StorageTest.php b/core/modules/system/src/Tests/Form/StorageTest.php index 4d6f3a73d595cc6c6a3182a55d6cceedc6b3aaea..7896b5362c7b024dcff898f4a0e58bc381439886 100644 --- a/core/modules/system/src/Tests/Form/StorageTest.php +++ b/core/modules/system/src/Tests/Form/StorageTest.php @@ -34,7 +34,7 @@ protected function setUp() { /** * Tests using the form in a usual way. */ - function testForm() { + public function testForm() { $this->drupalGet('form_test/form-storage'); $this->assertText('Form constructions: 1'); @@ -60,7 +60,7 @@ function testForm() { /** * Tests using the form after calling $form_state->setCached(). */ - function testFormCached() { + public function testFormCached() { $this->drupalGet('form_test/form-storage', ['query' => ['cache' => 1]]); $this->assertText('Form constructions: 1'); @@ -87,7 +87,7 @@ function testFormCached() { /** * Tests validation when form storage is used. */ - function testValidation() { + public function testValidation() { $this->drupalPostForm('form_test/form-storage', ['title' => '', 'value' => 'value_is_set'], 'Continue submit'); $this->assertPattern('/value_is_set/', 'The input values have been kept.'); } @@ -102,7 +102,7 @@ function testValidation() { * during form validation, while another, required element in the form * triggers a form validation error. */ - function testCachedFormStorageValidation() { + public function testCachedFormStorageValidation() { // Request the form with 'cache' query parameter to enable form caching. $this->drupalGet('form_test/form-storage', ['query' => ['cache' => 1]]); diff --git a/core/modules/system/src/Tests/Form/SystemConfigFormTest.php b/core/modules/system/src/Tests/Form/SystemConfigFormTest.php index 88687d90db3fa71cbc69a3e48991a66968f9984b..19be45f3f31a7913767bc3744523ee64eb83a638 100644 --- a/core/modules/system/src/Tests/Form/SystemConfigFormTest.php +++ b/core/modules/system/src/Tests/Form/SystemConfigFormTest.php @@ -21,7 +21,7 @@ class SystemConfigFormTest extends WebTestBase { /** * Tests the SystemConfigFormTestBase class. */ - function testSystemConfigForm() { + public function testSystemConfigForm() { $this->drupalGet('form-test/system-config-form'); $element = $this->xpath('//div[@id = :id]/input[contains(@class, :class)]', [':id' => 'edit-actions', ':class' => 'button--primary']); $this->assertTrue($element, 'The primary action submit button was found.'); diff --git a/core/modules/system/src/Tests/Form/TriggeringElementTest.php b/core/modules/system/src/Tests/Form/TriggeringElementTest.php index 6bd8d2e8b59c316f5f9fdb2da62e608c102946f1..973d37db9fdcbbb62fc5240e59b15c047bb546f9 100644 --- a/core/modules/system/src/Tests/Form/TriggeringElementTest.php +++ b/core/modules/system/src/Tests/Form/TriggeringElementTest.php @@ -23,7 +23,7 @@ class TriggeringElementTest extends WebTestBase { * information is included in the POST data, as is sometimes the case when * the ENTER key is pressed in a textfield in Internet Explorer. */ - function testNoButtonInfoInPost() { + public function testNoButtonInfoInPost() { $path = 'form-test/clicked-button'; $edit = []; $form_html_id = 'form-test-clicked-button'; @@ -70,7 +70,7 @@ function testNoButtonInfoInPost() { * Test that the triggering element does not get set to a button with * #access=FALSE. */ - function testAttemptAccessControlBypass() { + public function testAttemptAccessControlBypass() { $path = 'form-test/clicked-button'; $form_html_id = 'form-test-clicked-button'; diff --git a/core/modules/system/src/Tests/Form/UrlTest.php b/core/modules/system/src/Tests/Form/UrlTest.php index 69452cb397dfb103ab20d03b9799a576fe7b6162..aceb6b42027170029bbff672e1945127a680cf86 100644 --- a/core/modules/system/src/Tests/Form/UrlTest.php +++ b/core/modules/system/src/Tests/Form/UrlTest.php @@ -24,7 +24,7 @@ class UrlTest extends WebTestBase { /** * Tests that #type 'url' fields are properly validated and trimmed. */ - function testFormUrl() { + public function testFormUrl() { $edit = []; $edit['url'] = 'http://'; $edit['url_required'] = ' '; diff --git a/core/modules/system/src/Tests/Form/ValidationTest.php b/core/modules/system/src/Tests/Form/ValidationTest.php index 46781edd1186f45fe76318b9ba4c8be6615bebdc..7854fc24adb8643962f05e8fc449bd21e22d80df 100644 --- a/core/modules/system/src/Tests/Form/ValidationTest.php +++ b/core/modules/system/src/Tests/Form/ValidationTest.php @@ -22,7 +22,7 @@ class ValidationTest extends WebTestBase { /** * Tests #element_validate and #validate. */ - function testValidate() { + public function testValidate() { $this->drupalGet('form-test/validate'); // Verify that #element_validate handlers can alter the form and submitted // form values. @@ -72,7 +72,7 @@ function testValidate() { /** * Tests that a form with a disabled CSRF token can be validated. */ - function testDisabledToken() { + public function testDisabledToken() { $this->drupalPostForm('form-test/validate-no-token', [], 'Save'); $this->assertText('The form_test_validate_no_token form has been submitted successfully.'); } @@ -80,7 +80,7 @@ function testDisabledToken() { /** * Tests partial form validation through #limit_validation_errors. */ - function testValidateLimitErrors() { + public function testValidateLimitErrors() { $edit = [ 'test' => 'invalid', 'test_numeric_index[0]' => 'invalid', @@ -141,7 +141,7 @@ function testValidateLimitErrors() { /** * Tests #pattern validation. */ - function testPatternValidation() { + public function testPatternValidation() { $textfield_error = t('%name field is not in the right format.', ['%name' => 'One digit followed by lowercase letters']); $tel_error = t('%name field is not in the right format.', ['%name' => 'Everything except numbers']); $password_error = t('%name field is not in the right format.', ['%name' => 'Password']); @@ -202,7 +202,7 @@ function testPatternValidation() { * * @see \Drupal\form_test\Form\FormTestValidateRequiredForm */ - function testCustomRequiredError() { + public function testCustomRequiredError() { $form = \Drupal::formBuilder()->getForm('\Drupal\form_test\Form\FormTestValidateRequiredForm'); // Verify that a custom #required error can be set. diff --git a/core/modules/system/src/Tests/Image/ToolkitSetupFormTest.php b/core/modules/system/src/Tests/Image/ToolkitSetupFormTest.php index 64b306d562233078e822263d2283a2390262e86e..7dc9d33874a1cc70b9a446bd14b681254e3e9357 100644 --- a/core/modules/system/src/Tests/Image/ToolkitSetupFormTest.php +++ b/core/modules/system/src/Tests/Image/ToolkitSetupFormTest.php @@ -39,7 +39,7 @@ protected function setUp() { /** * Test Image toolkit setup form. */ - function testToolkitSetupForm() { + public function testToolkitSetupForm() { // Get form. $this->drupalGet('admin/config/media/image-toolkit'); diff --git a/core/modules/system/src/Tests/Image/ToolkitTest.php b/core/modules/system/src/Tests/Image/ToolkitTest.php index be8e3e3add4f4dd3e9b919864e31f35991e41001..f70c261efb2909a53bb82cd85a4c2e224669a593 100644 --- a/core/modules/system/src/Tests/Image/ToolkitTest.php +++ b/core/modules/system/src/Tests/Image/ToolkitTest.php @@ -12,7 +12,7 @@ class ToolkitTest extends ToolkitTestBase { * Check that ImageToolkitManager::getAvailableToolkits() only returns * available toolkits. */ - function testGetAvailableToolkits() { + public function testGetAvailableToolkits() { $manager = $this->container->get('image.toolkit.manager'); $toolkits = $manager->getAvailableToolkits(); $this->assertTrue(isset($toolkits['test']), 'The working toolkit was returned.'); @@ -24,7 +24,7 @@ function testGetAvailableToolkits() { /** * Tests Image's methods. */ - function testLoad() { + public function testLoad() { $image = $this->getImage(); $this->assertTrue(is_object($image), 'Returned an object.'); $this->assertEqual($image->getToolkitId(), 'test', 'Image had toolkit set.'); @@ -34,7 +34,7 @@ function testLoad() { /** * Test the image_save() function. */ - function testSave() { + public function testSave() { $this->assertFalse($this->image->save(), 'Function returned the expected value.'); $this->assertToolkitOperationsCalled(['save']); } @@ -42,7 +42,7 @@ function testSave() { /** * Test the image_apply() function. */ - function testApply() { + public function testApply() { $data = ['p1' => 1, 'p2' => TRUE, 'p3' => 'text']; $this->assertTrue($this->image->apply('my_operation', $data), 'Function returned the expected value.'); @@ -58,7 +58,7 @@ function testApply() { /** * Test the image_apply() function. */ - function testApplyNoParameters() { + public function testApplyNoParameters() { $this->assertTrue($this->image->apply('my_operation'), 'Function returned the expected value.'); // Check that apply was called and with the correct parameters. diff --git a/core/modules/system/src/Tests/Image/ToolkitTestBase.php b/core/modules/system/src/Tests/Image/ToolkitTestBase.php index af0b253592f13563b16365c916549260757f6d58..0051e94117397d12ad58842680d718b77700092f 100644 --- a/core/modules/system/src/Tests/Image/ToolkitTestBase.php +++ b/core/modules/system/src/Tests/Image/ToolkitTestBase.php @@ -75,7 +75,7 @@ protected function getImage() { * Array with string containing with the operation name, e.g. 'load', * 'save', 'crop', etc. */ - function assertToolkitOperationsCalled(array $expected) { + public function assertToolkitOperationsCalled(array $expected) { // If one of the image operations is expected, apply should be expected as // well. $operations = [ @@ -120,7 +120,7 @@ function assertToolkitOperationsCalled(array $expected) { /** * Resets/initializes the history of calls to the test toolkit functions. */ - function imageTestReset() { + public function imageTestReset() { // Keep track of calls to these operations $results = [ 'parseFile' => [], @@ -147,7 +147,7 @@ function imageTestReset() { * 'resize', 'rotate', 'crop', 'desaturate') with values being arrays of * parameters passed to each call. */ - function imageTestGetAllCalls() { + public function imageTestGetAllCalls() { return \Drupal::state()->get('image_test.results') ?: []; } diff --git a/core/modules/system/src/Tests/Installer/SiteNameTest.php b/core/modules/system/src/Tests/Installer/SiteNameTest.php index ec4c0e1368693207334e532d8241004ad0bc2c52..081dfb16ac28f161103c6f18116481ead516f356 100644 --- a/core/modules/system/src/Tests/Installer/SiteNameTest.php +++ b/core/modules/system/src/Tests/Installer/SiteNameTest.php @@ -31,7 +31,7 @@ protected function installParameters() { /** * Tests that the desired site name appears on the page after installation. */ - function testSiteName() { + public function testSiteName() { $this->drupalGet(''); $this->assertRaw($this->siteName, 'The site name that was set during the installation appears on the front page after installation.'); } diff --git a/core/modules/system/src/Tests/Menu/BreadcrumbTest.php b/core/modules/system/src/Tests/Menu/BreadcrumbTest.php index f158f272bf4d52b7f1c35cd72b409760c0bfc113..64c8c159774a1a3b969ad23938943c67e3ab3282 100644 --- a/core/modules/system/src/Tests/Menu/BreadcrumbTest.php +++ b/core/modules/system/src/Tests/Menu/BreadcrumbTest.php @@ -58,7 +58,7 @@ protected function setUp() { /** * Tests breadcrumbs on node and administrative paths. */ - function testBreadCrumbs() { + public function testBreadCrumbs() { // Prepare common base breadcrumb elements. $home = ['' => 'Home']; $admin = $home + ['admin' => t('Administration')]; diff --git a/core/modules/system/src/Tests/Module/DependencyTest.php b/core/modules/system/src/Tests/Module/DependencyTest.php index 1e297de0aac32cad5928ce97ae81be984862cd9d..dc00c27ae80740b23340e94d36136b7f4ebaee8f 100644 --- a/core/modules/system/src/Tests/Module/DependencyTest.php +++ b/core/modules/system/src/Tests/Module/DependencyTest.php @@ -12,7 +12,7 @@ class DependencyTest extends ModuleTestBase { /** * Checks functionality of project namespaces for dependencies. */ - function testProjectNamespaceForDependencies() { + public function testProjectNamespaceForDependencies() { $edit = [ 'modules[filter][enable]' => TRUE, ]; @@ -28,7 +28,7 @@ function testProjectNamespaceForDependencies() { /** * Attempts to enable the Content Translation module without Language enabled. */ - function testEnableWithoutDependency() { + public function testEnableWithoutDependency() { // Attempt to enable Content Translation without Language enabled. $edit = []; $edit['modules[content_translation][enable]'] = 'content_translation'; @@ -52,7 +52,7 @@ function testEnableWithoutDependency() { /** * Attempts to enable a module with a missing dependency. */ - function testMissingModules() { + public function testMissingModules() { // Test that the system_dependencies_test module is marked // as missing a dependency. $this->drupalGet('admin/modules'); @@ -64,7 +64,7 @@ function testMissingModules() { /** * Tests enabling a module that depends on an incompatible version of a module. */ - function testIncompatibleModuleVersionDependency() { + public function testIncompatibleModuleVersionDependency() { // Test that the system_incompatible_module_version_dependencies_test is // marked as having an incompatible dependency. $this->drupalGet('admin/modules'); @@ -79,7 +79,7 @@ function testIncompatibleModuleVersionDependency() { /** * Tests enabling a module that depends on a module with an incompatible core version. */ - function testIncompatibleCoreVersionDependency() { + public function testIncompatibleCoreVersionDependency() { // Test that the system_incompatible_core_version_dependencies_test is // marked as having an incompatible dependency. $this->drupalGet('admin/modules'); @@ -93,7 +93,7 @@ function testIncompatibleCoreVersionDependency() { /** * Tests enabling a module that depends on a module which fails hook_requirements(). */ - function testEnableRequirementsFailureDependency() { + public function testEnableRequirementsFailureDependency() { \Drupal::service('module_installer')->install(['comment']); $this->assertModules(['requirements1_test'], FALSE); @@ -120,7 +120,7 @@ function testEnableRequirementsFailureDependency() { * * Dependencies should be enabled before their dependents. */ - function testModuleEnableOrder() { + public function testModuleEnableOrder() { \Drupal::service('module_installer')->install(['module_test'], FALSE); $this->resetAll(); $this->assertModules(['module_test'], TRUE); @@ -153,7 +153,7 @@ function testModuleEnableOrder() { /** * Tests attempting to uninstall a module that has installed dependents. */ - function testUninstallDependents() { + public function testUninstallDependents() { // Enable the forum module. $edit = ['modules[forum][enable]' => 'forum']; $this->drupalPostForm('admin/modules', $edit, t('Install')); diff --git a/core/modules/system/src/Tests/Module/HookRequirementsTest.php b/core/modules/system/src/Tests/Module/HookRequirementsTest.php index 75813c6118fa912bf7950541b57e5cb1c65f26e2..c89c206ca3ea89b3ebfccac097f089fdb8639731 100644 --- a/core/modules/system/src/Tests/Module/HookRequirementsTest.php +++ b/core/modules/system/src/Tests/Module/HookRequirementsTest.php @@ -11,7 +11,7 @@ class HookRequirementsTest extends ModuleTestBase { /** * Assert that a module cannot be installed if it fails hook_requirements(). */ - function testHookRequirementsFailure() { + public function testHookRequirementsFailure() { $this->assertModules(['requirements1_test'], FALSE); // Attempt to install the requirements1_test module. diff --git a/core/modules/system/src/Tests/Module/ModuleTestBase.php b/core/modules/system/src/Tests/Module/ModuleTestBase.php index 8d669caa7d2dfaa01c1a115199e4134e26e144c8..a0a4ed226a925bd8351af0ac46f5e8fd3c9637d1 100644 --- a/core/modules/system/src/Tests/Module/ModuleTestBase.php +++ b/core/modules/system/src/Tests/Module/ModuleTestBase.php @@ -41,7 +41,7 @@ protected function setUp() { * (optional) Whether or not to assert that there are tables that match the * specified base table. Defaults to TRUE. */ - function assertTableCount($base_table, $count = TRUE) { + public function assertTableCount($base_table, $count = TRUE) { $tables = db_find_tables(Database::getConnection()->prefixTables('{' . $base_table . '}') . '%'); if ($count) { @@ -56,7 +56,7 @@ function assertTableCount($base_table, $count = TRUE) { * @param $module * The name of the module. */ - function assertModuleTablesExist($module) { + public function assertModuleTablesExist($module) { $tables = array_keys(drupal_get_module_schema($module)); $tables_exist = TRUE; foreach ($tables as $table) { @@ -73,7 +73,7 @@ function assertModuleTablesExist($module) { * @param $module * The name of the module. */ - function assertModuleTablesDoNotExist($module) { + public function assertModuleTablesDoNotExist($module) { $tables = array_keys(drupal_get_module_schema($module)); $tables_exist = FALSE; foreach ($tables as $table) { @@ -93,7 +93,7 @@ function assertModuleTablesDoNotExist($module) { * @return bool * TRUE if configuration has been installed, FALSE otherwise. */ - function assertModuleConfig($module) { + public function assertModuleConfig($module) { $module_config_dir = drupal_get_path('module', $module) . '/' . InstallStorage::CONFIG_INSTALL_DIRECTORY; if (!is_dir($module_config_dir)) { return; @@ -135,7 +135,7 @@ function assertModuleConfig($module) { * @return bool * TRUE if no configuration was found, FALSE otherwise. */ - function assertNoModuleConfig($module) { + public function assertNoModuleConfig($module) { $names = \Drupal::configFactory()->listAll($module . '.'); return $this->assertFalse($names, format_string('No configuration found for @module module.', ['@module' => $module])); } @@ -148,7 +148,7 @@ function assertNoModuleConfig($module) { * @param $enabled * Expected module state. */ - function assertModules(array $modules, $enabled) { + public function assertModules(array $modules, $enabled) { $this->rebuildContainer(); foreach ($modules as $module) { if ($enabled) { @@ -181,7 +181,7 @@ function assertModules(array $modules, $enabled) { * @param $link * A link to associate with the message. */ - function assertLogMessage($type, $message, $variables = [], $severity = RfcLogLevel::NOTICE, $link = '') { + public function assertLogMessage($type, $message, $variables = [], $severity = RfcLogLevel::NOTICE, $link = '') { $count = db_select('watchdog', 'w') ->condition('type', $type) ->condition('message', $message) diff --git a/core/modules/system/src/Tests/Module/RequiredTest.php b/core/modules/system/src/Tests/Module/RequiredTest.php index b5f17305e5f2da03cd7422edff8a2b7712dc5a75..a2f3560abde938ba8bdf5c7f6839d19c6dc55dc7 100644 --- a/core/modules/system/src/Tests/Module/RequiredTest.php +++ b/core/modules/system/src/Tests/Module/RequiredTest.php @@ -11,7 +11,7 @@ class RequiredTest extends ModuleTestBase { /** * Assert that core required modules cannot be disabled. */ - function testDisableRequired() { + public function testDisableRequired() { $module_info = system_get_info('module'); $this->drupalGet('admin/modules'); foreach ($module_info as $module => $info) { diff --git a/core/modules/system/src/Tests/Module/VersionTest.php b/core/modules/system/src/Tests/Module/VersionTest.php index 1e33f11d43e633e3b7118ab00a2ad7931e5cea9b..daad1a6679f4e47379e186e670ac99951944274f 100644 --- a/core/modules/system/src/Tests/Module/VersionTest.php +++ b/core/modules/system/src/Tests/Module/VersionTest.php @@ -12,7 +12,7 @@ class VersionTest extends ModuleTestBase { /** * Test version dependencies. */ - function testModuleVersions() { + public function testModuleVersions() { $dependencies = [ // Alternating between being compatible and incompatible with 8.x-2.4-beta3. // The first is always a compatible. diff --git a/core/modules/system/src/Tests/Pager/PagerTest.php b/core/modules/system/src/Tests/Pager/PagerTest.php index ba484994427fd97aa6110304724f9e10a7215ebe..71413f283e536951e194031099b10886a9b43dfc 100644 --- a/core/modules/system/src/Tests/Pager/PagerTest.php +++ b/core/modules/system/src/Tests/Pager/PagerTest.php @@ -45,7 +45,7 @@ protected function setUp() { /** * Tests markup and CSS classes of pager links. */ - function testActiveClass() { + public function testActiveClass() { // Verify first page. $this->drupalGet('admin/reports/dblog'); $current_page = 0; diff --git a/core/modules/system/src/Tests/Session/SessionTest.php b/core/modules/system/src/Tests/Session/SessionTest.php index 9b2dc88aa7d56430c177e0ed3021c4d95f85aac4..fcadd42b91ea2cb6cc595997698d09183b730715 100644 --- a/core/modules/system/src/Tests/Session/SessionTest.php +++ b/core/modules/system/src/Tests/Session/SessionTest.php @@ -24,7 +24,7 @@ class SessionTest extends WebTestBase { * Tests for \Drupal\Core\Session\WriteSafeSessionHandler::setSessionWritable() * ::isSessionWritable and \Drupal\Core\Session\SessionManager::regenerate(). */ - function testSessionSaveRegenerate() { + public function testSessionSaveRegenerate() { $session_handler = $this->container->get('session_handler.write_safe'); $this->assertTrue($session_handler->isSessionWritable(), 'session_handler->isSessionWritable() initially returns TRUE.'); $session_handler->setSessionWritable(FALSE); @@ -74,7 +74,7 @@ function testSessionSaveRegenerate() { /** * Test data persistence via the session_test module callbacks. */ - function testDataPersistence() { + public function testDataPersistence() { $user = $this->drupalCreateUser([]); // Enable sessions. $this->sessionReset($user->id()); @@ -147,7 +147,7 @@ public function testSessionPersistenceOnLogin() { /** * Test that empty anonymous sessions are destroyed. */ - function testEmptyAnonymousSession() { + public function testEmptyAnonymousSession() { // Disable the dynamic_page_cache module; it'd cause session_test's debug // output (that is added in // SessionTestSubscriber::onKernelResponseSessionTest()) to not be added. @@ -210,7 +210,7 @@ function testEmptyAnonymousSession() { /** * Test that sessions are only saved when necessary. */ - function testSessionWrite() { + public function testSessionWrite() { $user = $this->drupalCreateUser([]); $this->drupalLogin($user); @@ -258,7 +258,7 @@ function testSessionWrite() { /** * Test that empty session IDs are not allowed. */ - function testEmptySessionID() { + public function testEmptySessionID() { $user = $this->drupalCreateUser([]); $this->drupalLogin($user); $this->drupalGet('session-test/is-logged-in'); @@ -284,7 +284,7 @@ function testEmptySessionID() { * * @param $uid User id to set as the active session. */ - function sessionReset($uid = 0) { + public function sessionReset($uid = 0) { // Close the internal browser. $this->curlClose(); $this->loggedInUser = FALSE; @@ -300,7 +300,7 @@ function sessionReset($uid = 0) { /** * Assert whether the SimpleTest browser sent a session cookie. */ - function assertSessionCookie($sent) { + public function assertSessionCookie($sent) { if ($sent) { $this->assertNotNull($this->sessionId, 'Session cookie was sent.'); } @@ -312,7 +312,7 @@ function assertSessionCookie($sent) { /** * Assert whether $_SESSION is empty at the beginning of the request. */ - function assertSessionEmpty($empty) { + public function assertSessionEmpty($empty) { if ($empty) { $this->assertIdentical($this->drupalGetHeader('X-Session-Empty'), '1', 'Session was empty.'); } diff --git a/core/modules/system/src/Tests/System/AccessDeniedTest.php b/core/modules/system/src/Tests/System/AccessDeniedTest.php index f06cf1f0f8bb7cd1085bc2b454b5535e2414fa29..ba1d599671f84f6d855c49cdb4a0e437185c09e3 100644 --- a/core/modules/system/src/Tests/System/AccessDeniedTest.php +++ b/core/modules/system/src/Tests/System/AccessDeniedTest.php @@ -36,7 +36,7 @@ protected function setUp() { user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, ['access user profiles']); } - function testAccessDenied() { + public function testAccessDenied() { $this->drupalGet('admin'); $this->assertText(t('Access denied'), 'Found the default 403 page'); $this->assertResponse(403); diff --git a/core/modules/system/src/Tests/System/AdminTest.php b/core/modules/system/src/Tests/System/AdminTest.php index 222a4027797d4b874d0e58c2c420c4204fb9f2d8..7921e1c4cffd5b22a2b4ee73fd47d463d5453a71 100644 --- a/core/modules/system/src/Tests/System/AdminTest.php +++ b/core/modules/system/src/Tests/System/AdminTest.php @@ -51,7 +51,7 @@ protected function setUp() { /** * Tests output on administrative listing pages. */ - function testAdminPages() { + public function testAdminPages() { // Go to Administration. $this->drupalGet('admin'); @@ -143,7 +143,7 @@ protected function getTopLevelMenuLinks() { /** * Test compact mode. */ - function testCompactMode() { + public function testCompactMode() { // The front page defaults to 'user/login', which redirects to 'user/{user}' // for authenticated users. We cannot use '', since this does not // match the redirected url. diff --git a/core/modules/system/src/Tests/System/CronRunTest.php b/core/modules/system/src/Tests/System/CronRunTest.php index d11a51616cf7224fd82ae862cf14c808bc533c2d..111cc00870b10ebd05b5e4c2b74716f04c8ad07e 100644 --- a/core/modules/system/src/Tests/System/CronRunTest.php +++ b/core/modules/system/src/Tests/System/CronRunTest.php @@ -21,7 +21,7 @@ class CronRunTest extends WebTestBase { /** * Test cron runs. */ - function testCronRun() { + public function testCronRun() { // Run cron anonymously without any cron key. $this->drupalGet('cron'); $this->assertResponse(404); @@ -43,7 +43,7 @@ function testCronRun() { * In these tests we do not use REQUEST_TIME to track start time, because we * need the exact time when cron is triggered. */ - function testAutomatedCron() { + public function testAutomatedCron() { // Test with a logged in user; anonymous users likely don't cause Drupal to // fully bootstrap, because of the internal page cache or an external // reverse proxy. Reuse this user for disabling cron later in the test. @@ -83,7 +83,7 @@ function testAutomatedCron() { /** * Make sure exceptions thrown on hook_cron() don't affect other modules. */ - function testCronExceptions() { + public function testCronExceptions() { \Drupal::state()->delete('common_test.cron'); // The common_test module throws an exception. If it isn't caught, the tests // won't finish successfully. @@ -96,7 +96,7 @@ function testCronExceptions() { /** * Make sure the cron UI reads from the state storage. */ - function testCronUI() { + public function testCronUI() { $admin_user = $this->drupalCreateUser(['administer site configuration']); $this->drupalLogin($admin_user); $this->drupalGet('admin/config/system/cron'); diff --git a/core/modules/system/src/Tests/System/ErrorHandlerTest.php b/core/modules/system/src/Tests/System/ErrorHandlerTest.php index e2a7eb5f99dad8b32417685af7e739e2e7e91ce2..dc661fec914fa73647b4a04f7b88dfff02fda007 100644 --- a/core/modules/system/src/Tests/System/ErrorHandlerTest.php +++ b/core/modules/system/src/Tests/System/ErrorHandlerTest.php @@ -22,7 +22,7 @@ class ErrorHandlerTest extends WebTestBase { /** * Test the error handler. */ - function testErrorHandler() { + public function testErrorHandler() { $config = $this->config('system.logging'); $error_notice = [ '%type' => 'Notice', @@ -121,7 +121,7 @@ function testErrorHandler() { /** * Test the exception handler. */ - function testExceptionHandler() { + public function testExceptionHandler() { // Ensure the test error log is empty before these tests. $this->assertNoErrorsLogged(); @@ -183,7 +183,7 @@ function testExceptionHandler() { /** * Helper function: assert that the error message is found. */ - function assertErrorMessage(array $error) { + public function assertErrorMessage(array $error) { $message = new FormattableMarkup('%type: @message in %function (line ', $error); $this->assertRaw($message, format_string('Found error message: @message.', ['@message' => $message])); } @@ -191,7 +191,7 @@ function assertErrorMessage(array $error) { /** * Helper function: assert that the error message is not found. */ - function assertNoErrorMessage(array $error) { + public function assertNoErrorMessage(array $error) { $message = new FormattableMarkup('%type: @message in %function (line ', $error); $this->assertNoRaw($message, format_string('Did not find error message: @message.', ['@message' => $message])); } diff --git a/core/modules/system/src/Tests/System/PageNotFoundTest.php b/core/modules/system/src/Tests/System/PageNotFoundTest.php index d4cd861b88a3eb0c40e6e98bf478d1eea735b2df..b1a88d827b015d35280ec4cdf298b08fbb107991 100644 --- a/core/modules/system/src/Tests/System/PageNotFoundTest.php +++ b/core/modules/system/src/Tests/System/PageNotFoundTest.php @@ -34,7 +34,7 @@ protected function setUp() { user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, ['access user profiles']); } - function testPageNotFound() { + public function testPageNotFound() { $this->drupalLogin($this->adminUser); $this->drupalGet($this->randomMachineName(10)); $this->assertText(t('Page not found'), 'Found the default 404 page'); diff --git a/core/modules/system/src/Tests/System/PageTitleTest.php b/core/modules/system/src/Tests/System/PageTitleTest.php index 213339809d122bfe014ab2144e03ff77ba842c5d..3b4d38a500f6fbf55516ffa4151ece98514fda9d 100644 --- a/core/modules/system/src/Tests/System/PageTitleTest.php +++ b/core/modules/system/src/Tests/System/PageTitleTest.php @@ -40,7 +40,7 @@ protected function setUp() { /** * Tests the handling of HTML in node titles. */ - function testTitleTags() { + public function testTitleTags() { $title = "string with HTML"; // Generate node content. $edit = [ @@ -60,7 +60,7 @@ function testTitleTags() { /** * Test if the title of the site is XSS proof. */ - function testTitleXSS() { + public function testTitleXSS() { // Set some title with JavaScript and HTML chars to escape. $title = ' & < > " \' '; $title_filtered = Html::escape($title); diff --git a/core/modules/system/src/Tests/System/ResponseGeneratorTest.php b/core/modules/system/src/Tests/System/ResponseGeneratorTest.php index 6197d1d40ae429d9e5f61b59ce641c3a3650d8af..a535b66c42779624e163143433998931032a2108 100644 --- a/core/modules/system/src/Tests/System/ResponseGeneratorTest.php +++ b/core/modules/system/src/Tests/System/ResponseGeneratorTest.php @@ -33,7 +33,7 @@ protected function setUp() { /** * Test to see if generator header is added. */ - function testGeneratorHeaderAdded() { + public function testGeneratorHeaderAdded() { $node = $this->drupalCreateNode(); diff --git a/core/modules/system/src/Tests/System/ShutdownFunctionsTest.php b/core/modules/system/src/Tests/System/ShutdownFunctionsTest.php index 3a6b3dbf9a23034e5cdcf990cf4d53b5ea1eef95..50fae0362fc1a57e665e9fc7959ce5d516e9cf34 100644 --- a/core/modules/system/src/Tests/System/ShutdownFunctionsTest.php +++ b/core/modules/system/src/Tests/System/ShutdownFunctionsTest.php @@ -29,7 +29,7 @@ protected function tearDown() { /** * Test shutdown functions. */ - function testShutdownFunctions() { + public function testShutdownFunctions() { $arg1 = $this->randomMachineName(); $arg2 = $this->randomMachineName(); $this->drupalGet('system-test/shutdown-functions/' . $arg1 . '/' . $arg2); diff --git a/core/modules/system/src/Tests/System/ThemeTest.php b/core/modules/system/src/Tests/System/ThemeTest.php index b75ede9a2117dcd0e9f88cf1a1a97ee5b0770854..29d88a3778d7e49fe694bf56858f5c61f7b1e5e1 100644 --- a/core/modules/system/src/Tests/System/ThemeTest.php +++ b/core/modules/system/src/Tests/System/ThemeTest.php @@ -41,7 +41,7 @@ protected function setUp() { /** * Test the theme settings form. */ - function testThemeSettings() { + public function testThemeSettings() { // Ensure invalid theme settings form URLs return a proper 404. $this->drupalGet('admin/appearance/settings/bartik'); $this->assertResponse(404, 'The theme settings form URL for a uninstalled theme could not be found.'); @@ -218,7 +218,7 @@ function testThemeSettings() { /** * Test the theme settings logo form. */ - function testThemeSettingsLogo() { + public function testThemeSettingsLogo() { // Visit Bartik's theme settings page to replace the logo. $this->container->get('theme_handler')->install(['bartik']); $this->drupalGet('admin/appearance/settings/bartik'); @@ -241,7 +241,7 @@ function testThemeSettingsLogo() { /** * Test the administration theme functionality. */ - function testAdministrationTheme() { + public function testAdministrationTheme() { $this->container->get('theme_handler')->install(['seven']); // Install an administration theme and show it on the node admin pages. @@ -300,7 +300,7 @@ function testAdministrationTheme() { /** * Test switching the default theme. */ - function testSwitchDefaultTheme() { + public function testSwitchDefaultTheme() { /** @var \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler */ $theme_handler = \Drupal::service('theme_handler'); // First, install Stark and set it as the default theme programmatically. @@ -330,7 +330,7 @@ function testSwitchDefaultTheme() { * Include test for themes that have a missing base theme somewhere further up * the chain than the immediate base theme. */ - function testInvalidTheme() { + public function testInvalidTheme() { // theme_page_test_system_info_alter() un-hides all hidden themes. $this->container->get('module_installer')->install(['theme_page_test']); // Clear the system_list() and theme listing cache to pick up the change. @@ -348,7 +348,7 @@ function testInvalidTheme() { /** * Test uninstalling of themes works. */ - function testUninstallingThemes() { + public function testUninstallingThemes() { // Install Bartik and set it as the default theme. \Drupal::service('theme_handler')->install(['bartik']); // Set up seven as the admin theme. @@ -408,7 +408,7 @@ function testUninstallingThemes() { /** * Tests installing a theme and setting it as default. */ - function testInstallAndSetAsDefault() { + public function testInstallAndSetAsDefault() { $this->drupalGet('admin/appearance'); // Bartik is uninstalled in the test profile and has the third "Install and // set as default" link. diff --git a/core/modules/system/src/Tests/Theme/EngineTwigTest.php b/core/modules/system/src/Tests/Theme/EngineTwigTest.php index 9327c9426c171061eef7f09c930975aa3aea7bf4..ffff75fc49b9ceefa4565fa39e34ae47e2a9f7a9 100644 --- a/core/modules/system/src/Tests/Theme/EngineTwigTest.php +++ b/core/modules/system/src/Tests/Theme/EngineTwigTest.php @@ -28,7 +28,7 @@ protected function setUp() { /** * Tests that the Twig engine handles PHP data correctly. */ - function testTwigVariableDataTypes() { + public function testTwigVariableDataTypes() { $this->config('system.theme') ->set('default', 'test_theme') ->save(); diff --git a/core/modules/system/src/Tests/Theme/EntityFilteringThemeTest.php b/core/modules/system/src/Tests/Theme/EntityFilteringThemeTest.php index f7ebd71e88d9a560a4e6a828ba594f704136c820..10eda61845852d9277796a6b2aae6b020d2a2452 100644 --- a/core/modules/system/src/Tests/Theme/EntityFilteringThemeTest.php +++ b/core/modules/system/src/Tests/Theme/EntityFilteringThemeTest.php @@ -122,7 +122,7 @@ protected function setUp() { /** * Checks each themed entity for XSS filtering in available themes. */ - function testThemedEntity() { + public function testThemedEntity() { // Check paths where various view modes of the entities are rendered. $paths = [ 'user', diff --git a/core/modules/system/src/Tests/Theme/FunctionsTest.php b/core/modules/system/src/Tests/Theme/FunctionsTest.php index a8fec41f2149edc57ec6b8b1b7e45b0f69a5c3b2..825834859aa05163b17b14a7986d7482bc42e25b 100644 --- a/core/modules/system/src/Tests/Theme/FunctionsTest.php +++ b/core/modules/system/src/Tests/Theme/FunctionsTest.php @@ -26,7 +26,7 @@ class FunctionsTest extends WebTestBase { /** * Tests item-list.html.twig. */ - function testItemList() { + public function testItemList() { // Verify that empty items produce no output. $variables = []; $expected = ''; @@ -166,7 +166,7 @@ function testItemList() { /** * Tests links.html.twig. */ - function testLinks() { + public function testLinks() { // Turn off the query for the // \Drupal\Core\Utility\LinkGeneratorInterface::generate() method to compare // the active link correctly. @@ -287,7 +287,7 @@ function testLinks() { /** * Tests links.html.twig using links with indexed keys. */ - function testIndexedKeyedLinks() { + public function testIndexedKeyedLinks() { // Turn off the query for the // \Drupal\Core\Utility\LinkGeneratorInterface::generate() method to compare // the active link correctly. @@ -408,7 +408,7 @@ function testIndexedKeyedLinks() { /** * Test the use of drupal_pre_render_links() on a nested array of links. */ - function testDrupalPreRenderLinks() { + public function testDrupalPreRenderLinks() { // Define the base array to be rendered, containing a variety of different // kinds of links. $base_array = [ @@ -506,7 +506,7 @@ function testDrupalPreRenderLinks() { /** * Tests theme_image(). */ - function testImage() { + public function testImage() { // Test that data URIs work with theme_image(). $variables = []; $variables['uri'] = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='; diff --git a/core/modules/system/src/Tests/Theme/HtmlAttributesTest.php b/core/modules/system/src/Tests/Theme/HtmlAttributesTest.php index b9babae5645fc55e033db33a5ce92004a353ec51..b2018c777e8a495550c4abf9f61ad86a4cabed7e 100644 --- a/core/modules/system/src/Tests/Theme/HtmlAttributesTest.php +++ b/core/modules/system/src/Tests/Theme/HtmlAttributesTest.php @@ -21,7 +21,7 @@ class HtmlAttributesTest extends WebTestBase { /** * Tests that attributes in the 'html' and 'body' elements can be altered. */ - function testThemeHtmlAttributes() { + public function testThemeHtmlAttributes() { $this->drupalGet(''); $attributes = $this->xpath('/html[@theme_test_html_attribute="theme test html attribute value"]'); $this->assertTrue(count($attributes) == 1, "Attribute set in the 'html' element via hook_preprocess_HOOK() found."); diff --git a/core/modules/system/src/Tests/Theme/ThemeSuggestionsAlterTest.php b/core/modules/system/src/Tests/Theme/ThemeSuggestionsAlterTest.php index 706fd267306c5b91764031448aa718f1fa234cb8..c01a94fec259e3732b0b535f0f94e7269842a1f5 100644 --- a/core/modules/system/src/Tests/Theme/ThemeSuggestionsAlterTest.php +++ b/core/modules/system/src/Tests/Theme/ThemeSuggestionsAlterTest.php @@ -27,7 +27,7 @@ protected function setUp() { /** * Tests that hooks to provide theme suggestions work. */ - function testTemplateSuggestions() { + public function testTemplateSuggestions() { $this->drupalGet('theme-test/suggestion-provided'); $this->assertText('Template for testing suggestions provided by the module declaring the theme hook.'); @@ -44,7 +44,7 @@ function testTemplateSuggestions() { /** * Tests hook_theme_suggestions_alter(). */ - function testGeneralSuggestionsAlter() { + public function testGeneralSuggestionsAlter() { $this->drupalGet('theme-test/general-suggestion-alter'); $this->assertText('Original template for testing hook_theme_suggestions_alter().'); @@ -66,7 +66,7 @@ function testGeneralSuggestionsAlter() { /** * Tests that theme suggestion alter hooks work for templates. */ - function testTemplateSuggestionsAlter() { + public function testTemplateSuggestionsAlter() { $this->drupalGet('theme-test/suggestion-alter'); $this->assertText('Original template for testing hook_theme_suggestions_HOOK_alter().'); @@ -88,7 +88,7 @@ function testTemplateSuggestionsAlter() { /** * Tests that theme suggestion alter hooks work for specific theme calls. */ - function testSpecificSuggestionsAlter() { + public function testSpecificSuggestionsAlter() { // Test that the default template is rendered. $this->drupalGet('theme-test/specific-suggestion-alter'); $this->assertText('Template for testing specific theme calls.'); @@ -113,7 +113,7 @@ function testSpecificSuggestionsAlter() { /** * Tests that theme suggestion alter hooks work for theme functions. */ - function testThemeFunctionSuggestionsAlter() { + public function testThemeFunctionSuggestionsAlter() { $this->drupalGet('theme-test/function-suggestion-alter'); $this->assertText('Original theme function.'); @@ -157,7 +157,7 @@ public function testSuggestionsAlterInclude() { * hook_theme_suggestions_alter() should fire before * hook_theme_suggestions_HOOK_alter() within an extension (module or theme). */ - function testExecutionOrder() { + public function testExecutionOrder() { // Install our test theme and module. $this->config('system.theme') ->set('default', 'test_theme') diff --git a/core/modules/system/src/Tests/Theme/ThemeTest.php b/core/modules/system/src/Tests/Theme/ThemeTest.php index 950e0739775c41fb32d78feec6ae460570987239..64f330e9422e3d314094567efa96f4f15ebbbdbc 100644 --- a/core/modules/system/src/Tests/Theme/ThemeTest.php +++ b/core/modules/system/src/Tests/Theme/ThemeTest.php @@ -39,7 +39,7 @@ protected function setUp() { * - the render element's #attributes * - any attributes set in the template's preprocessing function */ - function testAttributeMerging() { + public function testAttributeMerging() { $theme_test_render_element = [ 'elements' => [ '#attributes' => ['data-foo' => 'bar'], @@ -54,7 +54,7 @@ function testAttributeMerging() { /** * Test that ThemeManager renders the expected data types. */ - function testThemeDataTypes() { + public function testThemeDataTypes() { // theme_test_false is an implemented theme hook so \Drupal::theme() service // should return a string or an object that implements MarkupInterface, // even though the theme function itself can return anything. @@ -79,7 +79,7 @@ function testThemeDataTypes() { /** * Test function theme_get_suggestions() for SA-CORE-2009-003. */ - function testThemeSuggestions() { + public function testThemeSuggestions() { // Set the front page as something random otherwise the CLI // test runner fails. $this->config('system.site')->set('page.front', '/nobody-home')->save(); @@ -110,7 +110,7 @@ function testThemeSuggestions() { * separate file, so this test also ensures that that file is correctly loaded * when needed. */ - function testPreprocessForSuggestions() { + public function testPreprocessForSuggestions() { // Test with both an unprimed and primed theme registry. drupal_theme_rebuild(); for ($i = 0; $i < 2; $i++) { @@ -142,7 +142,7 @@ public function testThemeOnNonHtmlRequest() { /** * Ensure page-front template suggestion is added when on front page. */ - function testFrontPageThemeSuggestion() { + public function testFrontPageThemeSuggestion() { // Set the current route to user.login because theme_get_suggestions() will // query it to see if we are on the front page. $request = Request::create('/user/login'); @@ -161,7 +161,7 @@ function testFrontPageThemeSuggestion() { * * @see test_theme.info.yml */ - function testCSSOverride() { + public function testCSSOverride() { // Reuse the same page as in testPreprocessForSuggestions(). We're testing // what is output to the HTML HEAD based on what is in a theme's .info.yml // file, so it doesn't matter what page we get, as long as it is themed with @@ -186,7 +186,7 @@ function testCSSOverride() { /** * Ensures a themes template is overridable based on the 'template' filename. */ - function testTemplateOverride() { + public function testTemplateOverride() { $this->config('system.theme') ->set('default', 'test_theme') ->save(); @@ -197,7 +197,7 @@ function testTemplateOverride() { /** * Ensures a theme template can override a theme function. */ - function testFunctionOverride() { + public function testFunctionOverride() { $this->drupalGet('theme-test/function-template-overridden'); $this->assertText('Success: Template overrides theme function.', 'Theme function overridden by test_theme template.'); } @@ -205,7 +205,7 @@ function testFunctionOverride() { /** * Test the listInfo() function. */ - function testListThemes() { + public function testListThemes() { $theme_handler = $this->container->get('theme_handler'); $theme_handler->install(['test_subtheme']); $themes = $theme_handler->listInfo(); @@ -230,7 +230,7 @@ function testListThemes() { /** * Tests child element rendering for 'render element' theme hooks. */ - function testDrupalRenderChildren() { + public function testDrupalRenderChildren() { $element = [ '#theme' => 'theme_test_render_element_children', 'child' => [ @@ -251,7 +251,7 @@ function testDrupalRenderChildren() { /** * Tests theme can provide classes. */ - function testClassLoading() { + public function testClassLoading() { new ThemeClass(); } @@ -270,7 +270,7 @@ public function testFindThemeTemplates() { * Some modules check the page array in template_preprocess_html(), so we * ensure that it has not been rendered prematurely. */ - function testPreprocessHtml() { + public function testPreprocessHtml() { $this->drupalGet(''); $attributes = $this->xpath('/html/body[@theme_test_page_variable="Page variable is an array."]'); $this->assertTrue(count($attributes) == 1, 'In template_preprocess_html(), the page variable is still an array (not rendered yet).'); diff --git a/core/modules/system/src/Tests/Theme/TwigDebugMarkupTest.php b/core/modules/system/src/Tests/Theme/TwigDebugMarkupTest.php index c6b6c51c58e1087f45d577f6b9a2755f709d7373..457fbad8bf57029a6001398aa6a97b7b4b0739b4 100644 --- a/core/modules/system/src/Tests/Theme/TwigDebugMarkupTest.php +++ b/core/modules/system/src/Tests/Theme/TwigDebugMarkupTest.php @@ -21,7 +21,7 @@ class TwigDebugMarkupTest extends WebTestBase { /** * Tests debug markup added to Twig template output. */ - function testTwigDebugMarkup() { + public function testTwigDebugMarkup() { /** @var \Drupal\Core\Render\RendererInterface $renderer */ $renderer = $this->container->get('renderer'); $extension = twig_extension(); diff --git a/core/modules/system/src/Tests/Update/DependencyHookInvocationTest.php b/core/modules/system/src/Tests/Update/DependencyHookInvocationTest.php index 9e5cc123b82ebdc1075173882af13f1f0b215d65..ef22f0e1b34d2d8e8d796c0051c3a1ac9b817b87 100644 --- a/core/modules/system/src/Tests/Update/DependencyHookInvocationTest.php +++ b/core/modules/system/src/Tests/Update/DependencyHookInvocationTest.php @@ -27,7 +27,7 @@ protected function setUp() { /** * Test the structure of the array returned by hook_update_dependencies(). */ - function testHookUpdateDependencies() { + public function testHookUpdateDependencies() { $update_dependencies = update_retrieve_dependencies(); $this->assertTrue($update_dependencies['update_test_0'][8001]['update_test_1'] == 8001, 'An update function that has a dependency on two separate modules has the first dependency recorded correctly.'); $this->assertTrue($update_dependencies['update_test_0'][8001]['update_test_2'] == 8002, 'An update function that has a dependency on two separate modules has the second dependency recorded correctly.'); diff --git a/core/modules/system/src/Tests/Update/DependencyMissingTest.php b/core/modules/system/src/Tests/Update/DependencyMissingTest.php index fe208dc133c8e51feeaf98ab27bb2d9d0455ad48..407ef336084ce1a5bca6204eba9cf76d6e19c507 100644 --- a/core/modules/system/src/Tests/Update/DependencyMissingTest.php +++ b/core/modules/system/src/Tests/Update/DependencyMissingTest.php @@ -25,7 +25,7 @@ protected function setUp() { require_once \Drupal::root() . '/core/includes/update.inc'; } - function testMissingUpdate() { + public function testMissingUpdate() { $starting_updates = [ 'update_test_2' => 8001, ]; diff --git a/core/modules/system/src/Tests/Update/DependencyOrderingTest.php b/core/modules/system/src/Tests/Update/DependencyOrderingTest.php index f5c344fc0934d3a81d67ae2961de63744d5360ae..8616fb6ba9ad0974b3eea855b52824a77f3e08e4 100644 --- a/core/modules/system/src/Tests/Update/DependencyOrderingTest.php +++ b/core/modules/system/src/Tests/Update/DependencyOrderingTest.php @@ -26,7 +26,7 @@ protected function setUp() { /** * Test that updates within a single module run in the correct order. */ - function testUpdateOrderingSingleModule() { + public function testUpdateOrderingSingleModule() { $starting_updates = [ 'update_test_1' => 8001, ]; @@ -42,7 +42,7 @@ function testUpdateOrderingSingleModule() { /** * Test that dependencies between modules are resolved correctly. */ - function testUpdateOrderingModuleInterdependency() { + public function testUpdateOrderingModuleInterdependency() { $starting_updates = [ 'update_test_2' => 8001, 'update_test_3' => 8001, diff --git a/core/modules/system/src/Tests/Update/InvalidUpdateHookTest.php b/core/modules/system/src/Tests/Update/InvalidUpdateHookTest.php index 60ac0c47c1c1c1b9e237a841bd5be32e6f65dc83..59c64f6240de2acfb8f199b4f96fccef47ea8812 100644 --- a/core/modules/system/src/Tests/Update/InvalidUpdateHookTest.php +++ b/core/modules/system/src/Tests/Update/InvalidUpdateHookTest.php @@ -41,7 +41,7 @@ protected function setUp() { $this->updateUser = $this->drupalCreateUser(['administer software updates']); } - function testInvalidUpdateHook() { + public function testInvalidUpdateHook() { // Confirm that a module with hook_update_8000() cannot be updated. $this->drupalLogin($this->updateUser); $this->drupalGet($this->updateUrl); diff --git a/core/modules/system/src/Tests/Update/UpdatePathTestBase.php b/core/modules/system/src/Tests/Update/UpdatePathTestBase.php index 1706e8b13924ccd04af9150b964bb4b7ea9fd425..f7f88c64860ef07c9b3e4bc2e515daff141c0400 100644 --- a/core/modules/system/src/Tests/Update/UpdatePathTestBase.php +++ b/core/modules/system/src/Tests/Update/UpdatePathTestBase.php @@ -132,7 +132,7 @@ abstract class UpdatePathTestBase extends WebTestBase { * (optional) The ID of the test. Tests with the same id are reported * together. */ - function __construct($test_id = NULL) { + public function __construct($test_id = NULL) { parent::__construct($test_id); $this->zlibInstalled = function_exists('gzopen'); } diff --git a/core/modules/system/src/Tests/Update/UpdateScriptTest.php b/core/modules/system/src/Tests/Update/UpdateScriptTest.php index 12574ee4d4d86d320fd8c765ffde61cca825352e..ed076b8156799e5eb7baa68b5d185db11444288b 100644 --- a/core/modules/system/src/Tests/Update/UpdateScriptTest.php +++ b/core/modules/system/src/Tests/Update/UpdateScriptTest.php @@ -49,7 +49,7 @@ protected function setUp() { /** * Tests access to the update script. */ - function testUpdateAccess() { + public function testUpdateAccess() { // Try accessing update.php without the proper permission. $regular_user = $this->drupalCreateUser(); $this->drupalLogin($regular_user); @@ -93,7 +93,7 @@ function testUpdateAccess() { /** * Tests that requirements warnings and errors are correctly displayed. */ - function testRequirements() { + public function testRequirements() { $update_script_test_config = $this->config('update_script_test.settings'); $this->drupalLogin($this->updateUser); @@ -146,7 +146,7 @@ function testRequirements() { /** * Tests the effect of using the update script on the theme system. */ - function testThemeSystem() { + public function testThemeSystem() { // Since visiting update.php triggers a rebuild of the theme system from an // unusual maintenance mode environment, we check that this rebuild did not // put any incorrect information about the themes into the database. @@ -160,7 +160,7 @@ function testThemeSystem() { /** * Tests update.php when there are no updates to apply. */ - function testNoUpdateFunctionality() { + public function testNoUpdateFunctionality() { // Click through update.php with 'administer software updates' permission. $this->drupalLogin($this->updateUser); $this->drupalGet($this->updateUrl, ['external' => TRUE]); @@ -186,7 +186,7 @@ function testNoUpdateFunctionality() { /** * Tests update.php after performing a successful update. */ - function testSuccessfulUpdateFunctionality() { + public function testSuccessfulUpdateFunctionality() { $initial_maintenance_mode = $this->container->get('state')->get('system.maintenance_mode'); $this->assertFalse($initial_maintenance_mode, 'Site is not in maintenance mode.'); $this->updateScriptTest($initial_maintenance_mode); @@ -220,7 +220,7 @@ function testSuccessfulUpdateFunctionality() { /** * Tests update.php while in maintenance mode. */ - function testMaintenanceModeUpdateFunctionality() { + public function testMaintenanceModeUpdateFunctionality() { $this->container->get('state') ->set('system.maintenance_mode', TRUE); $initial_maintenance_mode = $this->container->get('state') @@ -235,7 +235,7 @@ function testMaintenanceModeUpdateFunctionality() { /** * Tests perfoming updates with update.php in a multilingual environment. */ - function testSuccessfulMultilingualUpdateFunctionality() { + public function testSuccessfulMultilingualUpdateFunctionality() { // Add some custom languages. foreach (['aa', 'bb'] as $language_code) { ConfigurableLanguage::create([ diff --git a/core/modules/system/src/Tests/Update/UpdatesWith7xTest.php b/core/modules/system/src/Tests/Update/UpdatesWith7xTest.php index 3694cad78a7012ec40ef742e44ac9737c9158106..c2035d1335a878a7a4b188a0d0850adf7f1bd508 100644 --- a/core/modules/system/src/Tests/Update/UpdatesWith7xTest.php +++ b/core/modules/system/src/Tests/Update/UpdatesWith7xTest.php @@ -36,7 +36,7 @@ protected function setUp() { $this->updateUser = $this->drupalCreateUser(['administer software updates']); } - function testWith7x() { + public function testWith7x() { // Ensure that the minimum schema version is 8000, despite 7200 update // hooks and a 7XXX hook_update_last_removed(). $this->assertEqual(drupal_get_installed_schema_version('update_test_with_7x'), 8000); diff --git a/core/modules/system/tests/modules/ajax_forms_test/src/Callbacks.php b/core/modules/system/tests/modules/ajax_forms_test/src/Callbacks.php index 4b3b039652617c92f12e3608508a2d6dc66de19e..0ad80c9250a1df953389553678a722f641eba077 100644 --- a/core/modules/system/tests/modules/ajax_forms_test/src/Callbacks.php +++ b/core/modules/system/tests/modules/ajax_forms_test/src/Callbacks.php @@ -15,7 +15,7 @@ class Callbacks { /** * Ajax callback triggered by select. */ - function selectCallback($form, FormStateInterface $form_state) { + public function selectCallback($form, FormStateInterface $form_state) { $response = new AjaxResponse(); $response->addCommand(new HtmlCommand('#ajax_selected_color', $form_state->getValue('select'))); $response->addCommand(new DataCommand('#ajax_selected_color', 'form_state_value_select', $form_state->getValue('select'))); @@ -25,7 +25,7 @@ function selectCallback($form, FormStateInterface $form_state) { /** * Ajax callback triggered by checkbox. */ - function checkboxCallback($form, FormStateInterface $form_state) { + public function checkboxCallback($form, FormStateInterface $form_state) { $response = new AjaxResponse(); $response->addCommand(new HtmlCommand('#ajax_checkbox_value', (int) $form_state->getValue('checkbox'))); $response->addCommand(new DataCommand('#ajax_checkbox_value', 'form_state_value_select', (int) $form_state->getValue('checkbox'))); @@ -35,7 +35,7 @@ function checkboxCallback($form, FormStateInterface $form_state) { /** * Ajax callback triggered by the checkbox in a #group. */ - function checkboxGroupCallback($form, FormStateInterface $form_state) { + public function checkboxGroupCallback($form, FormStateInterface $form_state) { return $form['checkbox_in_group_wrapper']; } diff --git a/core/modules/system/tests/modules/batch_test/src/Controller/BatchTestController.php b/core/modules/system/tests/modules/batch_test/src/Controller/BatchTestController.php index 1cdaf5cc853dca82277675fa608ffc8e7afdc9c9..1d34f8a4592b868e5eb46f445cff6f6f21f7d363 100644 --- a/core/modules/system/tests/modules/batch_test/src/Controller/BatchTestController.php +++ b/core/modules/system/tests/modules/batch_test/src/Controller/BatchTestController.php @@ -95,7 +95,7 @@ public function testFinishRedirect() { * @return array * Render array containing markup. */ - function testProgrammatic($value = 1) { + public function testProgrammatic($value = 1) { $form_state = (new FormState())->setValues([ 'value' => $value, ]); diff --git a/core/modules/system/tests/modules/display_variant_test/src/EventSubscriber/TestPageDisplayVariantSubscriber.php b/core/modules/system/tests/modules/display_variant_test/src/EventSubscriber/TestPageDisplayVariantSubscriber.php index acfed444c4ad11688e4f25fbd8182ae3703c6f4a..e24266e0336586d0d7b7812ce3e932a7f7cb12f8 100644 --- a/core/modules/system/tests/modules/display_variant_test/src/EventSubscriber/TestPageDisplayVariantSubscriber.php +++ b/core/modules/system/tests/modules/display_variant_test/src/EventSubscriber/TestPageDisplayVariantSubscriber.php @@ -31,7 +31,7 @@ public function onSelectPageDisplayVariant(PageDisplayVariantSelectionEvent $eve /** * {@inheritdoc} */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { $events[RenderEvents::SELECT_PAGE_DISPLAY_VARIANT][] = ['onSelectPageDisplayVariant']; return $events; } diff --git a/core/modules/system/tests/modules/early_rendering_controller_test/src/TestDomainObjectViewSubscriber.php b/core/modules/system/tests/modules/early_rendering_controller_test/src/TestDomainObjectViewSubscriber.php index 6dac62f6b7094bc55de8fb69331c2624b9d98ae3..e6152ca67f107b50e052e4c4aef2d820aa9217f3 100644 --- a/core/modules/system/tests/modules/early_rendering_controller_test/src/TestDomainObjectViewSubscriber.php +++ b/core/modules/system/tests/modules/early_rendering_controller_test/src/TestDomainObjectViewSubscriber.php @@ -37,7 +37,7 @@ public function onViewTestDomainObject(GetResponseForControllerResultEvent $even /** * {@inheritdoc} */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { $events[KernelEvents::VIEW][] = ['onViewTestDomainObject']; return $events; diff --git a/core/modules/system/tests/modules/entity_test/src/EntityTestDefinitionSubscriber.php b/core/modules/system/tests/modules/entity_test/src/EntityTestDefinitionSubscriber.php index a31762e4ffd871029c17d73fe6cd382593b09c24..2b06d80bd6e2d858c06ac5714c56253f58260f8b 100644 --- a/core/modules/system/tests/modules/entity_test/src/EntityTestDefinitionSubscriber.php +++ b/core/modules/system/tests/modules/entity_test/src/EntityTestDefinitionSubscriber.php @@ -38,7 +38,7 @@ class EntityTestDefinitionSubscriber implements EventSubscriberInterface, Entity /** * {@inheritdoc} */ - function __construct(StateInterface $state) { + public function __construct(StateInterface $state) { $this->state = $state; } diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestStoragePageCacheForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestStoragePageCacheForm.php index adca384af8ec33e5c5356a821c5cdfd3991a2225..f27e5e066e790c776d908e05b47b8745e8263cd6 100644 --- a/core/modules/system/tests/modules/form_test/src/Form/FormTestStoragePageCacheForm.php +++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestStoragePageCacheForm.php @@ -49,7 +49,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { /** * Form element #after_build callback: output the old form build-id. */ - function form_test_storage_page_cache_old_build_id($form) { + public function form_test_storage_page_cache_old_build_id($form) { if (isset($form['#build_id_old'])) { $form['test_build_id_old']['#plain_text'] = $form['#build_id_old']; } @@ -59,7 +59,7 @@ function form_test_storage_page_cache_old_build_id($form) { /** * Form submit callback: Rebuild the form and continue. */ - function form_test_storage_page_cache_rebuild($form, FormStateInterface $form_state) { + public function form_test_storage_page_cache_rebuild($form, FormStateInterface $form_state) { $form_state->setRebuild(); } diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectFormBase.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectFormBase.php index 0a5bd62a1c3355b63333388459bbd7967a74495c..9a1dc2e6c24b71215eebb9f2e711c0c1332c2b6c 100644 --- a/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectFormBase.php +++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestTableSelectFormBase.php @@ -23,7 +23,7 @@ abstract class FormTestTableSelectFormBase extends FormBase { * @return array * A form with a tableselect element and a submit button. */ - function tableselectFormBuilder($form, FormStateInterface $form_state, $element_properties) { + public function tableselectFormBuilder($form, FormStateInterface $form_state, $element_properties) { list($header, $options) = _form_test_tableselect_get_data(); $form['tableselect'] = $element_properties; diff --git a/core/modules/system/tests/modules/menu_test/src/Plugin/Menu/LocalTask/TestTasksSettingsSub1.php b/core/modules/system/tests/modules/menu_test/src/Plugin/Menu/LocalTask/TestTasksSettingsSub1.php index cadaa9a0c921758fdddd92a48ad6ca4c706832ec..7ba7548846c0649f09732d26c16ac3c252743c63 100644 --- a/core/modules/system/tests/modules/menu_test/src/Plugin/Menu/LocalTask/TestTasksSettingsSub1.php +++ b/core/modules/system/tests/modules/menu_test/src/Plugin/Menu/LocalTask/TestTasksSettingsSub1.php @@ -12,14 +12,14 @@ class TestTasksSettingsSub1 extends LocalTaskDefault { /** * {@inheritdoc} */ - function getTitle() { + public function getTitle() { return $this->t('Dynamic title for @class', ['@class' => 'TestTasksSettingsSub1']); } /** * {@inheritdoc} */ - function getCacheTags() { + public function getCacheTags() { return ['kittens:ragdoll']; } diff --git a/core/modules/system/tests/modules/module_autoload_test/src/SomeClass.php b/core/modules/system/tests/modules/module_autoload_test/src/SomeClass.php index b46f37426c7a7731353f8f06bbdede26b45d9fa9..6cd97a0cb65acd5ebb91d07ca7a29dba72a9c33b 100644 --- a/core/modules/system/tests/modules/module_autoload_test/src/SomeClass.php +++ b/core/modules/system/tests/modules/module_autoload_test/src/SomeClass.php @@ -3,7 +3,7 @@ namespace Drupal\module_autoload_test; class SomeClass { - function testMethod() { + public function testMethod() { return 'Drupal\\module_autoload_test\\SomeClass::testMethod() was invoked.'; } diff --git a/core/modules/system/tests/modules/service_provider_test/src/TestClass.php b/core/modules/system/tests/modules/service_provider_test/src/TestClass.php index 542239faa324fa7b2c1c9d794f975aaa30600a0d..d521e1fdb99a98801560774cfe83d466d3bd8e62 100644 --- a/core/modules/system/tests/modules/service_provider_test/src/TestClass.php +++ b/core/modules/system/tests/modules/service_provider_test/src/TestClass.php @@ -57,7 +57,7 @@ public function onKernelResponseTest(FilterResponseEvent $event) { * @return array * An array of event listener definitions. */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { $events[KernelEvents::REQUEST][] = ['onKernelRequestTest']; $events[KernelEvents::RESPONSE][] = ['onKernelResponseTest']; return $events; diff --git a/core/modules/system/tests/modules/theme_test/src/EventSubscriber/ThemeTestSubscriber.php b/core/modules/system/tests/modules/theme_test/src/EventSubscriber/ThemeTestSubscriber.php index 650d44d412b831f4cd6a4f21ec2ba4033661a1ee..8ac86f1a94a83793541643216b73a5c9d1346e07 100644 --- a/core/modules/system/tests/modules/theme_test/src/EventSubscriber/ThemeTestSubscriber.php +++ b/core/modules/system/tests/modules/theme_test/src/EventSubscriber/ThemeTestSubscriber.php @@ -91,7 +91,7 @@ public function onView(GetResponseEvent $event) { /** * {@inheritdoc} */ - static function getSubscribedEvents() { + public static function getSubscribedEvents() { $events[KernelEvents::REQUEST][] = ['onRequest']; $events[KernelEvents::VIEW][] = ['onView', -1000]; return $events; diff --git a/core/modules/system/tests/modules/theme_test/src/ThemeTestController.php b/core/modules/system/tests/modules/theme_test/src/ThemeTestController.php index 89cd3821539ae626f2fe9f377b11dffe0cc5fe39..f1ed8f3a991b9c2e411953a32b3744d8a272af48 100644 --- a/core/modules/system/tests/modules/theme_test/src/ThemeTestController.php +++ b/core/modules/system/tests/modules/theme_test/src/ThemeTestController.php @@ -87,35 +87,35 @@ public function testRequestListener() { /** * Menu callback for testing suggestion alter hooks with template files. */ - function suggestionProvided() { + public function suggestionProvided() { return ['#theme' => 'theme_test_suggestion_provided']; } /** * Menu callback for testing suggestion alter hooks with template files. */ - function suggestionAlter() { + public function suggestionAlter() { return ['#theme' => 'theme_test_suggestions']; } /** * Menu callback for testing hook_theme_suggestions_alter(). */ - function generalSuggestionAlter() { + public function generalSuggestionAlter() { return ['#theme' => 'theme_test_general_suggestions']; } /** * Menu callback for testing suggestion alter hooks with specific suggestions. */ - function specificSuggestionAlter() { + public function specificSuggestionAlter() { return ['#theme' => 'theme_test_specific_suggestions__variant']; } /** * Menu callback for testing suggestion alter hooks with theme functions. */ - function functionSuggestionAlter() { + public function functionSuggestionAlter() { return ['#theme' => 'theme_test_function_suggestions']; } @@ -123,7 +123,7 @@ function functionSuggestionAlter() { /** * Menu callback for testing includes with suggestion alter hooks. */ - function suggestionAlterInclude() { + public function suggestionAlterInclude() { return ['#theme' => 'theme_test_suggestions_include']; } diff --git a/core/modules/system/tests/src/Functional/Bootstrap/DrupalSetMessageTest.php b/core/modules/system/tests/src/Functional/Bootstrap/DrupalSetMessageTest.php index 0931d65de12776bd742d16ef6953bac591270755..976e8bebfe3607902bfd137ee2ebe9dfe10d6ab3 100644 --- a/core/modules/system/tests/src/Functional/Bootstrap/DrupalSetMessageTest.php +++ b/core/modules/system/tests/src/Functional/Bootstrap/DrupalSetMessageTest.php @@ -21,7 +21,7 @@ class DrupalSetMessageTest extends BrowserTestBase { /** * Tests drupal_set_message(). */ - function testDrupalSetMessage() { + public function testDrupalSetMessage() { // The page at system-test/drupal-set-message sets two messages and then // removes the first before it is displayed. $this->drupalGet('system-test/drupal-set-message'); diff --git a/core/modules/system/tests/src/Functional/Cache/CacheTestBase.php b/core/modules/system/tests/src/Functional/Cache/CacheTestBase.php index fb552fdb6922e6d8bb02f2f2d57c6e46b271383c..f1439eaeb22c653be7f253ab0452cd701b54dd1a 100644 --- a/core/modules/system/tests/src/Functional/Cache/CacheTestBase.php +++ b/core/modules/system/tests/src/Functional/Cache/CacheTestBase.php @@ -71,7 +71,7 @@ protected function assertCacheExists($message, $var = NULL, $cid = NULL, $bin = * @param $bin * The bin the cache item was stored in. */ - function assertCacheRemoved($message, $cid = NULL, $bin = NULL) { + public function assertCacheRemoved($message, $cid = NULL, $bin = NULL) { if ($bin == NULL) { $bin = $this->defaultBin; } diff --git a/core/modules/system/tests/src/Functional/Cache/ClearTest.php b/core/modules/system/tests/src/Functional/Cache/ClearTest.php index fd9641c59b947d5c7eff252568ef23fb6d64a4f5..bec6d502fc793598831269ec3d92b1e4a85236fa 100644 --- a/core/modules/system/tests/src/Functional/Cache/ClearTest.php +++ b/core/modules/system/tests/src/Functional/Cache/ClearTest.php @@ -21,7 +21,7 @@ protected function setUp() { /** * Tests drupal_flush_all_caches(). */ - function testFlushAllCaches() { + public function testFlushAllCaches() { // Create cache entries for each flushed cache bin. $bins = Cache::getBins(); $this->assertTrue($bins, 'Cache::getBins() returned bins to flush.'); diff --git a/core/modules/system/tests/src/Functional/Datetime/DrupalDateTimeTest.php b/core/modules/system/tests/src/Functional/Datetime/DrupalDateTimeTest.php index cc23f4895b79d70e0323cf3c7124624379711f30..d2114fdf8ec26c1873d2cd0a01c76e15c9fe9882 100644 --- a/core/modules/system/tests/src/Functional/Datetime/DrupalDateTimeTest.php +++ b/core/modules/system/tests/src/Functional/Datetime/DrupalDateTimeTest.php @@ -101,7 +101,7 @@ public function testDateTimezone() { /** * Tests the ability to override the time zone in the format method. */ - function testTimezoneFormat() { + public function testTimezoneFormat() { // Create a date in UTC $date = DrupalDateTime::createFromTimestamp(87654321, 'UTC'); diff --git a/core/modules/system/tests/src/Functional/DrupalKernel/ContentNegotiationTest.php b/core/modules/system/tests/src/Functional/DrupalKernel/ContentNegotiationTest.php index 82e2e9249e0c5d208a23de4f2cb51c3c6c5e8428..58157369b3db186b02a5f096c0a36b1d1fdfb2df 100644 --- a/core/modules/system/tests/src/Functional/DrupalKernel/ContentNegotiationTest.php +++ b/core/modules/system/tests/src/Functional/DrupalKernel/ContentNegotiationTest.php @@ -19,7 +19,7 @@ class ContentNegotiationTest extends BrowserTestBase { * * @see https://www.drupal.org/node/1716790 */ - function testBogusAcceptHeader() { + public function testBogusAcceptHeader() { $tests = [ // See https://bugs.webkit.org/show_bug.cgi?id=27267. 'Firefox 3.5 (2009)' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', diff --git a/core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php b/core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php index 11a9b2e4a9e949c7c302fdfad3d80c3ef5a38f12..684e0be8fc918759e7b841abc319157178592714 100644 --- a/core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php +++ b/core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php @@ -41,7 +41,7 @@ protected function setUp() { /** * Tests EntityViewController. */ - function testEntityViewController() { + public function testEntityViewController() { $get_label_markup = function($label) { return '

' . $label . '
diff --git a/core/modules/system/tests/src/Functional/File/ConfigTest.php b/core/modules/system/tests/src/Functional/File/ConfigTest.php index 9ac71dc500b5c874906762d11e660195bb699491..da2003aa7d2fbaf0052a26fbd73c5007d82376b9 100644 --- a/core/modules/system/tests/src/Functional/File/ConfigTest.php +++ b/core/modules/system/tests/src/Functional/File/ConfigTest.php @@ -19,7 +19,7 @@ protected function setUp(){ /** * Tests file configuration page. */ - function testFileConfigurationPage() { + public function testFileConfigurationPage() { $this->drupalGet('admin/config/media/file-system'); // Set the file paths to non-default values. diff --git a/core/modules/system/tests/src/Functional/File/FileSaveHtaccessLoggingTest.php b/core/modules/system/tests/src/Functional/File/FileSaveHtaccessLoggingTest.php index 6da63ee0ee5dd187e82af1a2930dd1b1e5841228..442591d1539111bf71786b436f7dadef7d7acc70 100644 --- a/core/modules/system/tests/src/Functional/File/FileSaveHtaccessLoggingTest.php +++ b/core/modules/system/tests/src/Functional/File/FileSaveHtaccessLoggingTest.php @@ -17,7 +17,7 @@ class FileSaveHtaccessLoggingTest extends BrowserTestBase { /** * Tests file_save_htaccess(). */ - function testHtaccessSave() { + public function testHtaccessSave() { // Prepare test directories. $private = $this->publicFilesDirectory . '/test/private'; diff --git a/core/modules/system/tests/src/Functional/FileTransfer/FileTransferTest.php b/core/modules/system/tests/src/Functional/FileTransfer/FileTransferTest.php index 85d624d76b8b78cbbaea5db7c180a07bddd5e0c3..76d8be8009f3d3aeafaadba66c73690e1d3bb3df 100644 --- a/core/modules/system/tests/src/Functional/FileTransfer/FileTransferTest.php +++ b/core/modules/system/tests/src/Functional/FileTransfer/FileTransferTest.php @@ -23,7 +23,7 @@ protected function setUp() { $this->testConnection = TestFileTransfer::factory(\Drupal::root(), ['hostname' => $this->hostname, 'username' => $this->username, 'password' => $this->password, 'port' => $this->port]); } - function _getFakeModuleFiles() { + public function _getFakeModuleFiles() { $files = [ 'fake.module', 'fake.info.yml', @@ -37,7 +37,7 @@ function _getFakeModuleFiles() { return $files; } - function _buildFakeModule() { + public function _buildFakeModule() { $location = 'temporary://fake'; if (is_dir($location)) { $ret = 0; @@ -53,7 +53,7 @@ function _buildFakeModule() { return $location; } - function _writeDirectory($base, $files = []) { + public function _writeDirectory($base, $files = []) { mkdir($base); foreach ($files as $key => $file) { if (is_array($file)) { @@ -66,7 +66,7 @@ function _writeDirectory($base, $files = []) { } } - function testJail() { + public function testJail() { $source = $this->_buildFakeModule(); // This convoluted piece of code is here because our testing framework does diff --git a/core/modules/system/tests/src/Functional/FileTransfer/MockTestConnection.php b/core/modules/system/tests/src/Functional/FileTransfer/MockTestConnection.php index e645f4e4fbf5047e08fd02c7a4c444afbf3847d3..029e72c95ad8afb92dc8c9797495467ae4a92320 100644 --- a/core/modules/system/tests/src/Functional/FileTransfer/MockTestConnection.php +++ b/core/modules/system/tests/src/Functional/FileTransfer/MockTestConnection.php @@ -10,11 +10,11 @@ class MockTestConnection { protected $commandsRun = []; public $connectionString; - function run($cmd) { + public function run($cmd) { $this->commandsRun[] = $cmd; } - function flushCommands() { + public function flushCommands() { $out = $this->commandsRun; $this->commandsRun = []; return $out; diff --git a/core/modules/system/tests/src/Functional/FileTransfer/TestFileTransfer.php b/core/modules/system/tests/src/Functional/FileTransfer/TestFileTransfer.php index e02ee98e4b8dd367020ec16d4b83d66cea92f623..ca11ad0f5ab53c98db13e11aa6782c94edc6490b 100644 --- a/core/modules/system/tests/src/Functional/FileTransfer/TestFileTransfer.php +++ b/core/modules/system/tests/src/Functional/FileTransfer/TestFileTransfer.php @@ -19,11 +19,11 @@ class TestFileTransfer extends FileTransfer { */ public $shouldIsDirectoryReturnTrue = FALSE; - function __construct($jail, $username, $password, $hostname = 'localhost', $port = 9999) { + public function __construct($jail, $username, $password, $hostname = 'localhost', $port = 9999) { parent::__construct($jail, $username, $password, $hostname, $port); } - static function factory($jail, $settings) { + public static function factory($jail, $settings) { return new TestFileTransfer($jail, $settings['username'], $settings['password'], $settings['hostname'], $settings['port']); } @@ -32,7 +32,7 @@ public function connect() { $this->connection->connectionString = 'test://' . urlencode($this->username) . ':' . urlencode($this->password) . "@$this->host:$this->port/"; } - function copyFileJailed($source, $destination) { + public function copyFileJailed($source, $destination) { $this->connection->run("copyFile $source $destination"); } @@ -40,25 +40,25 @@ protected function removeDirectoryJailed($directory) { $this->connection->run("rmdir $directory"); } - function createDirectoryJailed($directory) { + public function createDirectoryJailed($directory) { $this->connection->run("mkdir $directory"); } - function removeFileJailed($destination) { + public function removeFileJailed($destination) { if (!ftp_delete($this->connection, $item)) { throw new FileTransferException('Unable to remove to file @file.', NULL, ['@file' => $item]); } } - function isDirectory($path) { + public function isDirectory($path) { return $this->shouldIsDirectoryReturnTrue; } - function isFile($path) { + public function isFile($path) { return FALSE; } - function chmodJailed($path, $mode, $recursive) { + public function chmodJailed($path, $mode, $recursive) { return; } diff --git a/core/modules/system/tests/src/Functional/Form/FormObjectTest.php b/core/modules/system/tests/src/Functional/Form/FormObjectTest.php index 67d7ecb0dd1b44756d18121cdb361f4eb55d32ed..34ebb2e79ad1f4a0f38a007412c088f2ca5a89de 100644 --- a/core/modules/system/tests/src/Functional/Form/FormObjectTest.php +++ b/core/modules/system/tests/src/Functional/Form/FormObjectTest.php @@ -37,7 +37,7 @@ protected function setUp() { * * @see \Drupal\form_test\EventSubscriber\FormTestEventSubscriber::onKernelRequest() */ - function testObjectFormCallback() { + public function testObjectFormCallback() { $config_factory = $this->container->get('config.factory'); $this->drupalGet('form-test/object-builder'); diff --git a/core/modules/system/tests/src/Functional/Form/RedirectTest.php b/core/modules/system/tests/src/Functional/Form/RedirectTest.php index 6c09c2d82233ad6c6fd7a667761cba64b6f8c638..a4c9e15b3ce3668b498c53cbd45e03ca2a429bfc 100644 --- a/core/modules/system/tests/src/Functional/Form/RedirectTest.php +++ b/core/modules/system/tests/src/Functional/Form/RedirectTest.php @@ -21,7 +21,7 @@ class RedirectTest extends BrowserTestBase { /** * Tests form redirection. */ - function testRedirect() { + public function testRedirect() { $path = 'form-test/redirect'; $options = ['query' => ['foo' => 'bar']]; $options['absolute'] = TRUE; diff --git a/core/modules/system/tests/src/Functional/Module/ClassLoaderTest.php b/core/modules/system/tests/src/Functional/Module/ClassLoaderTest.php index 9a81499a2804e83fb6ebec3f484058914c57be03..779a288a7bfbbd50b041c47d2e29822ca17fba43 100644 --- a/core/modules/system/tests/src/Functional/Module/ClassLoaderTest.php +++ b/core/modules/system/tests/src/Functional/Module/ClassLoaderTest.php @@ -21,7 +21,7 @@ class ClassLoaderTest extends BrowserTestBase { * * @see \Drupal\module_autoload_test\SomeClass */ - function testClassLoading() { + public function testClassLoading() { // Enable the module_test and module_autoload_test modules. \Drupal::service('module_installer')->install(['module_test', 'module_autoload_test'], FALSE); $this->resetAll(); @@ -38,7 +38,7 @@ function testClassLoading() { * * @see \Drupal\module_autoload_test\SomeClass */ - function testClassLoadingNotInstalledModules() { + public function testClassLoadingNotInstalledModules() { // Enable the module_test module. \Drupal::service('module_installer')->install(['module_test'], FALSE); $this->resetAll(); @@ -55,7 +55,7 @@ function testClassLoadingNotInstalledModules() { * * @see \Drupal\module_autoload_test\SomeClass */ - function testClassLoadingDisabledModules() { + public function testClassLoadingDisabledModules() { // Enable the module_test and module_autoload_test modules. \Drupal::service('module_installer')->install(['module_test', 'module_autoload_test'], FALSE); $this->resetAll(); diff --git a/core/modules/system/tests/src/Functional/Module/ModuleTestBase.php b/core/modules/system/tests/src/Functional/Module/ModuleTestBase.php index 704cbbaf64d8548c9c092683f7f8a3c3b13ddcff..392f2875e6c679fc1e7dc9dc8e55d468fc3122c7 100644 --- a/core/modules/system/tests/src/Functional/Module/ModuleTestBase.php +++ b/core/modules/system/tests/src/Functional/Module/ModuleTestBase.php @@ -38,7 +38,7 @@ protected function setUp() { * (optional) Whether or not to assert that there are tables that match the * specified base table. Defaults to TRUE. */ - function assertTableCount($base_table, $count = TRUE) { + public function assertTableCount($base_table, $count = TRUE) { $tables = db_find_tables(Database::getConnection()->prefixTables('{' . $base_table . '}') . '%'); if ($count) { @@ -53,7 +53,7 @@ function assertTableCount($base_table, $count = TRUE) { * @param $module * The name of the module. */ - function assertModuleTablesExist($module) { + public function assertModuleTablesExist($module) { $tables = array_keys(drupal_get_module_schema($module)); $tables_exist = TRUE; foreach ($tables as $table) { @@ -70,7 +70,7 @@ function assertModuleTablesExist($module) { * @param $module * The name of the module. */ - function assertModuleTablesDoNotExist($module) { + public function assertModuleTablesDoNotExist($module) { $tables = array_keys(drupal_get_module_schema($module)); $tables_exist = FALSE; foreach ($tables as $table) { @@ -90,7 +90,7 @@ function assertModuleTablesDoNotExist($module) { * @return bool * TRUE if configuration has been installed, FALSE otherwise. */ - function assertModuleConfig($module) { + public function assertModuleConfig($module) { $module_config_dir = drupal_get_path('module', $module) . '/' . InstallStorage::CONFIG_INSTALL_DIRECTORY; if (!is_dir($module_config_dir)) { return; @@ -132,7 +132,7 @@ function assertModuleConfig($module) { * @return bool * TRUE if no configuration was found, FALSE otherwise. */ - function assertNoModuleConfig($module) { + public function assertNoModuleConfig($module) { $names = \Drupal::configFactory()->listAll($module . '.'); return $this->assertFalse($names, format_string('No configuration found for @module module.', ['@module' => $module])); } @@ -145,7 +145,7 @@ function assertNoModuleConfig($module) { * @param $enabled * Expected module state. */ - function assertModules(array $modules, $enabled) { + public function assertModules(array $modules, $enabled) { $this->rebuildContainer(); foreach ($modules as $module) { if ($enabled) { @@ -178,7 +178,7 @@ function assertModules(array $modules, $enabled) { * @param $link * A link to associate with the message. */ - function assertLogMessage($type, $message, $variables = [], $severity = RfcLogLevel::NOTICE, $link = '') { + public function assertLogMessage($type, $message, $variables = [], $severity = RfcLogLevel::NOTICE, $link = '') { $count = db_select('watchdog', 'w') ->condition('type', $type) ->condition('message', $message) diff --git a/core/modules/system/tests/src/Functional/Module/UninstallTest.php b/core/modules/system/tests/src/Functional/Module/UninstallTest.php index c5225ee5776bf6f7c9968fd016eb5c7b9dbc66f3..2b17b8fcf6932f77b25447c3db8f53c705860703 100644 --- a/core/modules/system/tests/src/Functional/Module/UninstallTest.php +++ b/core/modules/system/tests/src/Functional/Module/UninstallTest.php @@ -26,7 +26,7 @@ class UninstallTest extends BrowserTestBase { /** * Tests the hook_modules_uninstalled() of the user module. */ - function testUserPermsUninstalled() { + public function testUserPermsUninstalled() { // Uninstalls the module_test module, so hook_modules_uninstalled() // is executed. $this->container->get('module_installer')->uninstall(['module_test']); @@ -38,7 +38,7 @@ function testUserPermsUninstalled() { /** * Tests the Uninstall page and Uninstall confirmation page. */ - function testUninstallPage() { + public function testUninstallPage() { $account = $this->drupalCreateUser(['administer modules']); $this->drupalLogin($account); diff --git a/core/modules/system/tests/src/Functional/Path/UrlAlterFunctionalTest.php b/core/modules/system/tests/src/Functional/Path/UrlAlterFunctionalTest.php index 13c592d1b220daa6d99d2cbd24d4af730a19468d..271774169f0e499f223abc11db43898f7a80b55e 100644 --- a/core/modules/system/tests/src/Functional/Path/UrlAlterFunctionalTest.php +++ b/core/modules/system/tests/src/Functional/Path/UrlAlterFunctionalTest.php @@ -24,7 +24,7 @@ class UrlAlterFunctionalTest extends BrowserTestBase { /** * Test that URL altering works and that it occurs in the correct order. */ - function testUrlAlter() { + public function testUrlAlter() { // Ensure that the url_alias table exists after Drupal installation. $this->assertTrue(Database::getConnection()->schema()->tableExists('url_alias'), 'The url_alias table exists after Drupal installation.'); diff --git a/core/modules/system/tests/src/Functional/Render/DisplayVariantTest.php b/core/modules/system/tests/src/Functional/Render/DisplayVariantTest.php index 449046276e6105e85ec1241917ac3a6c42ee048a..2f5415ba7c449280b1e5376929d89dcd245abee9 100644 --- a/core/modules/system/tests/src/Functional/Render/DisplayVariantTest.php +++ b/core/modules/system/tests/src/Functional/Render/DisplayVariantTest.php @@ -21,7 +21,7 @@ class DisplayVariantTest extends BrowserTestBase { /** * Tests selecting the variant and passing configuration. */ - function testPageDisplayVariantSelectionEvent() { + public function testPageDisplayVariantSelectionEvent() { // Tests that our display variant was selected, and that its configuration // was passed correctly. If the configuration wasn't passed, we'd get an // error page here. diff --git a/core/modules/system/tests/src/Functional/System/DateTimeTest.php b/core/modules/system/tests/src/Functional/System/DateTimeTest.php index 1f3f9779f089a2a37af93d9f0a62b82d440fcd0d..3d35f96e2e760aa91728e177bb2404fed3b98a1f 100644 --- a/core/modules/system/tests/src/Functional/System/DateTimeTest.php +++ b/core/modules/system/tests/src/Functional/System/DateTimeTest.php @@ -39,7 +39,7 @@ protected function setUp() { /** * Test time zones and DST handling. */ - function testTimeZoneHandling() { + public function testTimeZoneHandling() { // Setup date/time settings for Honolulu time. $config = $this->config('system.date') ->set('timezone.default', 'Pacific/Honolulu') @@ -76,7 +76,7 @@ function testTimeZoneHandling() { /** * Test date format configuration. */ - function testDateFormatConfiguration() { + public function testDateFormatConfiguration() { // Confirm 'no custom date formats available' message appears. $this->drupalGet('admin/config/regional/date-time'); @@ -167,7 +167,7 @@ function testDateFormatConfiguration() { /** * Test handling case with invalid data in selectors (like February, 31st). */ - function testEnteringDateTimeViaSelectors() { + public function testEnteringDateTimeViaSelectors() { $this->drupalCreateContentType(['type' => 'page_with_date', 'name' => 'Page with date']); diff --git a/core/modules/system/tests/src/Functional/System/IndexPhpTest.php b/core/modules/system/tests/src/Functional/System/IndexPhpTest.php index 36cdb7b916530a56eb7323461048169198ceab40..2bf098931d61f3c5b8cac33d8d5f7630a68b0401 100644 --- a/core/modules/system/tests/src/Functional/System/IndexPhpTest.php +++ b/core/modules/system/tests/src/Functional/System/IndexPhpTest.php @@ -17,7 +17,7 @@ protected function setUp() { /** * Test index.php handling. */ - function testIndexPhpHandling() { + public function testIndexPhpHandling() { $index_php = $GLOBALS['base_url'] . '/index.php'; $this->drupalGet($index_php, ['external' => TRUE]); diff --git a/core/modules/system/tests/src/Functional/System/MainContentFallbackTest.php b/core/modules/system/tests/src/Functional/System/MainContentFallbackTest.php index f953e09853a760c32c4215accd58f6e807d4f66e..931b84ce2422a2ef6d7aa9870319596bcf8a96c2 100644 --- a/core/modules/system/tests/src/Functional/System/MainContentFallbackTest.php +++ b/core/modules/system/tests/src/Functional/System/MainContentFallbackTest.php @@ -39,7 +39,7 @@ protected function setUp() { /** * Test availability of main content: Drupal falls back to SimplePageVariant. */ - function testMainContentFallback() { + public function testMainContentFallback() { $edit = []; // Uninstall the block module. $edit['uninstall[block]'] = 'block'; diff --git a/core/modules/system/tests/src/Functional/System/RetrieveFileTest.php b/core/modules/system/tests/src/Functional/System/RetrieveFileTest.php index 5cf23648fd6595b60000c74012ea597d9e3cdccf..ef12a51adeba56b0b680cccb519fa8d4fc38ceb2 100644 --- a/core/modules/system/tests/src/Functional/System/RetrieveFileTest.php +++ b/core/modules/system/tests/src/Functional/System/RetrieveFileTest.php @@ -13,7 +13,7 @@ class RetrieveFileTest extends BrowserTestBase { /** * Invokes system_retrieve_file() in several scenarios. */ - function testFileRetrieving() { + public function testFileRetrieving() { // Test 404 handling by trying to fetch a randomly named file. drupal_mkdir($sourcedir = 'public://' . $this->randomMachineName()); $filename = 'Файл для тестирования ' . $this->randomMachineName(); diff --git a/core/modules/system/tests/src/Functional/System/SystemAuthorizeTest.php b/core/modules/system/tests/src/Functional/System/SystemAuthorizeTest.php index 01984a358153557626df763b41ed93896cc28332..8fa81ac2904b17dca484bf5026f5ed427a947c5a 100644 --- a/core/modules/system/tests/src/Functional/System/SystemAuthorizeTest.php +++ b/core/modules/system/tests/src/Functional/System/SystemAuthorizeTest.php @@ -36,14 +36,14 @@ protected function setUp() { * * @see system_authorized_init() */ - function drupalGetAuthorizePHP($page_title = 'system-test-auth') { + public function drupalGetAuthorizePHP($page_title = 'system-test-auth') { $this->drupalGet('system-test/authorize-init/' . $page_title); } /** * Tests the FileTransfer hooks */ - function testFileTransferHooks() { + public function testFileTransferHooks() { $page_title = $this->randomMachineName(16); $this->drupalGetAuthorizePHP($page_title); $this->assertTitle(strtr('@title | Drupal', ['@title' => $page_title]), 'authorize.php page title is correct.'); diff --git a/core/modules/system/tests/src/Functional/System/TokenScanTest.php b/core/modules/system/tests/src/Functional/System/TokenScanTest.php index a43470a7cb02e0296d750299e9d0c5b024b5af50..f284aa978b4e88e4405bcdf0cc0c1a23432942e9 100644 --- a/core/modules/system/tests/src/Functional/System/TokenScanTest.php +++ b/core/modules/system/tests/src/Functional/System/TokenScanTest.php @@ -14,7 +14,7 @@ class TokenScanTest extends BrowserTestBase { /** * Scans dummy text, then tests the output. */ - function testTokenScan() { + public function testTokenScan() { // Define text with valid and not valid, fake and existing token-like // strings. $text = 'First a [valid:simple], but dummy token, and a dummy [valid:token with: spaces].'; diff --git a/core/modules/system/tests/src/Functional/Theme/EngineNyanCatTest.php b/core/modules/system/tests/src/Functional/Theme/EngineNyanCatTest.php index 6af03954817064bc681313da61eebebea112d680..6dca1b38d3cd83df9f3cf6318979394921a3047e 100644 --- a/core/modules/system/tests/src/Functional/Theme/EngineNyanCatTest.php +++ b/core/modules/system/tests/src/Functional/Theme/EngineNyanCatTest.php @@ -26,7 +26,7 @@ protected function setUp() { /** * Ensures a theme's template is overridable based on the 'template' filename. */ - function testTemplateOverride() { + public function testTemplateOverride() { $this->config('system.theme') ->set('default', 'test_theme_nyan_cat_engine') ->save(); diff --git a/core/modules/system/tests/src/Functional/Theme/FastTest.php b/core/modules/system/tests/src/Functional/Theme/FastTest.php index 66426ee113f74b45572774e2fbc000bed81107bc..d8f85f1f4a49c45feeb28f2c137eb14593541c4e 100644 --- a/core/modules/system/tests/src/Functional/Theme/FastTest.php +++ b/core/modules/system/tests/src/Functional/Theme/FastTest.php @@ -26,7 +26,7 @@ protected function setUp() { /** * Tests access to user autocompletion and verify the correct results. */ - function testUserAutocomplete() { + public function testUserAutocomplete() { $this->drupalLogin($this->account); $this->drupalGet('user/autocomplete', ['query' => ['q' => $this->account->getUsername()]]); $this->assertRaw($this->account->getUsername()); diff --git a/core/modules/system/tests/src/Functional/Theme/ThemeEarlyInitializationTest.php b/core/modules/system/tests/src/Functional/Theme/ThemeEarlyInitializationTest.php index f899effaa950ae26911d99fe85cafe333a77cb89..040dfabfce91fee3b72b65db8e52ab431aebaacb 100644 --- a/core/modules/system/tests/src/Functional/Theme/ThemeEarlyInitializationTest.php +++ b/core/modules/system/tests/src/Functional/Theme/ThemeEarlyInitializationTest.php @@ -22,7 +22,7 @@ class ThemeEarlyInitializationTest extends BrowserTestBase { /** * Test that the theme system can generate output in a request listener. */ - function testRequestListener() { + public function testRequestListener() { $this->drupalGet('theme-test/request-listener'); // Verify that themed output generated in the request listener appears. $this->assertRaw('Themed output generated in a KernelEvents::REQUEST listener'); diff --git a/core/modules/system/tests/src/Functional/Theme/ThemeInfoTest.php b/core/modules/system/tests/src/Functional/Theme/ThemeInfoTest.php index d81b6d7e301f5e71209b8d1fd113735397ef3963..ee41968a5a4629e08dc66f1e8a9b04888ef903cd 100644 --- a/core/modules/system/tests/src/Functional/Theme/ThemeInfoTest.php +++ b/core/modules/system/tests/src/Functional/Theme/ThemeInfoTest.php @@ -53,7 +53,7 @@ protected function setUp() { /** * Tests stylesheets-remove. */ - function testStylesheets() { + public function testStylesheets() { $this->themeHandler->install(['test_basetheme', 'test_subtheme']); $this->config('system.theme') ->set('default', 'test_subtheme') diff --git a/core/modules/system/tests/src/Functional/Theme/TwigExtensionTest.php b/core/modules/system/tests/src/Functional/Theme/TwigExtensionTest.php index f2491ac47aa93e7eea4dc4c0d0edbd2181610b53..5e3bc722e3de783fdb50897ccaf77e0a176d6aa9 100644 --- a/core/modules/system/tests/src/Functional/Theme/TwigExtensionTest.php +++ b/core/modules/system/tests/src/Functional/Theme/TwigExtensionTest.php @@ -26,7 +26,7 @@ protected function setUp() { /** * Tests that the provided Twig extension loads the service appropriately. */ - function testTwigExtensionLoaded() { + public function testTwigExtensionLoaded() { $twigService = \Drupal::service('twig'); $ext = $twigService->getExtension('twig_extension_test.test_extension'); $this->assertEqual(get_class($ext), 'Drupal\twig_extension_test\TwigExtension\TestExtension', 'TestExtension loaded successfully.'); @@ -35,7 +35,7 @@ function testTwigExtensionLoaded() { /** * Tests that the Twig extension's filter produces expected output. */ - function testTwigExtensionFilter() { + public function testTwigExtensionFilter() { $this->config('system.theme') ->set('default', 'test_theme') ->save(); @@ -49,7 +49,7 @@ function testTwigExtensionFilter() { /** * Tests that the Twig extension's function produces expected output. */ - function testTwigExtensionFunction() { + public function testTwigExtensionFunction() { $this->config('system.theme') ->set('default', 'test_theme') ->save(); diff --git a/core/modules/system/tests/src/Functional/Theme/TwigSettingsTest.php b/core/modules/system/tests/src/Functional/Theme/TwigSettingsTest.php index 58dcbc9af1b4885e2c71da3e6be31a03dba920d8..0ad88ce320bb0f5bb528bc5ef83eb093a1a02146 100644 --- a/core/modules/system/tests/src/Functional/Theme/TwigSettingsTest.php +++ b/core/modules/system/tests/src/Functional/Theme/TwigSettingsTest.php @@ -22,7 +22,7 @@ class TwigSettingsTest extends BrowserTestBase { /** * Ensures Twig template auto reload setting can be overridden. */ - function testTwigAutoReloadOverride() { + public function testTwigAutoReloadOverride() { // Enable auto reload and rebuild the service container. $parameters = $this->container->getParameter('twig.config'); $parameters['auto_reload'] = TRUE; @@ -44,7 +44,7 @@ function testTwigAutoReloadOverride() { /** * Ensures Twig engine debug setting can be overridden. */ - function testTwigDebugOverride() { + public function testTwigDebugOverride() { // Enable debug and rebuild the service container. $parameters = $this->container->getParameter('twig.config'); $parameters['debug'] = TRUE; @@ -74,7 +74,7 @@ function testTwigDebugOverride() { /** * Ensures Twig template cache setting can be overridden. */ - function testTwigCacheOverride() { + public function testTwigCacheOverride() { $extension = twig_extension(); $theme_handler = $this->container->get('theme_handler'); $theme_handler->install(['test_theme']); diff --git a/core/modules/system/tests/src/Kernel/Common/PageRenderTest.php b/core/modules/system/tests/src/Kernel/Common/PageRenderTest.php index 80729448d78fc9b9e1eab57a910023ae4ec8dd51..fa16947344227a5be45165af1a151d53795f4943 100644 --- a/core/modules/system/tests/src/Kernel/Common/PageRenderTest.php +++ b/core/modules/system/tests/src/Kernel/Common/PageRenderTest.php @@ -14,7 +14,7 @@ class PageRenderTest extends KernelTestBase { /** * Tests hook_page_attachments() exceptions. */ - function testHookPageAttachmentsExceptions() { + public function testHookPageAttachmentsExceptions() { $this->enableModules(['common_test', 'system']); \Drupal::service('router.builder')->rebuild(); @@ -24,7 +24,7 @@ function testHookPageAttachmentsExceptions() { /** * Tests hook_page_attachments_alter() exceptions. */ - function testHookPageAlter() { + public function testHookPageAlter() { $this->enableModules(['common_test', 'system']); \Drupal::service('router.builder')->rebuild(); @@ -39,7 +39,7 @@ function testHookPageAlter() { * @param string $hook * The page render hook to assert expected exceptions for. */ - function assertPageRenderHookExceptions($module, $hook) { + public function assertPageRenderHookExceptions($module, $hook) { $html_renderer = \Drupal::getContainer()->get('main_content_renderer.html'); // Assert a valid hook implementation doesn't trigger an exception. diff --git a/core/modules/system/tests/src/Kernel/Common/SystemListingTest.php b/core/modules/system/tests/src/Kernel/Common/SystemListingTest.php index fc30a1c504d7892e3b8bf0ed793d8621bf00c1db..b0412b4336fd20d6c4d0ea1f306561fe442e2a9c 100644 --- a/core/modules/system/tests/src/Kernel/Common/SystemListingTest.php +++ b/core/modules/system/tests/src/Kernel/Common/SystemListingTest.php @@ -14,7 +14,7 @@ class SystemListingTest extends KernelTestBase { /** * Tests that files in different directories take precedence as expected. */ - function testDirectoryPrecedence() { + public function testDirectoryPrecedence() { // Define the module files we will search for, and the directory precedence // we expect. $expected_directories = [ diff --git a/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php b/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php index 8ee66ee5c4af8c2cdf5de6868ae5c04d21995d66..22648a63912b7edb45685120e9f9216911311d3b 100644 --- a/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php +++ b/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php @@ -38,7 +38,7 @@ protected function setUp() { /** * The basic functionality of retrieving enabled modules. */ - function testModuleList() { + public function testModuleList() { $module_list = ['system']; $this->assertModuleList($module_list, 'Initial'); @@ -92,7 +92,7 @@ protected function assertModuleList(array $expected_values, $condition) { * @see module_test_system_info_alter() * @see https://www.drupal.org/files/issues/dep.gv__0.png */ - function testDependencyResolution() { + public function testDependencyResolution() { $this->enableModules(['module_test']); $this->assertTrue($this->moduleHandler()->moduleExists('module_test'), 'Test module is enabled.'); @@ -171,7 +171,7 @@ function testDependencyResolution() { /** * Tests uninstalling a module that is a "dependency" of a profile. */ - function testUninstallProfileDependency() { + public function testUninstallProfileDependency() { $profile = 'minimal'; $dependency = 'dblog'; $this->setSetting('install_profile', $profile); @@ -204,7 +204,7 @@ function testUninstallProfileDependency() { /** * Tests uninstalling a module that has content. */ - function testUninstallContentDependency() { + public function testUninstallContentDependency() { $this->enableModules(['module_test', 'entity_test', 'text', 'user', 'help']); $this->assertTrue($this->moduleHandler()->moduleExists('entity_test'), 'Test module is enabled.'); $this->assertTrue($this->moduleHandler()->moduleExists('module_test'), 'Test module is enabled.'); @@ -258,7 +258,7 @@ function testUninstallContentDependency() { /** * Tests whether the correct module metadata is returned. */ - function testModuleMetaData() { + public function testModuleMetaData() { // Generate the list of available modules. $modules = system_rebuild_module_data(); // Check that the mtime field exists for the system module. @@ -289,7 +289,7 @@ public function testModuleStreamWrappers() { /** * Tests whether the correct theme metadata is returned. */ - function testThemeMetaData() { + public function testThemeMetaData() { // Generate the list of available themes. $themes = \Drupal::service('theme_handler')->rebuildThemeData(); // Check that the mtime field exists for the bartik theme. diff --git a/core/modules/system/tests/src/Kernel/Render/ClassyTest.php b/core/modules/system/tests/src/Kernel/Render/ClassyTest.php index 776cb2e672f26b3c0641af3f22d2cf4a0fa968e3..8dbb01e5d057706a12fb22165597e7df3fa8fdf3 100644 --- a/core/modules/system/tests/src/Kernel/Render/ClassyTest.php +++ b/core/modules/system/tests/src/Kernel/Render/ClassyTest.php @@ -36,7 +36,7 @@ public function setUp() { /** * Test the classy theme. */ - function testClassyTheme() { + public function testClassyTheme() { drupal_set_message('An error occurred', 'error'); drupal_set_message('But then something nice happened'); $messages = [ diff --git a/core/modules/system/tests/src/Kernel/System/InfoAlterTest.php b/core/modules/system/tests/src/Kernel/System/InfoAlterTest.php index f8963273a610511a4ed563e97438b6463631e00d..ebdac3ce0dbf75ce2b97b600ca52d15046a77fe8 100644 --- a/core/modules/system/tests/src/Kernel/System/InfoAlterTest.php +++ b/core/modules/system/tests/src/Kernel/System/InfoAlterTest.php @@ -20,7 +20,7 @@ class InfoAlterTest extends KernelTestBase { * hook_system_info_alter() is enabled. Also tests if core *_list() functions * return freshly altered info. */ - function testSystemInfoAlter() { + public function testSystemInfoAlter() { \Drupal::state()->set('module_required_test.hook_system_info_alter', TRUE); $info = system_rebuild_module_data(); $this->assertFalse(isset($info['node']->info['required']), 'Before the module_required_test is installed the node module is not required.'); diff --git a/core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php b/core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php index a41b8012362ea74f1c3f68be3e516bd027e8ad03..37abdd565e7e109c261e285cdffc92924d1ee40c 100644 --- a/core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php +++ b/core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php @@ -131,7 +131,7 @@ public function query($group_by = FALSE) { $this->query->addWhere(0, "$this->tableAlias.$this->realField", $subquery, 'IN'); } - function title() { + public function title() { $term = $this->termStorage->load($this->argument); if (!empty($term)) { return $term->getName(); diff --git a/core/modules/taxonomy/src/Plugin/views/argument/Taxonomy.php b/core/modules/taxonomy/src/Plugin/views/argument/Taxonomy.php index 38e64c732d9ff3213ac78b9b49053edd07e2e8bb..25efbf35cc7307ee276abfaa3163b3612f7fd8d8 100644 --- a/core/modules/taxonomy/src/Plugin/views/argument/Taxonomy.php +++ b/core/modules/taxonomy/src/Plugin/views/argument/Taxonomy.php @@ -45,7 +45,7 @@ public static function create(ContainerInterface $container, array $configuratio /** * Override the behavior of title(). Get the title of the node. */ - function title() { + public function title() { // There might be no valid argument. if ($this->argument) { $term = $this->termStorage->load($this->argument); diff --git a/core/modules/taxonomy/src/Plugin/views/argument/VocabularyVid.php b/core/modules/taxonomy/src/Plugin/views/argument/VocabularyVid.php index 9432c7c7346c3a7c42f4c28c5dc97f17938abd78..d2fe82072d472cb7b6fdacd02197610e19d3ce8a 100644 --- a/core/modules/taxonomy/src/Plugin/views/argument/VocabularyVid.php +++ b/core/modules/taxonomy/src/Plugin/views/argument/VocabularyVid.php @@ -54,7 +54,7 @@ public static function create(ContainerInterface $container, array $configuratio /** * Override the behavior of title(). Get the name of the vocabulary. */ - function title() { + public function title() { $vocabulary = $this->vocabularyStorage->load($this->argument); if ($vocabulary) { return $vocabulary->label(); diff --git a/core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php b/core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php index 1bab4461844337fc4d588b162caafecd1eb7f1e2..367565c38757ff4cc8b2525f09aa0224cd92ef66 100644 --- a/core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php +++ b/core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php @@ -157,7 +157,7 @@ public function preRender(&$values) { } } - function render_item($count, $item) { + public function render_item($count, $item) { return $item['name']; } diff --git a/core/modules/taxonomy/src/TermTranslationHandler.php b/core/modules/taxonomy/src/TermTranslationHandler.php index 8339267c4173018a301cd4b0dd1b7281ef7f8e95..688c63e38bdd9f65ab5dfc40a5c082038447030e 100644 --- a/core/modules/taxonomy/src/TermTranslationHandler.php +++ b/core/modules/taxonomy/src/TermTranslationHandler.php @@ -26,7 +26,7 @@ public function entityFormAlter(array &$form, FormStateInterface $form_state, En * * @see \Drupal\Core\Entity\EntityForm::build() */ - function entityFormSave(array $form, FormStateInterface $form_state) { + public function entityFormSave(array $form, FormStateInterface $form_state) { if ($this->getSourceLangcode($form_state)) { $entity = $form_state->getFormObject()->getEntity(); // We need a redirect here, otherwise we would get an access denied page, diff --git a/core/modules/taxonomy/src/Tests/RssTest.php b/core/modules/taxonomy/src/Tests/RssTest.php index 315f64d5df0b0a8e2c492a625af91a37b2ff9931..81a397d69d7dcf1bb773467953eb88fa3f155aaf 100644 --- a/core/modules/taxonomy/src/Tests/RssTest.php +++ b/core/modules/taxonomy/src/Tests/RssTest.php @@ -66,7 +66,7 @@ protected function setUp() { * * Create a node and assert that taxonomy terms appear in rss.xml. */ - function testTaxonomyRss() { + public function testTaxonomyRss() { // Create two taxonomy terms. $term1 = $this->createTerm($this->vocabulary); diff --git a/core/modules/taxonomy/src/Tests/TaxonomyTermIndentationTest.php b/core/modules/taxonomy/src/Tests/TaxonomyTermIndentationTest.php index b48de1a7adfabdd3118813109af45b920348d359..fbf8515ea777a06a851f01474f1f43887e92062f 100644 --- a/core/modules/taxonomy/src/Tests/TaxonomyTermIndentationTest.php +++ b/core/modules/taxonomy/src/Tests/TaxonomyTermIndentationTest.php @@ -32,7 +32,7 @@ protected function setUp() { /** * Tests term indentation. */ - function testTermIndentation() { + public function testTermIndentation() { // Create three taxonomy terms. $term1 = $this->createTerm($this->vocabulary); $term2 = $this->createTerm($this->vocabulary); diff --git a/core/modules/taxonomy/src/Tests/TaxonomyTestTrait.php b/core/modules/taxonomy/src/Tests/TaxonomyTestTrait.php index dae42f3fe9dc71a5cd05c0cc9b9b5f2802f81f35..744ab1b28b497c5a8feb6ff9cb0b65ce912370fb 100644 --- a/core/modules/taxonomy/src/Tests/TaxonomyTestTrait.php +++ b/core/modules/taxonomy/src/Tests/TaxonomyTestTrait.php @@ -15,7 +15,7 @@ trait TaxonomyTestTrait { /** * Returns a new vocabulary with random properties. */ - function createVocabulary() { + public function createVocabulary() { // Create a vocabulary. $vocabulary = Vocabulary::create([ 'name' => $this->randomMachineName(), @@ -40,7 +40,7 @@ function createVocabulary() { * @return \Drupal\taxonomy\Entity\Term * The new taxonomy term object. */ - function createTerm(Vocabulary $vocabulary, $values = []) { + public function createTerm(Vocabulary $vocabulary, $values = []) { $filter_formats = filter_formats(); $format = array_pop($filter_formats); $term = Term::create($values + [ diff --git a/core/modules/taxonomy/src/Tests/TermTest.php b/core/modules/taxonomy/src/Tests/TermTest.php index cba983ddcdfa04bf727b7dbb1f44d4b329a9ad9a..42f92b1b4b432c751a3c3a586e102e5eb51acb4f 100644 --- a/core/modules/taxonomy/src/Tests/TermTest.php +++ b/core/modules/taxonomy/src/Tests/TermTest.php @@ -76,7 +76,7 @@ protected function setUp() { /** * Test terms in a single and multiple hierarchy. */ - function testTaxonomyTermHierarchy() { + public function testTaxonomyTermHierarchy() { // Create two taxonomy terms. $term1 = $this->createTerm($this->vocabulary); $term2 = $this->createTerm($this->vocabulary); @@ -116,7 +116,7 @@ function testTaxonomyTermHierarchy() { /** * Tests that many terms with parents show on each page */ - function testTaxonomyTermChildTerms() { + public function testTaxonomyTermChildTerms() { // Set limit to 10 terms per page. Set variable to 9 so 10 terms appear. $this->config('taxonomy.settings')->set('terms_per_page_admin', '9')->save(); $term1 = $this->createTerm($this->vocabulary); @@ -171,7 +171,7 @@ function testTaxonomyTermChildTerms() { * * Save & edit a node and assert that taxonomy terms are saved/loaded properly. */ - function testTaxonomyNode() { + public function testTaxonomyNode() { // Create two taxonomy terms. $term1 = $this->createTerm($this->vocabulary); $term2 = $this->createTerm($this->vocabulary); @@ -210,7 +210,7 @@ function testTaxonomyNode() { /** * Test term creation with a free-tagging vocabulary from the node form. */ - function testNodeTermCreationAndDeletion() { + public function testNodeTermCreationAndDeletion() { // Enable tags in the vocabulary. $field = $this->field; entity_get_form_display($field->getTargetEntityTypeId(), $field->getTargetBundle(), 'default') @@ -303,7 +303,7 @@ function testNodeTermCreationAndDeletion() { /** * Save, edit and delete a term using the user interface. */ - function testTermInterface() { + public function testTermInterface() { \Drupal::service('module_installer')->install(['views']); $edit = [ 'name[0][value]' => $this->randomMachineName(12), @@ -380,7 +380,7 @@ function testTermInterface() { /** * Save, edit and delete a term using the user interface. */ - function testTermReorder() { + public function testTermReorder() { $this->createTerm($this->vocabulary); $this->createTerm($this->vocabulary); $this->createTerm($this->vocabulary); @@ -437,7 +437,7 @@ function testTermReorder() { /** * Test saving a term with multiple parents through the UI. */ - function testTermMultipleParentsInterface() { + public function testTermMultipleParentsInterface() { // Add a new term to the vocabulary so that we can have multiple parents. $parent = $this->createTerm($this->vocabulary); @@ -466,7 +466,7 @@ function testTermMultipleParentsInterface() { /** * Test taxonomy_term_load_multiple_by_name(). */ - function testTaxonomyGetTermByName() { + public function testTaxonomyGetTermByName() { $term = $this->createTerm($this->vocabulary); // Load the term with the exact name. @@ -526,7 +526,7 @@ function testTaxonomyGetTermByName() { /** * Tests that editing and saving a node with no changes works correctly. */ - function testReSavingTags() { + public function testReSavingTags() { // Enable tags in the vocabulary. $field = $this->field; entity_get_form_display($field->getTargetEntityTypeId(), $field->getTargetBundle(), 'default') diff --git a/core/modules/taxonomy/src/Tests/TermTranslationUITest.php b/core/modules/taxonomy/src/Tests/TermTranslationUITest.php index 5e82ffc4fded30f99a844c8ce5cd42ddac8506eb..43edc156bb4a064ba393d3e650a13f93dd9e4070 100644 --- a/core/modules/taxonomy/src/Tests/TermTranslationUITest.php +++ b/core/modules/taxonomy/src/Tests/TermTranslationUITest.php @@ -100,7 +100,7 @@ public function testTranslationUI() { /** * Tests translate link on vocabulary term list. */ - function testTranslateLinkVocabularyAdminPage() { + public function testTranslateLinkVocabularyAdminPage() { $this->drupalLogin($this->drupalCreateUser(array_merge(parent::getTranslatorPermissions(), ['access administration pages', 'administer taxonomy']))); $values = [ diff --git a/core/modules/taxonomy/src/Tests/ThemeTest.php b/core/modules/taxonomy/src/Tests/ThemeTest.php index fc7f2cfcdc2f87564500780034d3edae54bfa78a..8995c809a65c4de6709deb6e4c3991e838a4327f 100644 --- a/core/modules/taxonomy/src/Tests/ThemeTest.php +++ b/core/modules/taxonomy/src/Tests/ThemeTest.php @@ -29,7 +29,7 @@ protected function setUp() { /** * Test the theme used when adding, viewing and editing taxonomy terms. */ - function testTaxonomyTermThemes() { + public function testTaxonomyTermThemes() { // Adding a term to a vocabulary is considered an administrative action and // should use the administrative theme. $vocabulary = $this->createVocabulary(); diff --git a/core/modules/taxonomy/src/Tests/Views/RelationshipNodeTermDataTest.php b/core/modules/taxonomy/src/Tests/Views/RelationshipNodeTermDataTest.php index e76d81580f34971515949098a8a041ca596354e2..4f0cb485925658752686332573182a41ab0cf6d0 100644 --- a/core/modules/taxonomy/src/Tests/Views/RelationshipNodeTermDataTest.php +++ b/core/modules/taxonomy/src/Tests/Views/RelationshipNodeTermDataTest.php @@ -18,7 +18,7 @@ class RelationshipNodeTermDataTest extends TaxonomyTestBase { */ public static $testViews = ['test_taxonomy_node_term_data']; - function testViewsHandlerRelationshipNodeTermData() { + public function testViewsHandlerRelationshipNodeTermData() { $view = Views::getView('test_taxonomy_node_term_data'); // Tests \Drupal\taxonomy\Plugin\views\relationship\NodeTermData::calculateDependencies(). $expected = [ diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php b/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php index 2e9602d892bf8d5e0abc36653a0ab819a222653b..86f67ff3de89f14af915405f05d597a90474ecc0 100644 --- a/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php +++ b/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php @@ -45,7 +45,7 @@ class TaxonomyFieldFilterTest extends ViewTestBase { */ public $termNames = []; - function setUp() { + public function setUp() { parent::setUp(); // Add two new languages. diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldTidTest.php b/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldTidTest.php index 51489ac7951f75a600f0f96db1e56ebd50580cf9..b068f083a1f676c1a4d5944514b6f4b436a30210 100644 --- a/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldTidTest.php +++ b/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldTidTest.php @@ -19,7 +19,7 @@ class TaxonomyFieldTidTest extends TaxonomyTestBase { */ public static $testViews = ['test_taxonomy_tid_field']; - function testViewsHandlerTidField() { + public function testViewsHandlerTidField() { /** @var \Drupal\Core\Render\RendererInterface $renderer */ $renderer = \Drupal::service('renderer'); diff --git a/core/modules/taxonomy/src/Tests/VocabularyUiTest.php b/core/modules/taxonomy/src/Tests/VocabularyUiTest.php index e3710d610b24b3c44bd09e4a80619bc4a92baffb..89c7a67f55478a70588cb673e6c8ab49c0754468 100644 --- a/core/modules/taxonomy/src/Tests/VocabularyUiTest.php +++ b/core/modules/taxonomy/src/Tests/VocabularyUiTest.php @@ -31,7 +31,7 @@ protected function setUp() { /** * Create, edit and delete a vocabulary via the user interface. */ - function testVocabularyInterface() { + public function testVocabularyInterface() { // Visit the main taxonomy administration page. $this->drupalGet('admin/structure/taxonomy'); @@ -84,7 +84,7 @@ function testVocabularyInterface() { /** * Changing weights on the vocabulary overview with two or more vocabularies. */ - function testTaxonomyAdminChangingWeights() { + public function testTaxonomyAdminChangingWeights() { // Create some vocabularies. for ($i = 0; $i < 10; $i++) { $this->createVocabulary(); @@ -113,7 +113,7 @@ function testTaxonomyAdminChangingWeights() { /** * Test the vocabulary overview with no vocabularies. */ - function testTaxonomyAdminNoVocabularies() { + public function testTaxonomyAdminNoVocabularies() { // Delete all vocabularies. $vocabularies = Vocabulary::loadMultiple(); foreach ($vocabularies as $key => $vocabulary) { @@ -129,7 +129,7 @@ function testTaxonomyAdminNoVocabularies() { /** * Deleting a vocabulary. */ - function testTaxonomyAdminDeletingVocabulary() { + public function testTaxonomyAdminDeletingVocabulary() { // Create a vocabulary. $vid = Unicode::strtolower($this->randomMachineName()); $edit = [ diff --git a/core/modules/taxonomy/tests/src/Functional/EfqTest.php b/core/modules/taxonomy/tests/src/Functional/EfqTest.php index 945c0b1085cd8955e74d7ee8d83c56ca0dcc0478..e78d9ec9b1a76ac439c754d092bfce6736803ef3 100644 --- a/core/modules/taxonomy/tests/src/Functional/EfqTest.php +++ b/core/modules/taxonomy/tests/src/Functional/EfqTest.php @@ -25,7 +25,7 @@ protected function setUp() { /** * Tests that a basic taxonomy entity query works. */ - function testTaxonomyEfq() { + public function testTaxonomyEfq() { $terms = []; for ($i = 0; $i < 5; $i++) { $term = $this->createTerm($this->vocabulary); diff --git a/core/modules/taxonomy/tests/src/Functional/LegacyTest.php b/core/modules/taxonomy/tests/src/Functional/LegacyTest.php index f3b0a74e090b85fbe5ad7d94f0c92f312d758562..289471533bfa1c8a9be0a1a0b3b7b4923318df54 100644 --- a/core/modules/taxonomy/tests/src/Functional/LegacyTest.php +++ b/core/modules/taxonomy/tests/src/Functional/LegacyTest.php @@ -51,7 +51,7 @@ protected function setUp() { /** * Test taxonomy functionality with nodes prior to 1970. */ - function testTaxonomyLegacyNode() { + public function testTaxonomyLegacyNode() { // Posts an article with a taxonomy term and a date prior to 1970. $date = new DrupalDateTime('1969-01-01 00:00:00'); $edit = []; diff --git a/core/modules/taxonomy/tests/src/Functional/LoadMultipleTest.php b/core/modules/taxonomy/tests/src/Functional/LoadMultipleTest.php index ce41b2ffc926c9ed904835f12f3049404e873ed0..186031cceb8fa06cfc3453c3022c91188e6b4286 100644 --- a/core/modules/taxonomy/tests/src/Functional/LoadMultipleTest.php +++ b/core/modules/taxonomy/tests/src/Functional/LoadMultipleTest.php @@ -20,7 +20,7 @@ protected function setUp() { * Create a vocabulary and some taxonomy terms, ensuring they're loaded * correctly using entity_load_multiple(). */ - function testTaxonomyTermMultipleLoad() { + public function testTaxonomyTermMultipleLoad() { // Create a vocabulary. $vocabulary = $this->createVocabulary(); diff --git a/core/modules/taxonomy/tests/src/Functional/TermEntityReferenceTest.php b/core/modules/taxonomy/tests/src/Functional/TermEntityReferenceTest.php index 2deeb417860d2374206b63a617f6cfa750f770e4..9d4522ec71edee1833880b562ed779053ca5b718 100644 --- a/core/modules/taxonomy/tests/src/Functional/TermEntityReferenceTest.php +++ b/core/modules/taxonomy/tests/src/Functional/TermEntityReferenceTest.php @@ -26,7 +26,7 @@ class TermEntityReferenceTest extends TaxonomyTestBase { * field to limit the target vocabulary to one of them, ensuring that * the restriction applies. */ - function testSelectionTestVocabularyRestriction() { + public function testSelectionTestVocabularyRestriction() { // Create two vocabularies. $vocabulary = $this->createVocabulary(); diff --git a/core/modules/taxonomy/tests/src/Functional/TermIndexTest.php b/core/modules/taxonomy/tests/src/Functional/TermIndexTest.php index 5266b8ff55e45b447146afd95761d1ab3f34684f..d4fe8f225b6fbd5b7cc9db8b010aa4d0bdb0c7a4 100644 --- a/core/modules/taxonomy/tests/src/Functional/TermIndexTest.php +++ b/core/modules/taxonomy/tests/src/Functional/TermIndexTest.php @@ -87,7 +87,7 @@ protected function setUp() { /** * Tests that the taxonomy index is maintained properly. */ - function testTaxonomyIndex() { + public function testTaxonomyIndex() { $node_storage = $this->container->get('entity.manager')->getStorage('node'); // Create terms in the vocabulary. $term_1 = $this->createTerm($this->vocabulary); @@ -197,7 +197,7 @@ function testTaxonomyIndex() { /** * Tests that there is a link to the parent term on the child term page. */ - function testTaxonomyTermHierarchyBreadcrumbs() { + public function testTaxonomyTermHierarchyBreadcrumbs() { // Create two taxonomy terms and set term2 as the parent of term1. $term1 = $this->createTerm($this->vocabulary); $term2 = $this->createTerm($this->vocabulary); diff --git a/core/modules/taxonomy/tests/src/Functional/TermLanguageTest.php b/core/modules/taxonomy/tests/src/Functional/TermLanguageTest.php index ce87396fc6404ff4b6b3a3df541605449f8242bc..fb000e99c6a96cde12b71c7f1515b29ea2c9a57a 100644 --- a/core/modules/taxonomy/tests/src/Functional/TermLanguageTest.php +++ b/core/modules/taxonomy/tests/src/Functional/TermLanguageTest.php @@ -39,7 +39,7 @@ protected function setUp() { } } - function testTermLanguage() { + public function testTermLanguage() { // Configure the vocabulary to not hide the language selector. $edit = [ 'default_language[language_alterable]' => TRUE, @@ -73,7 +73,7 @@ function testTermLanguage() { $this->assertOptionSelected('edit-langcode-0-value', $edit['langcode[0][value]'], 'The term language was correctly selected.'); } - function testDefaultTermLanguage() { + public function testDefaultTermLanguage() { // Configure the vocabulary to not hide the language selector, and make the // default language of the terms fixed. $edit = [ diff --git a/core/modules/taxonomy/tests/src/Functional/TokenReplaceTest.php b/core/modules/taxonomy/tests/src/Functional/TokenReplaceTest.php index e6836f68049b99c6a4d9bdb6148bc2d1f0b3235c..958da3bebaaed02a662071844f171751c0466ac7 100644 --- a/core/modules/taxonomy/tests/src/Functional/TokenReplaceTest.php +++ b/core/modules/taxonomy/tests/src/Functional/TokenReplaceTest.php @@ -56,7 +56,7 @@ protected function setUp() { /** * Creates some terms and a node, then tests the tokens generated from them. */ - function testTaxonomyTokenReplacement() { + public function testTaxonomyTokenReplacement() { $token_service = \Drupal::token(); $language_interface = \Drupal::languageManager()->getCurrentLanguage(); diff --git a/core/modules/taxonomy/tests/src/Functional/VocabularyCrudTest.php b/core/modules/taxonomy/tests/src/Functional/VocabularyCrudTest.php index d32fb0fd0539ade41fd0f71831cb07faa73c36c6..2ac2d9de61245fc6a700bb102fd736c8984614be 100644 --- a/core/modules/taxonomy/tests/src/Functional/VocabularyCrudTest.php +++ b/core/modules/taxonomy/tests/src/Functional/VocabularyCrudTest.php @@ -32,7 +32,7 @@ protected function setUp() { /** * Test deleting a taxonomy that contains terms. */ - function testTaxonomyVocabularyDeleteWithTerms() { + public function testTaxonomyVocabularyDeleteWithTerms() { // Delete any existing vocabularies. foreach (Vocabulary::loadMultiple() as $vocabulary) { $vocabulary->delete(); @@ -65,7 +65,7 @@ function testTaxonomyVocabularyDeleteWithTerms() { /** * Ensure that the vocabulary static reset works correctly. */ - function testTaxonomyVocabularyLoadStaticReset() { + public function testTaxonomyVocabularyLoadStaticReset() { $original_vocabulary = Vocabulary::load($this->vocabulary->id()); $this->assertTrue(is_object($original_vocabulary), 'Vocabulary loaded successfully.'); $this->assertEqual($this->vocabulary->label(), $original_vocabulary->label(), 'Vocabulary loaded successfully.'); @@ -89,7 +89,7 @@ function testTaxonomyVocabularyLoadStaticReset() { /** * Tests for loading multiple vocabularies. */ - function testTaxonomyVocabularyLoadMultiple() { + public function testTaxonomyVocabularyLoadMultiple() { // Delete any existing vocabularies. foreach (Vocabulary::loadMultiple() as $vocabulary) { @@ -141,7 +141,7 @@ function testTaxonomyVocabularyLoadMultiple() { /** * Test uninstall and reinstall of the taxonomy module. */ - function testUninstallReinstall() { + public function testUninstallReinstall() { // Field storages and fields attached to taxonomy term bundles should be // removed when the module is uninstalled. $field_name = Unicode::strtolower($this->randomMachineName() . '_field_name'); diff --git a/core/modules/taxonomy/tests/src/Functional/VocabularyLanguageTest.php b/core/modules/taxonomy/tests/src/Functional/VocabularyLanguageTest.php index 5b9cbfe8f627a58beb455bfad129091eb813f81c..f25df8a1fdcffcab27b83bc56fa762e241fc3758 100644 --- a/core/modules/taxonomy/tests/src/Functional/VocabularyLanguageTest.php +++ b/core/modules/taxonomy/tests/src/Functional/VocabularyLanguageTest.php @@ -36,7 +36,7 @@ protected function setUp() { /** * Tests language settings for vocabularies. */ - function testVocabularyLanguage() { + public function testVocabularyLanguage() { $this->drupalGet('admin/structure/taxonomy/add'); // Check that we have the language selector available. @@ -67,7 +67,7 @@ function testVocabularyLanguage() { /** * Tests term language settings for vocabulary terms are saved and updated. */ - function testVocabularyDefaultLanguageForTerms() { + public function testVocabularyDefaultLanguageForTerms() { // Add a new vocabulary and check that the default language settings are for // the terms are saved. $edit = [ diff --git a/core/modules/taxonomy/tests/src/Functional/VocabularyPermissionsTest.php b/core/modules/taxonomy/tests/src/Functional/VocabularyPermissionsTest.php index c5f1f94b4813d0c54bbca64330cda3e74a8cc326..3ba8868f5449d50f10244508a903745d3396945c 100644 --- a/core/modules/taxonomy/tests/src/Functional/VocabularyPermissionsTest.php +++ b/core/modules/taxonomy/tests/src/Functional/VocabularyPermissionsTest.php @@ -18,7 +18,7 @@ protected function setUp() { /** * Create, edit and delete a taxonomy term via the user interface. */ - function testVocabularyPermissionsTaxonomyTerm() { + public function testVocabularyPermissionsTaxonomyTerm() { // Vocabulary used for creating, removing and editing terms. $vocabulary = $this->createVocabulary(); diff --git a/core/modules/taxonomy/tests/src/Functional/VocabularyTranslationTest.php b/core/modules/taxonomy/tests/src/Functional/VocabularyTranslationTest.php index 3679b79db2b4b8dfe2abb205fd03841b25d4e781..2d312578e75504c1405e8411df8bd7a0c4f79e69 100644 --- a/core/modules/taxonomy/tests/src/Functional/VocabularyTranslationTest.php +++ b/core/modules/taxonomy/tests/src/Functional/VocabularyTranslationTest.php @@ -32,7 +32,7 @@ protected function setUp() { /** * Tests language settings for vocabularies. */ - function testVocabularyLanguage() { + public function testVocabularyLanguage() { $this->drupalGet('admin/structure/taxonomy/add'); // Check that the field to enable content translation is available. diff --git a/core/modules/telephone/tests/src/Functional/TelephoneFieldTest.php b/core/modules/telephone/tests/src/Functional/TelephoneFieldTest.php index 7256c9da39c9d1cc7fad0fb77734bd162ae640ee..18bedf0725ebeef363a0e4d65b3de06a3875bd9f 100644 --- a/core/modules/telephone/tests/src/Functional/TelephoneFieldTest.php +++ b/core/modules/telephone/tests/src/Functional/TelephoneFieldTest.php @@ -44,7 +44,7 @@ protected function setUp() { /** * Helper function for testTelephoneField(). */ - function testTelephoneField() { + public function testTelephoneField() { // Add the telephone field to the article content type. FieldStorageConfig::create([ diff --git a/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php b/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php index e50e5cb232b445bc089cab5356eb613858e70d22..f41e5b1e62ad3f8a20ddbc2e553a25cde8eef004 100644 --- a/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php +++ b/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php @@ -60,7 +60,7 @@ public function settingsSummary() { /** * {@inheritdoc} */ - function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) { + public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) { $element = parent::formElement($items, $delta, $element, $form, $form_state); $display_summary = $items[$delta]->summary || $this->getFieldSetting('display_summary'); diff --git a/core/modules/text/src/Tests/TextFieldTest.php b/core/modules/text/src/Tests/TextFieldTest.php index 5bd6d6f0257b0f06c5f412dfaeea81cd9438158f..d061c00f1ebced89f2874ae7accebc9ae5e9fe08 100644 --- a/core/modules/text/src/Tests/TextFieldTest.php +++ b/core/modules/text/src/Tests/TextFieldTest.php @@ -34,7 +34,7 @@ protected function setUp() { /** * Test text field validation. */ - function testTextFieldValidation() { + public function testTextFieldValidation() { // Create a field with settings to validate. $max_length = 3; $field_name = Unicode::strtolower($this->randomMachineName()); @@ -69,7 +69,7 @@ function testTextFieldValidation() { /** * Test required long text with file upload. */ - function testRequiredLongTextWithFileUpload() { + public function testRequiredLongTextWithFileUpload() { // Create a text field. $text_field_name = 'text_long'; $field_storage = FieldStorageConfig::create([ @@ -128,7 +128,7 @@ function testRequiredLongTextWithFileUpload() { /** * Test widgets. */ - function testTextfieldWidgets() { + public function testTextfieldWidgets() { $this->_testTextfieldWidgets('text', 'text_textfield'); $this->_testTextfieldWidgets('text_long', 'text_textarea'); } @@ -136,7 +136,7 @@ function testTextfieldWidgets() { /** * Test widgets + 'formatted_text' setting. */ - function testTextfieldWidgetsFormatted() { + public function testTextfieldWidgetsFormatted() { $this->_testTextfieldWidgetsFormatted('text', 'text_textfield'); $this->_testTextfieldWidgetsFormatted('text_long', 'text_textarea'); } @@ -144,7 +144,7 @@ function testTextfieldWidgetsFormatted() { /** * Helper function for testTextfieldWidgetsFormatted(). */ - function _testTextfieldWidgetsFormatted($field_type, $widget_type) { + public function _testTextfieldWidgetsFormatted($field_type, $widget_type) { /** @var \Drupal\Core\Render\RendererInterface $renderer */ $renderer = $this->container->get('renderer'); diff --git a/core/modules/text/tests/src/Kernel/TextSummaryTest.php b/core/modules/text/tests/src/Kernel/TextSummaryTest.php index 62464e3dc5a9c00cdc195e090871ada70afd9d61..15d4549472b30cf5eceabb47fc3b1cb8e8f40965 100644 --- a/core/modules/text/tests/src/Kernel/TextSummaryTest.php +++ b/core/modules/text/tests/src/Kernel/TextSummaryTest.php @@ -25,7 +25,7 @@ protected function setUp() { * subsequent sentences are not. This edge case is documented at * https://www.drupal.org/node/180425. */ - function testFirstSentenceQuestion() { + public function testFirstSentenceQuestion() { $text = 'A question? A sentence. Another sentence.'; $expected = 'A question? A sentence.'; $this->assertTextSummary($text, $expected, NULL, 30); @@ -34,7 +34,7 @@ function testFirstSentenceQuestion() { /** * Test summary with long example. */ - function testLongSentence() { + public function testLongSentence() { $text = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ' . // 125 'Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. ' . // 108 'Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ' . // 103 @@ -49,7 +49,7 @@ function testLongSentence() { /** * Test various summary length edge cases. */ - function testLength() { + public function testLength() { FilterFormat::create([ 'format' => 'autop', 'filters' => [ @@ -205,7 +205,7 @@ function testLength() { /** * Calls text_summary() and asserts that the expected teaser is returned. */ - function assertTextSummary($text, $expected, $format = NULL, $size = NULL) { + public function assertTextSummary($text, $expected, $format = NULL, $size = NULL) { $summary = text_summary($text, $format, $size); $this->assertIdentical($summary, $expected, format_string('
@actual
is identical to
@expected
', [ '@actual' => $summary, diff --git a/core/modules/toolbar/src/Tests/ToolbarAdminMenuTest.php b/core/modules/toolbar/src/Tests/ToolbarAdminMenuTest.php index b5435dc3c735a3b439d7d5c5fa3f4e3a0c35dfff..dd4b5c43cfafa15cb501383eb5696f23de1f4ae1 100644 --- a/core/modules/toolbar/src/Tests/ToolbarAdminMenuTest.php +++ b/core/modules/toolbar/src/Tests/ToolbarAdminMenuTest.php @@ -97,7 +97,7 @@ protected function setUp() { * Tests the toolbar_modules_installed() and toolbar_modules_uninstalled() hook * implementations. */ - function testModuleStatusChangeSubtreesHashCacheClear() { + public function testModuleStatusChangeSubtreesHashCacheClear() { // Uninstall a module. $edit = []; $edit['uninstall[taxonomy]'] = TRUE; @@ -124,7 +124,7 @@ function testModuleStatusChangeSubtreesHashCacheClear() { /** * Tests toolbar cache tags implementation. */ - function testMenuLinkUpdateSubtreesHashCacheClear() { + public function testMenuLinkUpdateSubtreesHashCacheClear() { // The ID of a (any) admin menu link. $admin_menu_link_id = 'system.admin_config_development'; @@ -144,7 +144,7 @@ function testMenuLinkUpdateSubtreesHashCacheClear() { * Exercises the toolbar_user_role_update() and toolbar_user_update() hook * implementations. */ - function testUserRoleUpdateSubtreesHashCacheClear() { + public function testUserRoleUpdateSubtreesHashCacheClear() { // Find the new role ID. $all_rids = $this->adminUser->getRoles(); unset($all_rids[array_search(RoleInterface::AUTHENTICATED_ID, $all_rids)]); @@ -208,7 +208,7 @@ function testUserRoleUpdateSubtreesHashCacheClear() { * Tests that changes to a user account by another user clears the changed * account's toolbar cached, not the user's who took the action. */ - function testNonCurrentUserAccountUpdates() { + public function testNonCurrentUserAccountUpdates() { $admin_user_id = $this->adminUser->id(); $this->hash = $this->getSubtreesHash(); @@ -243,7 +243,7 @@ function testNonCurrentUserAccountUpdates() { /** * Tests that toolbar cache is cleared when string translations are made. */ - function testLocaleTranslationSubtreesHashCacheClear() { + public function testLocaleTranslationSubtreesHashCacheClear() { $admin_user = $this->adminUser; // User to translate and delete string. $translate_user = $this->drupalCreateUser(['translate interface', 'access administration pages']); @@ -324,7 +324,7 @@ function testLocaleTranslationSubtreesHashCacheClear() { /** * Tests that the 'toolbar/subtrees/{hash}' is reachable and correct. */ - function testSubtreesJsonRequest() { + public function testSubtreesJsonRequest() { $admin_user = $this->adminUser; $this->drupalLogin($admin_user); // Request a new page to refresh the drupalSettings object. @@ -339,7 +339,7 @@ function testSubtreesJsonRequest() { /** * Test that subtrees hashes vary by the language of the page. */ - function testLanguageSwitching() { + public function testLanguageSwitching() { // Create a new language with the langcode 'xx'. $langcode = 'xx'; $language = ConfigurableLanguage::createFromLangcode($langcode); diff --git a/core/modules/toolbar/src/Tests/ToolbarMenuTranslationTest.php b/core/modules/toolbar/src/Tests/ToolbarMenuTranslationTest.php index a98dacfcd4f9fba886b36ed4618effaadf5501d6..f4d6a114187091d8612bd4d3fbfbf9ff6abe5778 100644 --- a/core/modules/toolbar/src/Tests/ToolbarMenuTranslationTest.php +++ b/core/modules/toolbar/src/Tests/ToolbarMenuTranslationTest.php @@ -36,7 +36,7 @@ protected function setUp() { /** * Tests that toolbar classes don't change when adding a translation. */ - function testToolbarClasses() { + public function testToolbarClasses() { $langcode = 'es'; // Add Spanish. diff --git a/core/modules/toolbar/tests/src/Functional/ToolbarHookToolbarTest.php b/core/modules/toolbar/tests/src/Functional/ToolbarHookToolbarTest.php index 6369946fc9d29048e090eea436feecea48311045..f3d3ce6118db27e2dac1d28dfc5f1fd07f7cdbd8 100644 --- a/core/modules/toolbar/tests/src/Functional/ToolbarHookToolbarTest.php +++ b/core/modules/toolbar/tests/src/Functional/ToolbarHookToolbarTest.php @@ -36,7 +36,7 @@ protected function setUp() { /** * Tests for a tab and tray provided by a module implementing hook_toolbar(). */ - function testHookToolbar() { + public function testHookToolbar() { $this->drupalGet('test-page'); $this->assertResponse(200); diff --git a/core/modules/tracker/src/Tests/TrackerTest.php b/core/modules/tracker/src/Tests/TrackerTest.php index 2ac7cef9a0a9bc69385fe65b38bba755a953fcae..fa95299b9a9851a6bbd6327697254ff799a5c4e3 100644 --- a/core/modules/tracker/src/Tests/TrackerTest.php +++ b/core/modules/tracker/src/Tests/TrackerTest.php @@ -63,7 +63,7 @@ protected function setUp() { /** * Tests for the presence of nodes on the global tracker listing. */ - function testTrackerAll() { + public function testTrackerAll() { $this->drupalLogin($this->user); $unpublished = $this->drupalCreateNode([ @@ -129,7 +129,7 @@ function testTrackerAll() { /** * Tests for the presence of nodes on a user's tracker listing. */ - function testTrackerUser() { + public function testTrackerUser() { $this->drupalLogin($this->user); $unpublished = $this->drupalCreateNode([ @@ -223,7 +223,7 @@ function testTrackerUser() { /** * Tests the metadata for the "new"/"updated" indicators. */ - function testTrackerHistoryMetadata() { + public function testTrackerHistoryMetadata() { $this->drupalLogin($this->user); // Create a page node. @@ -274,7 +274,7 @@ function testTrackerHistoryMetadata() { /** * Tests for ordering on a users tracker listing when comments are posted. */ - function testTrackerOrderingNewComments() { + public function testTrackerOrderingNewComments() { $this->drupalLogin($this->user); $node_one = $this->drupalCreateNode([ @@ -340,7 +340,7 @@ function testTrackerOrderingNewComments() { /** * Tests that existing nodes are indexed by cron. */ - function testTrackerCronIndexing() { + public function testTrackerCronIndexing() { $this->drupalLogin($this->user); // Create 3 nodes. @@ -393,7 +393,7 @@ function testTrackerCronIndexing() { /** * Tests that publish/unpublish works at admin/content/node. */ - function testTrackerAdminUnpublish() { + public function testTrackerAdminUnpublish() { \Drupal::service('module_installer')->install(['views']); \Drupal::service('router.builder')->rebuild(); $admin_user = $this->drupalCreateUser(['access content overview', 'administer nodes', 'bypass node access']); @@ -438,7 +438,7 @@ function testTrackerAdminUnpublish() { * @param bool $library_is_present * Whether the drupal.tracker-history library should be present or not. */ - function assertHistoryMetadata($node_id, $node_timestamp, $node_last_comment_timestamp, $library_is_present = TRUE) { + public function assertHistoryMetadata($node_id, $node_timestamp, $node_last_comment_timestamp, $library_is_present = TRUE) { $settings = $this->getDrupalSettings(); $this->assertIdentical($library_is_present, isset($settings['ajaxPageState']) && in_array('tracker/history', explode(',', $settings['ajaxPageState']['libraries'])), 'drupal.tracker-history library is present.'); $this->assertIdentical(1, count($this->xpath('//table/tbody/tr/td[@data-history-node-id="' . $node_id . '" and @data-history-node-timestamp="' . $node_timestamp . '"]')), 'Tracker table cell contains the data-history-node-id and data-history-node-timestamp attributes for the node.'); diff --git a/core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php b/core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php index ae9a6e0ebb9de5f4c99fd21969301e0437fbc9df..2b320ae4b6dfde17118310d8128ee9b3d45b7a71 100644 --- a/core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php +++ b/core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php @@ -35,7 +35,7 @@ protected function setUp() { /** * Ensure private node on /tracker is only visible to users with permission. */ - function testTrackerNodeAccess() { + public function testTrackerNodeAccess() { // Create user with node test view permission. $access_user = $this->drupalCreateUser(['node test view', 'access user profiles']); diff --git a/core/modules/update/src/Tests/UpdateContribTest.php b/core/modules/update/src/Tests/UpdateContribTest.php index 2a7c675cc5e0bc7d65f75915601357c339a99f42..81f7117a3ac40ba30d1e8ef8bc68ec83781d8893 100644 --- a/core/modules/update/src/Tests/UpdateContribTest.php +++ b/core/modules/update/src/Tests/UpdateContribTest.php @@ -29,7 +29,7 @@ protected function setUp() { /** * Tests when there is no available release data for a contrib module. */ - function testNoReleasesAvailable() { + public function testNoReleasesAvailable() { $system_info = [ '#all' => [ 'version' => '8.0.0', @@ -60,7 +60,7 @@ function testNoReleasesAvailable() { /** * Tests the basic functionality of a contrib module on the status report. */ - function testUpdateContribBasic() { + public function testUpdateContribBasic() { $project_link = \Drupal::l(t('AAA Update test'), Url::fromUri('http://example.com/project/aaa_update_test')); $system_info = [ '#all' => [ @@ -122,7 +122,7 @@ function testUpdateContribBasic() { * if you sort alphabetically by module name (which is the order we see things * inside system_rebuild_module_data() for example). */ - function testUpdateContribOrder() { + public function testUpdateContribOrder() { // We want core to be version 8.0.0. $system_info = [ '#all' => [ @@ -184,7 +184,7 @@ function testUpdateContribOrder() { /** * Tests that subthemes are notified about security updates for base themes. */ - function testUpdateBaseThemeSecurityUpdate() { + public function testUpdateBaseThemeSecurityUpdate() { // @todo https://www.drupal.org/node/2338175 base themes have to be // installed. // Only install the subtheme, not the base theme. @@ -226,7 +226,7 @@ function testUpdateBaseThemeSecurityUpdate() { * @todo https://www.drupal.org/node/2338175 extensions can not be hidden and * base themes have to be installed. */ - function testUpdateShowDisabledThemes() { + public function testUpdateShowDisabledThemes() { $update_settings = $this->config('update.settings'); // Make sure all the update_test_* themes are disabled. $extension_config = $this->config('core.extension'); @@ -291,7 +291,7 @@ function testUpdateShowDisabledThemes() { /** * Tests updates with a hidden base theme. */ - function testUpdateHiddenBaseTheme() { + public function testUpdateHiddenBaseTheme() { module_load_include('compare.inc', 'update'); // Install the subtheme. @@ -322,7 +322,7 @@ function testUpdateHiddenBaseTheme() { /** * Makes sure that if we fetch from a broken URL, sane things happen. */ - function testUpdateBrokenFetchURL() { + public function testUpdateBrokenFetchURL() { $system_info = [ '#all' => [ 'version' => '8.0.0', @@ -386,7 +386,7 @@ function testUpdateBrokenFetchURL() { * hook_update_status_alter() to try to mark this as missing a security * update, then assert if we see the appropriate warnings on the right pages. */ - function testHookUpdateStatusAlter() { + public function testHookUpdateStatusAlter() { $update_test_config = $this->config('update_test.settings'); $update_admin_user = $this->drupalCreateUser(['administer site configuration', 'administer software updates']); $this->drupalLogin($update_admin_user); diff --git a/core/modules/update/src/Tests/UpdateCoreTest.php b/core/modules/update/src/Tests/UpdateCoreTest.php index 48b3fcdcd989bff24a68317d3d4e9d038501be01..b6287c7c04d4eafc693952a0a5bb06ebb5105e94 100644 --- a/core/modules/update/src/Tests/UpdateCoreTest.php +++ b/core/modules/update/src/Tests/UpdateCoreTest.php @@ -44,7 +44,7 @@ protected function setSystemInfo($version) { /** * Tests the Update Manager module when no updates are available. */ - function testNoUpdatesAvailable() { + public function testNoUpdatesAvailable() { foreach ([0, 1] as $minor_version) { foreach ([0, 1] as $patch_version) { foreach (['-alpha1', '-beta1', ''] as $extra_version) { @@ -63,7 +63,7 @@ function testNoUpdatesAvailable() { /** * Tests the Update Manager module when one normal update is available. */ - function testNormalUpdateAvailable() { + public function testNormalUpdateAvailable() { $this->setSystemInfo('8.0.0'); // Ensure that the update check requires a token. @@ -130,7 +130,7 @@ function testNormalUpdateAvailable() { /** * Tests the Update Manager module when a major update is available. */ - function testMajorUpdateAvailable() { + public function testMajorUpdateAvailable() { foreach ([0, 1] as $minor_version) { foreach ([0, 1] as $patch_version) { foreach (['-alpha1', '-beta1', ''] as $extra_version) { @@ -156,7 +156,7 @@ function testMajorUpdateAvailable() { /** * Tests the Update Manager module when a security update is available. */ - function testSecurityUpdateAvailable() { + public function testSecurityUpdateAvailable() { foreach ([0, 1] as $minor_version) { $this->setSystemInfo("8.$minor_version.0"); $this->refreshUpdateStatus(['drupal' => "$minor_version.2-sec"]); @@ -174,7 +174,7 @@ function testSecurityUpdateAvailable() { /** * Ensures proper results where there are date mismatches among modules. */ - function testDatestampMismatch() { + public function testDatestampMismatch() { $system_info = [ '#all' => [ // We need to think we're running a -dev snapshot to see dates. @@ -197,7 +197,7 @@ function testDatestampMismatch() { /** * Checks that running cron updates the list of available updates. */ - function testModulePageRunCron() { + public function testModulePageRunCron() { $this->setSystemInfo('8.0.0'); $this->config('update.settings') ->set('fetch.url', Url::fromRoute('update_test.update_test')->setAbsolute()->toString()) @@ -214,7 +214,7 @@ function testModulePageRunCron() { /** * Checks the messages at admin/modules when the site is up to date. */ - function testModulePageUpToDate() { + public function testModulePageUpToDate() { $this->setSystemInfo('8.0.0'); // Instead of using refreshUpdateStatus(), set these manually. $this->config('update.settings') @@ -235,7 +235,7 @@ function testModulePageUpToDate() { /** * Checks the messages at admin/modules when an update is missing. */ - function testModulePageRegularUpdate() { + public function testModulePageRegularUpdate() { $this->setSystemInfo('8.0.0'); // Instead of using refreshUpdateStatus(), set these manually. $this->config('update.settings') @@ -256,7 +256,7 @@ function testModulePageRegularUpdate() { /** * Checks the messages at admin/modules when a security update is missing. */ - function testModulePageSecurityUpdate() { + public function testModulePageSecurityUpdate() { $this->setSystemInfo('8.0.0'); // Instead of using refreshUpdateStatus(), set these manually. $this->config('update.settings') @@ -295,7 +295,7 @@ function testModulePageSecurityUpdate() { /** * Tests the Update Manager module when the update server returns 503 errors. */ - function testServiceUnavailable() { + public function testServiceUnavailable() { $this->refreshUpdateStatus([], '503-error'); // Ensure that no "Warning: SimpleXMLElement..." parse errors are found. $this->assertNoText('SimpleXMLElement'); @@ -305,7 +305,7 @@ function testServiceUnavailable() { /** * Tests that exactly one fetch task per project is created and not more. */ - function testFetchTasks() { + public function testFetchTasks() { $projecta = [ 'name' => 'aaa_update_test', ]; @@ -331,7 +331,7 @@ function testFetchTasks() { /** * Checks language module in core package at admin/reports/updates. */ - function testLanguageModuleUpdate() { + public function testLanguageModuleUpdate() { $this->setSystemInfo('8.0.0'); // Instead of using refreshUpdateStatus(), set these manually. $this->config('update.settings') diff --git a/core/modules/update/src/Tests/UpdateDeleteFileIfStaleTest.php b/core/modules/update/src/Tests/UpdateDeleteFileIfStaleTest.php index 96f3ca8274e8e068bcd7f14ad5f9650bc8347fb4..99499d77c26a33ae12b2cab8948ba210780f4a3b 100644 --- a/core/modules/update/src/Tests/UpdateDeleteFileIfStaleTest.php +++ b/core/modules/update/src/Tests/UpdateDeleteFileIfStaleTest.php @@ -26,7 +26,7 @@ protected function setUp() { /** * Tests the deletion of stale files. */ - function testUpdateDeleteFileIfStale() { + public function testUpdateDeleteFileIfStale() { $file_name = file_unmanaged_save_data($this->randomMachineName()); $this->assertNotNull($file_name); diff --git a/core/modules/update/src/Tests/UpdateUploadTest.php b/core/modules/update/src/Tests/UpdateUploadTest.php index c3de290d117eb5ac040b968cabe85bfaad9b2fda..80d3f15d29f0ebd69e1fe63cc677241e69e4c49e 100644 --- a/core/modules/update/src/Tests/UpdateUploadTest.php +++ b/core/modules/update/src/Tests/UpdateUploadTest.php @@ -129,7 +129,7 @@ public function testUploadModule() { /** * Ensures that archiver extensions are properly merged in the UI. */ - function testFileNameExtensionMerging() { + public function testFileNameExtensionMerging() { $this->drupalGet('admin/modules/install'); // Make sure the bogus extension supported by update_test.module is there. $this->assertPattern('/file extensions are supported:.*update-test-extension/', "Found 'update-test-extension' extension."); @@ -140,7 +140,7 @@ function testFileNameExtensionMerging() { /** * Checks the messages on update manager pages when missing a security update. */ - function testUpdateManagerCoreSecurityUpdateMessages() { + public function testUpdateManagerCoreSecurityUpdateMessages() { $setting = [ '#all' => [ 'version' => '8.0.0', diff --git a/core/modules/user/src/Entity/User.php b/core/modules/user/src/Entity/User.php index 66a49543dfb72174646598537844e7c4738e2474..7529532581e9ee847dee6789f214c800dba3b5bc 100644 --- a/core/modules/user/src/Entity/User.php +++ b/core/modules/user/src/Entity/User.php @@ -308,7 +308,7 @@ public function getTimeZone() { /** * {@inheritdoc} */ - function getPreferredLangcode($fallback_to_default = TRUE) { + public function getPreferredLangcode($fallback_to_default = TRUE) { $language_list = $this->languageManager()->getLanguages(); $preferred_langcode = $this->get('preferred_langcode')->value; if (!empty($preferred_langcode) && isset($language_list[$preferred_langcode])) { @@ -322,7 +322,7 @@ function getPreferredLangcode($fallback_to_default = TRUE) { /** * {@inheritdoc} */ - function getPreferredAdminLangcode($fallback_to_default = TRUE) { + public function getPreferredAdminLangcode($fallback_to_default = TRUE) { $language_list = $this->languageManager()->getLanguages(); $preferred_langcode = $this->get('preferred_admin_langcode')->value; if (!empty($preferred_langcode) && isset($language_list[$preferred_langcode])) { diff --git a/core/modules/user/src/Form/UserPermissionsForm.php b/core/modules/user/src/Form/UserPermissionsForm.php index 0b3da3b8a76e5dcfd27b7551e2bfbf1f1f0d7150..3c5e46b0db41c4d1f9ade2c0206b590efb3129ec 100644 --- a/core/modules/user/src/Form/UserPermissionsForm.php +++ b/core/modules/user/src/Form/UserPermissionsForm.php @@ -192,7 +192,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { /** * {@inheritdoc} */ - function submitForm(array &$form, FormStateInterface $form_state) { + public function submitForm(array &$form, FormStateInterface $form_state) { foreach ($form_state->getValue('role_names') as $role_name => $name) { user_role_change_permissions($role_name, (array) $form_state->getValue($role_name)); } diff --git a/core/modules/user/src/Plugin/views/field/Permissions.php b/core/modules/user/src/Plugin/views/field/Permissions.php index ecba8df9309b6aa27663525e19344600bbd1fd9b..71aef59756742a224a123b03e294dc5e74911f60 100644 --- a/core/modules/user/src/Plugin/views/field/Permissions.php +++ b/core/modules/user/src/Plugin/views/field/Permissions.php @@ -105,7 +105,7 @@ public function preRender(&$values) { } } - function render_item($count, $item) { + public function render_item($count, $item) { return $item['permission']; } diff --git a/core/modules/user/src/Plugin/views/field/Roles.php b/core/modules/user/src/Plugin/views/field/Roles.php index bb7dc20977960f707ec0495dad9e89c132b946e9..e7d9495bcadd636a6fee21ef050993b552bdae99 100644 --- a/core/modules/user/src/Plugin/views/field/Roles.php +++ b/core/modules/user/src/Plugin/views/field/Roles.php @@ -90,7 +90,7 @@ public function preRender(&$values) { } } - function render_item($count, $item) { + public function render_item($count, $item) { return $item['role']; } diff --git a/core/modules/user/src/Plugin/views/filter/Roles.php b/core/modules/user/src/Plugin/views/filter/Roles.php index b04e1b1f51742b5be8cbfa5e3220cbc5a5e2e484..d84e3240949b31ed99fc362c3a958d3f616fbdf7 100644 --- a/core/modules/user/src/Plugin/views/filter/Roles.php +++ b/core/modules/user/src/Plugin/views/filter/Roles.php @@ -62,7 +62,7 @@ public function getValueOptions() { /** * Override empty and not empty operator labels to be clearer for user roles. */ - function operators() { + public function operators() { $operators = parent::operators(); $operators['empty']['title'] = $this->t("Only has the 'authenticated user' role"); $operators['not empty']['title'] = $this->t("Has roles in addition to 'authenticated user'"); diff --git a/core/modules/user/src/PrivateTempStoreFactory.php b/core/modules/user/src/PrivateTempStoreFactory.php index acbf41bc5ddf0e101f75b715f1c319b552105534..063a9207cf3644a54c538b7b7c7a982d5e2d91a2 100644 --- a/core/modules/user/src/PrivateTempStoreFactory.php +++ b/core/modules/user/src/PrivateTempStoreFactory.php @@ -61,7 +61,7 @@ class PrivateTempStoreFactory { * @param int $expire * The time to live for items, in seconds. */ - function __construct(KeyValueExpirableFactoryInterface $storage_factory, LockBackendInterface $lock_backend, AccountProxyInterface $current_user, RequestStack $request_stack, $expire = 604800) { + public function __construct(KeyValueExpirableFactoryInterface $storage_factory, LockBackendInterface $lock_backend, AccountProxyInterface $current_user, RequestStack $request_stack, $expire = 604800) { $this->storageFactory = $storage_factory; $this->lockBackend = $lock_backend; $this->currentUser = $current_user; @@ -79,7 +79,7 @@ function __construct(KeyValueExpirableFactoryInterface $storage_factory, LockBac * @return \Drupal\user\PrivateTempStore * An instance of the key/value store. */ - function get($collection) { + public function get($collection) { // Store the data for this collection in the database. $storage = $this->storageFactory->get("user.private_tempstore.$collection"); return new PrivateTempStore($storage, $this->lockBackend, $this->currentUser, $this->requestStack, $this->expire); diff --git a/core/modules/user/src/SharedTempStoreFactory.php b/core/modules/user/src/SharedTempStoreFactory.php index 662ef47aaf9ed1ccb7c4530e1e829eb8dd2ed530..c1c48a93b5b0e68c23d50f9004f44b99e536a313 100644 --- a/core/modules/user/src/SharedTempStoreFactory.php +++ b/core/modules/user/src/SharedTempStoreFactory.php @@ -51,7 +51,7 @@ class SharedTempStoreFactory { * @param int $expire * The time to live for items, in seconds. */ - function __construct(KeyValueExpirableFactoryInterface $storage_factory, LockBackendInterface $lock_backend, RequestStack $request_stack, $expire = 604800) { + public function __construct(KeyValueExpirableFactoryInterface $storage_factory, LockBackendInterface $lock_backend, RequestStack $request_stack, $expire = 604800) { $this->storageFactory = $storage_factory; $this->lockBackend = $lock_backend; $this->requestStack = $request_stack; @@ -72,7 +72,7 @@ function __construct(KeyValueExpirableFactoryInterface $storage_factory, LockBac * @return \Drupal\user\SharedTempStore * An instance of the key/value store. */ - function get($collection, $owner = NULL) { + public function get($collection, $owner = NULL) { // Use the currently authenticated user ID or the active user ID unless // the owner is overridden. if (!isset($owner)) { diff --git a/core/modules/user/src/Tests/UserAccountLinksTest.php b/core/modules/user/src/Tests/UserAccountLinksTest.php index 7f456c4a055cb090ff148e2bba01565f838c1b18..15a4b205e7e88553d27f5f151f5399b4872c202c 100644 --- a/core/modules/user/src/Tests/UserAccountLinksTest.php +++ b/core/modules/user/src/Tests/UserAccountLinksTest.php @@ -31,7 +31,7 @@ protected function setUp() { /** * Tests the secondary menu. */ - function testSecondaryMenu() { + public function testSecondaryMenu() { // Create a regular user. $user = $this->drupalCreateUser([]); @@ -71,7 +71,7 @@ function testSecondaryMenu() { /** * Tests disabling the 'My account' link. */ - function testDisabledAccountLink() { + public function testDisabledAccountLink() { // Create an admin user and log in. $this->drupalLogin($this->drupalCreateUser(['access administration pages', 'administer menu'])); @@ -110,7 +110,7 @@ function testDisabledAccountLink() { /** * Tests page title is set correctly on user account tabs. */ - function testAccountPageTitles() { + public function testAccountPageTitles() { // Default page titles are suffixed with the site name - Drupal. $title_suffix = ' | Drupal'; diff --git a/core/modules/user/src/Tests/UserAdminLanguageTest.php b/core/modules/user/src/Tests/UserAdminLanguageTest.php index 87bf835f617e0797a2e559b683c1e89e03cefaee..cd6cc657bf0d2a071ac80f54376448487fbfc1f7 100644 --- a/core/modules/user/src/Tests/UserAdminLanguageTest.php +++ b/core/modules/user/src/Tests/UserAdminLanguageTest.php @@ -44,7 +44,7 @@ protected function setUp() { /** * Tests that admin language is not configurable in single language sites. */ - function testUserAdminLanguageConfigurationNotAvailableWithOnlyOneLanguage() { + public function testUserAdminLanguageConfigurationNotAvailableWithOnlyOneLanguage() { $this->drupalLogin($this->adminUser); $this->setLanguageNegotiation(); $path = 'user/' . $this->adminUser->id() . '/edit'; @@ -56,7 +56,7 @@ function testUserAdminLanguageConfigurationNotAvailableWithOnlyOneLanguage() { /** * Tests that admin language negotiation is configurable only if enabled. */ - function testUserAdminLanguageConfigurationAvailableWithAdminLanguageNegotiation() { + public function testUserAdminLanguageConfigurationAvailableWithAdminLanguageNegotiation() { $this->drupalLogin($this->adminUser); $this->addCustomLanguage(); $path = 'user/' . $this->adminUser->id() . '/edit'; @@ -83,7 +83,7 @@ function testUserAdminLanguageConfigurationAvailableWithAdminLanguageNegotiation * have a setting for pages they cannot access, so they should not be able to * set a language for those pages. */ - function testUserAdminLanguageConfigurationAvailableIfAdminLanguageNegotiationIsEnabled() { + public function testUserAdminLanguageConfigurationAvailableIfAdminLanguageNegotiationIsEnabled() { $this->drupalLogin($this->adminUser); // Adds a new language, because with only one language, setting won't show. $this->addCustomLanguage(); @@ -103,7 +103,7 @@ function testUserAdminLanguageConfigurationAvailableIfAdminLanguageNegotiationIs /** * Tests the actual language negotiation. */ - function testActualNegotiation() { + public function testActualNegotiation() { $this->drupalLogin($this->adminUser); $this->addCustomLanguage(); $this->setLanguageNegotiation(); @@ -155,7 +155,7 @@ function testActualNegotiation() { * @param bool $admin_first * Whether the admin negotiation should be first. */ - function setLanguageNegotiation($admin_first = FALSE) { + public function setLanguageNegotiation($admin_first = FALSE) { $edit = [ 'language_interface[enabled][language-user-admin]' => TRUE, 'language_interface[enabled][language-url]' => TRUE, @@ -168,7 +168,7 @@ function setLanguageNegotiation($admin_first = FALSE) { /** * Helper method for adding a custom language. */ - function addCustomLanguage() { + public function addCustomLanguage() { $langcode = 'xx'; // The English name for the language. $name = $this->randomMachineName(16); diff --git a/core/modules/user/src/Tests/UserAdminTest.php b/core/modules/user/src/Tests/UserAdminTest.php index 6c83016cde7246c601a81560ed43742ba3b24caa..f3ee85a97be03c9385a4db7b21856775ca2038d2 100644 --- a/core/modules/user/src/Tests/UserAdminTest.php +++ b/core/modules/user/src/Tests/UserAdminTest.php @@ -22,7 +22,7 @@ class UserAdminTest extends WebTestBase { /** * Registers a user and deletes it. */ - function testUserAdmin() { + public function testUserAdmin() { $config = $this->config('user.settings'); $user_a = $this->drupalCreateUser(); $user_a->name = 'User A'; @@ -149,7 +149,7 @@ function testUserAdmin() { /** * Tests the alternate notification email address for user mails. */ - function testNotificationEmailAddress() { + public function testNotificationEmailAddress() { // Test that the Notification Email address field is on the config page. $admin_user = $this->drupalCreateUser(['administer users', 'administer account settings']); $this->drupalLogin($admin_user); diff --git a/core/modules/user/src/Tests/UserBlocksTest.php b/core/modules/user/src/Tests/UserBlocksTest.php index beb263b23e600343bdf084c0ee56919dd24b350b..1495b20b08b71b4d2a054e4b2afea4c7929deed2 100644 --- a/core/modules/user/src/Tests/UserBlocksTest.php +++ b/core/modules/user/src/Tests/UserBlocksTest.php @@ -37,7 +37,7 @@ protected function setUp() { /** * Tests that user login block is hidden from user/login. */ - function testUserLoginBlockVisibility() { + public function testUserLoginBlockVisibility() { // Array keyed list where key being the URL address and value being expected // visibility as boolean type. $paths = [ @@ -61,7 +61,7 @@ function testUserLoginBlockVisibility() { /** * Test the user login block. */ - function testUserLoginBlock() { + public function testUserLoginBlock() { // Create a user with some permission that anonymous users lack. $user = $this->drupalCreateUser(['administer permissions']); @@ -103,7 +103,7 @@ function testUserLoginBlock() { /** * Test the Who's Online block. */ - function testWhosOnlineBlock() { + public function testWhosOnlineBlock() { $block = $this->drupalPlaceBlock('views_block:who_s_online-who_s_online_block'); // Generate users. diff --git a/core/modules/user/src/Tests/UserCancelTest.php b/core/modules/user/src/Tests/UserCancelTest.php index 6cfd5baf1a050f3af14834d184be22bcf9d18efb..a74626e16e85a1982eace250157a4e63ed164c9c 100644 --- a/core/modules/user/src/Tests/UserCancelTest.php +++ b/core/modules/user/src/Tests/UserCancelTest.php @@ -33,7 +33,7 @@ protected function setUp() { /** * Attempt to cancel account without permission. */ - function testUserCancelWithoutPermission() { + public function testUserCancelWithoutPermission() { $node_storage = $this->container->get('entity.manager')->getStorage('node'); $this->config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save(); $user_storage = $this->container->get('entity.manager')->getStorage('user'); @@ -94,7 +94,7 @@ public function testUserCancelChangePermission() { * This should never be possible, or the site owner would become unable to * administer the site. */ - function testUserCancelUid1() { + public function testUserCancelUid1() { $user_storage = $this->container->get('entity.manager')->getStorage('user'); \Drupal::service('module_installer')->install(['views']); @@ -135,7 +135,7 @@ function testUserCancelUid1() { /** * Attempt invalid account cancellations. */ - function testUserCancelInvalid() { + public function testUserCancelInvalid() { $node_storage = $this->container->get('entity.manager')->getStorage('node'); $this->config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save(); $user_storage = $this->container->get('entity.manager')->getStorage('user'); @@ -183,7 +183,7 @@ function testUserCancelInvalid() { /** * Disable account and keep all content. */ - function testUserBlock() { + public function testUserBlock() { $this->config('user.settings')->set('cancel_method', 'user_cancel_block')->save(); $user_storage = $this->container->get('entity.manager')->getStorage('user'); @@ -221,7 +221,7 @@ function testUserBlock() { /** * Disable account and unpublish all content. */ - function testUserBlockUnpublish() { + public function testUserBlockUnpublish() { $node_storage = $this->container->get('entity.manager')->getStorage('node'); $this->config('user.settings')->set('cancel_method', 'user_cancel_block_unpublish')->save(); // Create comment field on page. @@ -291,7 +291,7 @@ function testUserBlockUnpublish() { /** * Delete account and anonymize all content. */ - function testUserAnonymize() { + public function testUserAnonymize() { $node_storage = $this->container->get('entity.manager')->getStorage('node'); $this->config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save(); // Create comment field on page. @@ -418,7 +418,7 @@ public function testUserAnonymizeBatch() { /** * Delete account and remove all content. */ - function testUserDelete() { + public function testUserDelete() { $node_storage = $this->container->get('entity.manager')->getStorage('node'); $this->config('user.settings')->set('cancel_method', 'user_cancel_delete')->save(); \Drupal::service('module_installer')->install(['comment']); @@ -489,7 +489,7 @@ function testUserDelete() { /** * Create an administrative user and delete another user. */ - function testUserCancelByAdmin() { + public function testUserCancelByAdmin() { $this->config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save(); // Create a regular user. @@ -514,7 +514,7 @@ function testUserCancelByAdmin() { /** * Tests deletion of a user account without an email address. */ - function testUserWithoutEmailCancelByAdmin() { + public function testUserWithoutEmailCancelByAdmin() { $this->config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save(); // Create a regular user. @@ -542,7 +542,7 @@ function testUserWithoutEmailCancelByAdmin() { /** * Create an administrative user and mass-delete other users. */ - function testMassUserCancelByAdmin() { + public function testMassUserCancelByAdmin() { \Drupal::service('module_installer')->install(['views']); \Drupal::service('router.builder')->rebuild(); $this->config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save(); @@ -597,7 +597,7 @@ function testMassUserCancelByAdmin() { /** * Tests user cancel with node access. */ - function testUserDeleteWithContentAndNodeAccess() { + public function testUserDeleteWithContentAndNodeAccess() { \Drupal::service('module_installer')->install(['node_access_test']); // Rebuild node access. diff --git a/core/modules/user/src/Tests/UserEditTest.php b/core/modules/user/src/Tests/UserEditTest.php index 7c2fe4f311e33dc54122a3bb1e8b14bd2149139b..6f1e36997110ff418003e813a9c4c7b209f61c34 100644 --- a/core/modules/user/src/Tests/UserEditTest.php +++ b/core/modules/user/src/Tests/UserEditTest.php @@ -14,7 +14,7 @@ class UserEditTest extends WebTestBase { /** * Test user edit page. */ - function testUserEdit() { + public function testUserEdit() { // Test user edit functionality. $user1 = $this->drupalCreateUser(['change own username']); $user2 = $this->drupalCreateUser([]); @@ -131,7 +131,7 @@ public function testUserWith0Password() { /** * Tests editing of a user account without an email address. */ - function testUserWithoutEmailEdit() { + public function testUserWithoutEmailEdit() { // Test that an admin can edit users without an email address. $admin = $this->drupalCreateUser(['administer users']); $this->drupalLogin($admin); diff --git a/core/modules/user/src/Tests/UserLanguageCreationTest.php b/core/modules/user/src/Tests/UserLanguageCreationTest.php index e38a9c03eda2705abb60f0baa90ea7e1250e87c6..0dd29079ae42179715f035c2b38c9b936c4a9c97 100644 --- a/core/modules/user/src/Tests/UserLanguageCreationTest.php +++ b/core/modules/user/src/Tests/UserLanguageCreationTest.php @@ -23,7 +23,7 @@ class UserLanguageCreationTest extends WebTestBase { /** * Functional test for language handling during user creation. */ - function testLocalUserCreation() { + public function testLocalUserCreation() { // User to add and remove language and create new users. $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages', 'administer users']); $this->drupalLogin($admin_user); diff --git a/core/modules/user/src/Tests/UserLoginTest.php b/core/modules/user/src/Tests/UserLoginTest.php index 406ccc04374ee717e9e633aa4847984e92dcc874..d92c1c7ae67eb63aa167bb61973ea3582577593b 100644 --- a/core/modules/user/src/Tests/UserLoginTest.php +++ b/core/modules/user/src/Tests/UserLoginTest.php @@ -15,7 +15,7 @@ class UserLoginTest extends WebTestBase { /** * Tests login with destination. */ - function testLoginCacheTagsAndDestination() { + public function testLoginCacheTagsAndDestination() { $this->drupalGet('user/login'); // The user login form says "Enter your username.", hence it // depends on config:system.site, and its cache tags should be present. @@ -31,7 +31,7 @@ function testLoginCacheTagsAndDestination() { /** * Test the global login flood control. */ - function testGlobalLoginFloodControl() { + public function testGlobalLoginFloodControl() { $this->config('user.flood') ->set('ip_limit', 10) // Set a high per-user limit out so that it is not relevant in the test. @@ -68,7 +68,7 @@ function testGlobalLoginFloodControl() { /** * Test the per-user login flood control. */ - function testPerUserLoginFloodControl() { + public function testPerUserLoginFloodControl() { $this->config('user.flood') // Set a high global limit out so that it is not relevant in the test. ->set('ip_limit', 4000) @@ -108,7 +108,7 @@ function testPerUserLoginFloodControl() { /** * Test that user password is re-hashed upon login after changing $count_log2. */ - function testPasswordRehashOnLogin() { + public function testPasswordRehashOnLogin() { // Determine default log2 for phpass hashing algorithm $default_count_log2 = 16; @@ -154,7 +154,7 @@ function testPasswordRehashOnLogin() { * . * - Set to NULL to expect a failed login. */ - function assertFailedLogin($account, $flood_trigger = NULL) { + public function assertFailedLogin($account, $flood_trigger = NULL) { $edit = [ 'name' => $account->getUsername(), 'pass' => $account->pass_raw, diff --git a/core/modules/user/src/Tests/UserPasswordResetTest.php b/core/modules/user/src/Tests/UserPasswordResetTest.php index fb19779d1c723aae26560f6c29739d6dc0dc05ed..528d38bc96eb4947fdbfbaec8e6b1f1d9547645b 100644 --- a/core/modules/user/src/Tests/UserPasswordResetTest.php +++ b/core/modules/user/src/Tests/UserPasswordResetTest.php @@ -69,7 +69,7 @@ protected function setUp() { /** * Tests password reset functionality. */ - function testUserPasswordReset() { + public function testUserPasswordReset() { // Verify that accessing the password reset form without having the session // variables set results in an access denied message. $this->drupalGet(Url::fromRoute('user.reset.form', ['uid' => $this->account->id()])); @@ -300,7 +300,7 @@ public function testUserResetPasswordTextboxFilled() { /** * Make sure that users cannot forge password reset URLs of other users. */ - function testResetImpersonation() { + public function testResetImpersonation() { // Create two identical user accounts except for the user name. They must // have the same empty password, so we can't use $this->drupalCreateUser(). $edit = []; diff --git a/core/modules/user/src/Tests/UserPermissionsTest.php b/core/modules/user/src/Tests/UserPermissionsTest.php index 50a7f9e32979506bd47159a53b41d8a67029c96c..4f9e260abc7b4d0a543e4edea79253c40a02051b 100644 --- a/core/modules/user/src/Tests/UserPermissionsTest.php +++ b/core/modules/user/src/Tests/UserPermissionsTest.php @@ -42,7 +42,7 @@ protected function setUp() { /** * Test changing user permissions through the permissions page. */ - function testUserPermissionChanges() { + public function testUserPermissionChanges() { $permissions_hash_generator = $this->container->get('user_permissions_hash_generator'); $storage = $this->container->get('entity.manager')->getStorage('user_role'); @@ -92,7 +92,7 @@ function testUserPermissionChanges() { /** * Test assigning of permissions for the administrator role. */ - function testAdministratorRole() { + public function testAdministratorRole() { $this->drupalLogin($this->adminUser); $this->drupalGet('admin/config/people/accounts'); @@ -135,7 +135,7 @@ function testAdministratorRole() { /** * Verify proper permission changes by user_role_change_permissions(). */ - function testUserRoleChangePermissions() { + public function testUserRoleChangePermissions() { $permissions_hash_generator = $this->container->get('user_permissions_hash_generator'); $rid = $this->rid; diff --git a/core/modules/user/src/Tests/UserPictureTest.php b/core/modules/user/src/Tests/UserPictureTest.php index e4c4d9abec157d085b70800b52087c2820d1fc19..6d546f0b4fb62d5bad6bf8410ebd4445e8823cd3 100644 --- a/core/modules/user/src/Tests/UserPictureTest.php +++ b/core/modules/user/src/Tests/UserPictureTest.php @@ -44,7 +44,7 @@ protected function setUp() { /** * Tests creation, display, and deletion of user pictures. */ - function testCreateDeletePicture() { + public function testCreateDeletePicture() { $this->drupalLogin($this->webUser); // Save a new picture. @@ -81,7 +81,7 @@ function testCreateDeletePicture() { /** * Tests embedded users on node pages. */ - function testPictureOnNodeComment() { + public function testPictureOnNodeComment() { $this->drupalLogin($this->webUser); // Save a new picture. @@ -129,7 +129,7 @@ function testPictureOnNodeComment() { /** * Edits the user picture for the test user. */ - function saveUserPicture($image) { + public function saveUserPicture($image) { $edit = ['files[user_picture_0]' => drupal_realpath($image->uri)]; $this->drupalPostForm('user/' . $this->webUser->id() . '/edit', $edit, t('Save')); diff --git a/core/modules/user/src/Tests/UserRegistrationTest.php b/core/modules/user/src/Tests/UserRegistrationTest.php index 6b6937c95cabc3641fff56b35575b2c15d255971..ca7a4f0c89e62e9c00dd01d44d24a7385716bb59 100644 --- a/core/modules/user/src/Tests/UserRegistrationTest.php +++ b/core/modules/user/src/Tests/UserRegistrationTest.php @@ -23,7 +23,7 @@ class UserRegistrationTest extends WebTestBase { */ public static $modules = ['field_test']; - function testRegistrationWithEmailVerification() { + public function testRegistrationWithEmailVerification() { $config = $this->config('user.settings'); // Require email verification. $config->set('verify_mail', TRUE)->save(); @@ -62,7 +62,7 @@ function testRegistrationWithEmailVerification() { $this->assertFalse($new_user->isActive(), 'New account is blocked until approved by an administrator.'); } - function testRegistrationWithoutEmailVerification() { + public function testRegistrationWithoutEmailVerification() { $config = $this->config('user.settings'); // Don't require email verification and allow registration by site visitors // without administrator approval. @@ -128,7 +128,7 @@ function testRegistrationWithoutEmailVerification() { $this->assertText(t('Member for'), 'User can log in after administrator approval.'); } - function testRegistrationEmailDuplicates() { + public function testRegistrationEmailDuplicates() { // Don't require email verification and allow registration by site visitors // without administrator approval. $this->config('user.settings') @@ -223,7 +223,7 @@ public function testUuidFormState() { $this->assertTrue($user_storage->loadByProperties(['name' => $edit['name']])); } - function testRegistrationDefaultValues() { + public function testRegistrationDefaultValues() { // Don't require email verification and allow registration by site visitors // without administrator approval. $config_user_settings = $this->config('user.settings') @@ -283,7 +283,7 @@ public function testUniqueFields() { /** * Tests Field API fields on user registration forms. */ - function testRegistrationWithUserFields() { + public function testRegistrationWithUserFields() { // Create a field on 'user' entity type. $field_storage = FieldStorageConfig::create([ 'field_name' => 'test_user_field', diff --git a/core/modules/user/src/Tests/UserRoleAdminTest.php b/core/modules/user/src/Tests/UserRoleAdminTest.php index 5b0be69c830d014c02423d08822ced555586f86b..eca9915d77c1353bd51760c7faae1c1f70049227 100644 --- a/core/modules/user/src/Tests/UserRoleAdminTest.php +++ b/core/modules/user/src/Tests/UserRoleAdminTest.php @@ -39,7 +39,7 @@ protected function setUp() { /** * Test adding, renaming and deleting roles. */ - function testRoleAdministration() { + public function testRoleAdministration() { $this->drupalLogin($this->adminUser); $default_langcode = \Drupal::languageManager()->getDefaultLanguage()->getId(); // Test presence of tab. @@ -98,7 +98,7 @@ function testRoleAdministration() { /** * Test user role weight change operation and ordering. */ - function testRoleWeightOrdering() { + public function testRoleWeightOrdering() { $this->drupalLogin($this->adminUser); $roles = user_roles(); $weight = count($roles); diff --git a/core/modules/user/src/Tests/UserTimeZoneTest.php b/core/modules/user/src/Tests/UserTimeZoneTest.php index 9b027b557156640a2a4d9dde9f350ef5fb1a0292..165c23c188e8fb92befb474bbaaca3392001d69c 100644 --- a/core/modules/user/src/Tests/UserTimeZoneTest.php +++ b/core/modules/user/src/Tests/UserTimeZoneTest.php @@ -22,7 +22,7 @@ class UserTimeZoneTest extends WebTestBase { /** * Tests the display of dates and time when user-configurable time zones are set. */ - function testUserTimeZone() { + public function testUserTimeZone() { // Setup date/time settings for Los Angeles time. $this->config('system.date') ->set('timezone.user.configurable', 1) diff --git a/core/modules/user/src/Tests/Views/AccessPermissionTest.php b/core/modules/user/src/Tests/Views/AccessPermissionTest.php index f82b103d2830c2cf323b6d2e938095af482f450c..477abd94193ead01319f609212beda8bacefb99f 100644 --- a/core/modules/user/src/Tests/Views/AccessPermissionTest.php +++ b/core/modules/user/src/Tests/Views/AccessPermissionTest.php @@ -24,7 +24,7 @@ class AccessPermissionTest extends AccessTestBase { /** * Tests perm access plugin. */ - function testAccessPerm() { + public function testAccessPerm() { $view = Views::getView('test_access_perm'); $view->setDisplay(); diff --git a/core/modules/user/src/Tests/Views/AccessRoleTest.php b/core/modules/user/src/Tests/Views/AccessRoleTest.php index 04f2876dc002f60fa8885213fb8dcd98c0dd0033..57055572d2c45dc0cb97719b229ce388af2f2f0a 100644 --- a/core/modules/user/src/Tests/Views/AccessRoleTest.php +++ b/core/modules/user/src/Tests/Views/AccessRoleTest.php @@ -25,7 +25,7 @@ class AccessRoleTest extends AccessTestBase { /** * Tests role access plugin. */ - function testAccessRole() { + public function testAccessRole() { /** @var \Drupal\views\ViewEntityInterface $view */ $view = \Drupal::entityManager()->getStorage('view')->load('test_access_role'); $display = &$view->getDisplay('default'); diff --git a/core/modules/user/src/Tests/Views/ArgumentValidateTest.php b/core/modules/user/src/Tests/Views/ArgumentValidateTest.php index 1f60df20d90c9f43eeb2b689c971d2141ee76e04..3365bd89197ac4a882b6fbc50266238abf4ba46b 100644 --- a/core/modules/user/src/Tests/Views/ArgumentValidateTest.php +++ b/core/modules/user/src/Tests/Views/ArgumentValidateTest.php @@ -36,7 +36,7 @@ protected function setUp() { /** * Tests the User (ID) argument validator. */ - function testArgumentValidateUserUid() { + public function testArgumentValidateUserUid() { $account = $this->account; $view = Views::getView('test_view_argument_validate_user'); diff --git a/core/modules/user/tests/src/Functional/UserDeleteTest.php b/core/modules/user/tests/src/Functional/UserDeleteTest.php index abfb616208065076f3d58fa06ce1420c43e7d2c3..5803a049aaa67e7cc1c63ebceaddd23f762628d0 100644 --- a/core/modules/user/tests/src/Functional/UserDeleteTest.php +++ b/core/modules/user/tests/src/Functional/UserDeleteTest.php @@ -15,7 +15,7 @@ class UserDeleteTest extends BrowserTestBase { /** * Test deleting multiple users. */ - function testUserDeleteMultiple() { + public function testUserDeleteMultiple() { // Create a few users with permissions, so roles will be created. $user_a = $this->drupalCreateUser(['access user profiles']); $user_b = $this->drupalCreateUser(['access user profiles']); diff --git a/core/modules/user/tests/src/Functional/UserEditedOwnAccountTest.php b/core/modules/user/tests/src/Functional/UserEditedOwnAccountTest.php index 29e9a17b2a595434dcee19154d38d923a7115dc8..a6f4bede591cd29617bf9ce312af297d07bcfd2a 100644 --- a/core/modules/user/tests/src/Functional/UserEditedOwnAccountTest.php +++ b/core/modules/user/tests/src/Functional/UserEditedOwnAccountTest.php @@ -18,7 +18,7 @@ class UserEditedOwnAccountTest extends BrowserTestBase { */ public static $modules = ['user_form_test']; - function testUserEditedOwnAccount() { + public function testUserEditedOwnAccount() { // Change account setting 'Who can register accounts?' to Administrators // only. $this->config('user.settings')->set('register', USER_REGISTER_ADMINISTRATORS_ONLY)->save(); diff --git a/core/modules/user/tests/src/Functional/UserEntityCallbacksTest.php b/core/modules/user/tests/src/Functional/UserEntityCallbacksTest.php index 5b5a34e4a3f23d8300e42188e3df933fe729c7e0..feea805afd1146bf3e3bb445db837a188011a688 100644 --- a/core/modules/user/tests/src/Functional/UserEntityCallbacksTest.php +++ b/core/modules/user/tests/src/Functional/UserEntityCallbacksTest.php @@ -44,7 +44,7 @@ protected function setUp() { /** * Test label callback. */ - function testLabelCallback() { + public function testLabelCallback() { $this->assertEqual($this->account->label(), $this->account->getUsername(), 'The username should be used as label'); // Setup a random anonymous name to be sure the name is used. diff --git a/core/modules/user/tests/src/Functional/UserLanguageTest.php b/core/modules/user/tests/src/Functional/UserLanguageTest.php index fcdceb8a3bec85a2cb375ee24296373e9140ac63..0e6c0f1a75db0836329b064a2e04fc0df25f1fd8 100644 --- a/core/modules/user/tests/src/Functional/UserLanguageTest.php +++ b/core/modules/user/tests/src/Functional/UserLanguageTest.php @@ -22,7 +22,7 @@ class UserLanguageTest extends BrowserTestBase { /** * Test if user can change their default language. */ - function testUserLanguageConfiguration() { + public function testUserLanguageConfiguration() { // User to add and remove language. $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages']); // User to change their default language. diff --git a/core/modules/user/tests/src/Functional/UserRolesAssignmentTest.php b/core/modules/user/tests/src/Functional/UserRolesAssignmentTest.php index 309dee2da1d2c2444721b8b21b8f18e2a4832ff5..fc8958c097a029f0f47f5d7b485c092307c3a0ba 100644 --- a/core/modules/user/tests/src/Functional/UserRolesAssignmentTest.php +++ b/core/modules/user/tests/src/Functional/UserRolesAssignmentTest.php @@ -21,7 +21,7 @@ protected function setUp() { * Tests that a user can be assigned a role and that the role can be removed * again. */ - function testAssignAndRemoveRole() { + public function testAssignAndRemoveRole() { $rid = $this->drupalCreateRole(['administer users']); $account = $this->drupalCreateUser(); @@ -42,7 +42,7 @@ function testAssignAndRemoveRole() { * Tests that when creating a user the role can be assigned. And that it can * be removed again. */ - function testCreateUserWithRole() { + public function testCreateUserWithRole() { $rid = $this->drupalCreateRole(['administer users']); // Create a new user and add the role at the same time. $edit = [ diff --git a/core/modules/user/tests/src/Functional/UserSaveTest.php b/core/modules/user/tests/src/Functional/UserSaveTest.php index 3428749812866e24cb7fa30580860dd0c831d508..c693b39cefeee886351f99f8e45ca45cb387a04e 100644 --- a/core/modules/user/tests/src/Functional/UserSaveTest.php +++ b/core/modules/user/tests/src/Functional/UserSaveTest.php @@ -15,7 +15,7 @@ class UserSaveTest extends BrowserTestBase { /** * Test creating a user with arbitrary uid. */ - function testUserImport() { + public function testUserImport() { // User ID must be a number that is not in the database. $uids = \Drupal::entityManager()->getStorage('user')->getQuery() @@ -48,7 +48,7 @@ function testUserImport() { /** * Ensures that an existing password is unset after the user was saved. */ - function testExistingPasswordRemoval() { + public function testExistingPasswordRemoval() { /** @var \Drupal\user\Entity\User $user */ $user = User::create(['name' => $this->randomMachineName()]); $user->save(); diff --git a/core/modules/user/tests/src/Functional/UserSearchTest.php b/core/modules/user/tests/src/Functional/UserSearchTest.php index 7eafb4af8e90fbf1e7239c9431b5ff86ee6d5113..8ce0319bf623b46580b08662656e35a295893e88 100644 --- a/core/modules/user/tests/src/Functional/UserSearchTest.php +++ b/core/modules/user/tests/src/Functional/UserSearchTest.php @@ -19,7 +19,7 @@ class UserSearchTest extends BrowserTestBase { */ public static $modules = ['search']; - function testUserSearch() { + public function testUserSearch() { // Verify that a user without 'administer users' permission cannot search // for users by email address. Additionally, ensure that the username has a // plus sign to ensure searching works with that. diff --git a/core/modules/user/tests/src/Functional/UserTokenReplaceTest.php b/core/modules/user/tests/src/Functional/UserTokenReplaceTest.php index d563d363411d5a006a14b6bb5ebbd534d5001fb9..e272b60732524716751149708d8681e4b4008764 100644 --- a/core/modules/user/tests/src/Functional/UserTokenReplaceTest.php +++ b/core/modules/user/tests/src/Functional/UserTokenReplaceTest.php @@ -34,7 +34,7 @@ protected function setUp() { /** * Creates a user, then tests the tokens generated from it. */ - function testUserTokenReplacement() { + public function testUserTokenReplacement() { $token_service = \Drupal::token(); $language_interface = \Drupal::languageManager()->getCurrentLanguage(); $url_options = [ diff --git a/core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php b/core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php index e4367a051555e7744a865515690d8eb18edc7dbc..643302192c72dba8a211e0237998f3e24e8dcb63 100644 --- a/core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php +++ b/core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php @@ -23,7 +23,7 @@ class UserAccountFormFieldsTest extends KernelTestBase { /** * Tests the root user account form section in the "Configure site" form. */ - function testInstallConfigureForm() { + public function testInstallConfigureForm() { require_once \Drupal::root() . '/core/includes/install.core.inc'; require_once \Drupal::root() . '/core/includes/install.inc'; $install_state = install_state_defaults(); @@ -45,7 +45,7 @@ function testInstallConfigureForm() { /** * Tests the user registration form. */ - function testUserRegistrationForm() { + public function testUserRegistrationForm() { // Install default configuration; required for AccountFormController. $this->installConfig(['user']); @@ -69,7 +69,7 @@ function testUserRegistrationForm() { /** * Tests the user edit form. */ - function testUserEditForm() { + public function testUserEditForm() { // Install default configuration; required for AccountFormController. $this->installConfig(['user']); diff --git a/core/modules/user/tests/src/Kernel/UserActionConfigSchemaTest.php b/core/modules/user/tests/src/Kernel/UserActionConfigSchemaTest.php index c405ad97aec672ccb3e0e43162e8b9fe9e2eaf76..dfafb1d5368be79048c892e4174876d0f1cd1449 100644 --- a/core/modules/user/tests/src/Kernel/UserActionConfigSchemaTest.php +++ b/core/modules/user/tests/src/Kernel/UserActionConfigSchemaTest.php @@ -26,7 +26,7 @@ class UserActionConfigSchemaTest extends KernelTestBase { /** * Tests whether the user action config schema are valid. */ - function testValidUserActionConfigSchema() { + public function testValidUserActionConfigSchema() { $rid = strtolower($this->randomMachineName(8)); Role::create(['id' => $rid])->save(); diff --git a/core/modules/user/tests/src/Kernel/UserEntityReferenceTest.php b/core/modules/user/tests/src/Kernel/UserEntityReferenceTest.php index 14dc7ada24282aeb494f42f95352b443d4006e6e..159a699cf57a74843b69e6b724f54a4a82656b36 100644 --- a/core/modules/user/tests/src/Kernel/UserEntityReferenceTest.php +++ b/core/modules/user/tests/src/Kernel/UserEntityReferenceTest.php @@ -54,7 +54,7 @@ protected function setUp() { /** * Tests user selection by roles. */ - function testUserSelectionByRole() { + public function testUserSelectionByRole() { $field_definition = FieldConfig::loadByName('user', 'user', 'user_reference'); $handler_settings = $field_definition->getSetting('handler_settings'); $handler_settings['filter']['role'] = [ diff --git a/core/modules/user/tests/src/Kernel/UserFieldsTest.php b/core/modules/user/tests/src/Kernel/UserFieldsTest.php index 18f8f3b365a7394da060cec90c4141eb55fbf6be..672ddb065e033e40b2c1f6e767bbe9f2708ac4a7 100644 --- a/core/modules/user/tests/src/Kernel/UserFieldsTest.php +++ b/core/modules/user/tests/src/Kernel/UserFieldsTest.php @@ -36,7 +36,7 @@ protected function setUp() { /** * Tests account's available fields. */ - function testUserFields() { + public function testUserFields() { // Create the user to test the user fields. $user = User::create([ 'name' => 'foobar', diff --git a/core/modules/user/tests/src/Kernel/UserSaveStatusTest.php b/core/modules/user/tests/src/Kernel/UserSaveStatusTest.php index 0ad1bde38cb92113057cc4c1ae529b0f12a01fb4..17364c059de297bbf88853154e55e7d450b94150 100644 --- a/core/modules/user/tests/src/Kernel/UserSaveStatusTest.php +++ b/core/modules/user/tests/src/Kernel/UserSaveStatusTest.php @@ -27,7 +27,7 @@ protected function setUp() { /** * Test SAVED_NEW and SAVED_UPDATED statuses for user entity type. */ - function testUserSaveStatus() { + public function testUserSaveStatus() { // Create a new user. $values = [ 'uid' => 1, diff --git a/core/modules/user/tests/src/Kernel/UserValidationTest.php b/core/modules/user/tests/src/Kernel/UserValidationTest.php index 9be1fd0d627f593a8f011c52b72a8d2435252d31..f8be028f0e53150b5ccf8e9096883464e388b73b 100644 --- a/core/modules/user/tests/src/Kernel/UserValidationTest.php +++ b/core/modules/user/tests/src/Kernel/UserValidationTest.php @@ -39,7 +39,7 @@ protected function setUp() { /** * Tests user name validation. */ - function testUsernames() { + public function testUsernames() { $test_cases = [ // '' => array('', 'assert'), 'foo' => ['Valid username', 'assertNull'], 'FOO' => ['Valid username', 'assertNull'], @@ -69,7 +69,7 @@ function testUsernames() { /** * Runs entity validation checks. */ - function testValidation() { + public function testValidation() { $user = User::create([ 'name' => 'test', 'mail' => 'test@example.com', diff --git a/core/modules/views/src/Analyzer.php b/core/modules/views/src/Analyzer.php index 3688fdaf43b0b67743e94c4f4bc9f605b32c1638..a5de193deda969b2858820d8bdbd3cf3bb9ac4dc 100644 --- a/core/modules/views/src/Analyzer.php +++ b/core/modules/views/src/Analyzer.php @@ -115,7 +115,7 @@ public function formatMessages(array $messages) { * @return array * A single formatted message, consisting of a key message and a key type. */ - static function formatMessage($message, $type = 'error') { + public static function formatMessage($message, $type = 'error') { return ['message' => $message, 'type' => $type]; } diff --git a/core/modules/views/src/EntityViewsData.php b/core/modules/views/src/EntityViewsData.php index 1a65b1c8a26e0671cdf61be030587d0d4fbcaced..2ba2086ac10397f529244f4a0afdd50683f71725 100644 --- a/core/modules/views/src/EntityViewsData.php +++ b/core/modules/views/src/EntityViewsData.php @@ -78,7 +78,7 @@ class EntityViewsData implements EntityHandlerInterface, EntityViewsDataInterfac * @param \Drupal\Core\StringTranslation\TranslationInterface $translation_manager * The translation manager. */ - function __construct(EntityTypeInterface $entity_type, SqlEntityStorageInterface $storage_controller, EntityManagerInterface $entity_manager, ModuleHandlerInterface $module_handler, TranslationInterface $translation_manager) { + public function __construct(EntityTypeInterface $entity_type, SqlEntityStorageInterface $storage_controller, EntityManagerInterface $entity_manager, ModuleHandlerInterface $module_handler, TranslationInterface $translation_manager) { $this->entityType = $entity_type; $this->entityManager = $entity_manager; $this->storage = $storage_controller; diff --git a/core/modules/views/src/ManyToOneHelper.php b/core/modules/views/src/ManyToOneHelper.php index 51d2b4f48148f98113afab78f434da74c4a24b78..cb2e5754a818f3d48de9f411cf1b8ee3f1141473 100644 --- a/core/modules/views/src/ManyToOneHelper.php +++ b/core/modules/views/src/ManyToOneHelper.php @@ -21,7 +21,7 @@ */ class ManyToOneHelper { - function __construct($handler) { + public function __construct($handler) { $this->handler = $handler; } diff --git a/core/modules/views/src/Plugin/views/area/HTTPStatusCode.php b/core/modules/views/src/Plugin/views/area/HTTPStatusCode.php index d9b81454125119ce922de06e68ee5e1c81fdd488..6cf6ba2241974a980a670dd3951fa980e7072a4c 100644 --- a/core/modules/views/src/Plugin/views/area/HTTPStatusCode.php +++ b/core/modules/views/src/Plugin/views/area/HTTPStatusCode.php @@ -57,7 +57,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { /** * {@inheritdoc} */ - function render($empty = FALSE) { + public function render($empty = FALSE) { if (!$empty || !empty($this->options['empty'])) { $build['#attached']['http_header'][] = ['Status', $this->options['status_code']]; return $build; diff --git a/core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php b/core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php index 6a9632f4eaa6e8de396cc3ffbd7426961576206a..3f145195a3a51adf02b1faa6a8df641100ee8f03 100644 --- a/core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php +++ b/core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php @@ -775,7 +775,7 @@ protected function defaultDefault() { /** * Determine if the argument is set to provide a default argument. */ - function hasDefaultArgument() { + public function hasDefaultArgument() { $info = $this->defaultActions($this->options['default_action']); return !empty($info['has default argument']); } @@ -960,7 +960,7 @@ public function query($group_by = FALSE) { * * This usually needs to be overridden to provide a proper title. */ - function title() { + public function title() { return $this->argument; } diff --git a/core/modules/views/src/Plugin/views/argument/DayDate.php b/core/modules/views/src/Plugin/views/argument/DayDate.php index 187be041d4335e1470105f1aabc66666a142e330..42bd81743c2971aa8683556fb8258e800bd5337f 100644 --- a/core/modules/views/src/Plugin/views/argument/DayDate.php +++ b/core/modules/views/src/Plugin/views/argument/DayDate.php @@ -31,7 +31,7 @@ public function summaryName($data) { /** * Provide a link to the next level of the view */ - function title() { + public function title() { $day = str_pad($this->argument, 2, '0', STR_PAD_LEFT); return format_date(strtotime("2005" . "05" . $day . " 00:00:00 UTC"), 'custom', $this->format, 'UTC'); } diff --git a/core/modules/views/src/Plugin/views/argument/FullDate.php b/core/modules/views/src/Plugin/views/argument/FullDate.php index 84bcd8cfa634cd876aee82a3b22bec2f3af0b13a..ca4ca9f60d120428b4b2334818878fe01b43a8c1 100644 --- a/core/modules/views/src/Plugin/views/argument/FullDate.php +++ b/core/modules/views/src/Plugin/views/argument/FullDate.php @@ -30,7 +30,7 @@ public function summaryName($data) { /** * Provide a link to the next level of the view */ - function title() { + public function title() { return format_date(strtotime($this->argument . " 00:00:00 UTC"), 'custom', $this->format, 'UTC'); } diff --git a/core/modules/views/src/Plugin/views/argument/LanguageArgument.php b/core/modules/views/src/Plugin/views/argument/LanguageArgument.php index ef9e152026e138779ccbfbbfd4401ff9e71a29dd..2eb1870ed140540169114f6654a117936cf891e0 100644 --- a/core/modules/views/src/Plugin/views/argument/LanguageArgument.php +++ b/core/modules/views/src/Plugin/views/argument/LanguageArgument.php @@ -26,7 +26,7 @@ public function summaryName($data) { * Gets the user friendly version of the language name for display as a * title placeholder. */ - function title() { + public function title() { return $this->language($this->argument); } @@ -40,7 +40,7 @@ function title() { * The translated name for the language, or "Unknown language" if the * language was not found. */ - function language($langcode) { + public function language($langcode) { $languages = $this->listLanguages(); return isset($languages[$langcode]) ? $languages[$langcode] : $this->t('Unknown language'); } diff --git a/core/modules/views/src/Plugin/views/argument/ManyToOne.php b/core/modules/views/src/Plugin/views/argument/ManyToOne.php index f0bd9ba68e718988f6b0475fe5ef6173427f082f..680c19f2aa2467baaf7af07c9e335153cec4c272 100644 --- a/core/modules/views/src/Plugin/views/argument/ManyToOne.php +++ b/core/modules/views/src/Plugin/views/argument/ManyToOne.php @@ -126,7 +126,7 @@ public function query($group_by = FALSE) { $this->helper->addFilter(); } - function title() { + public function title() { if (!$this->argument) { return !empty($this->definition['empty field name']) ? $this->definition['empty field name'] : $this->t('Uncategorized'); } diff --git a/core/modules/views/src/Plugin/views/argument/MonthDate.php b/core/modules/views/src/Plugin/views/argument/MonthDate.php index c1b493bdb5917fe88531f3637bb5fca0fdd13082..17ce1b987b55ba50b35bfc2e7ae6d68628c5d9d3 100644 --- a/core/modules/views/src/Plugin/views/argument/MonthDate.php +++ b/core/modules/views/src/Plugin/views/argument/MonthDate.php @@ -30,7 +30,7 @@ public function summaryName($data) { /** * Provide a link to the next level of the view */ - function title() { + public function title() { $month = str_pad($this->argument, 2, '0', STR_PAD_LEFT); return format_date(strtotime("2005" . $month . "15" . " 00:00:00 UTC"), 'custom', $this->format, 'UTC'); } diff --git a/core/modules/views/src/Plugin/views/argument/NumericArgument.php b/core/modules/views/src/Plugin/views/argument/NumericArgument.php index 188d8e9bd6833bf3f0a0c3d6be2cdeee8ffa276c..5cace4dbc3de026b492c8bb4903d7ebc272b92dd 100644 --- a/core/modules/views/src/Plugin/views/argument/NumericArgument.php +++ b/core/modules/views/src/Plugin/views/argument/NumericArgument.php @@ -57,7 +57,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { ]; } - function title() { + public function title() { if (!$this->argument) { return !empty($this->definition['empty field name']) ? $this->definition['empty field name'] : $this->t('Uncategorized'); } diff --git a/core/modules/views/src/Plugin/views/argument/StringArgument.php b/core/modules/views/src/Plugin/views/argument/StringArgument.php index 0948c6764611dd48de2e6189a249b57935c1ba4c..6058d6618b6d1e9bc8a51d907b46daa18ae0d576 100644 --- a/core/modules/views/src/Plugin/views/argument/StringArgument.php +++ b/core/modules/views/src/Plugin/views/argument/StringArgument.php @@ -278,7 +278,7 @@ public function getSortName() { return $this->t('Alphabetical', [], ['context' => 'Sort order']); } - function title() { + public function title() { // Support case-insensitive title comparisons for PostgreSQL by converting // the title to lowercase. if ($this->options['case'] != 'none' && Database::getConnection()->databaseType() == 'pgsql') { diff --git a/core/modules/views/src/Plugin/views/argument/YearMonthDate.php b/core/modules/views/src/Plugin/views/argument/YearMonthDate.php index 8185513ef9f9c90f59fa891f8161773f772e0f79..1e1effe1c73b0251c2e595d9632134545e5611ba 100644 --- a/core/modules/views/src/Plugin/views/argument/YearMonthDate.php +++ b/core/modules/views/src/Plugin/views/argument/YearMonthDate.php @@ -30,7 +30,7 @@ public function summaryName($data) { /** * Provide a link to the next level of the view */ - function title() { + public function title() { return format_date(strtotime($this->argument . "15" . " 00:00:00 UTC"), 'custom', $this->format, 'UTC'); } diff --git a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php index c16ee3b65febb1d252acb5f1d1a2873ba7251502..3744fea2bf4abf4deea3a8218a985378d51f0e23 100644 --- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php @@ -2392,7 +2392,7 @@ public static function buildBasicRenderable($view_id, $display_id, array $args = /** * {@inheritdoc} */ - function preview() { + public function preview() { return $this->view->render(); } diff --git a/core/modules/views/src/Plugin/views/display/DisplayPluginInterface.php b/core/modules/views/src/Plugin/views/display/DisplayPluginInterface.php index d3b4c79b6597e1d09c1b2d5ab866644e428ba7a4..f8630af08fba67d890cd0f0ef1dfbc0521473c60 100644 --- a/core/modules/views/src/Plugin/views/display/DisplayPluginInterface.php +++ b/core/modules/views/src/Plugin/views/display/DisplayPluginInterface.php @@ -497,7 +497,7 @@ public function buildRenderable(array $args = [], $cache = TRUE); * * Also might be used for some other AJAXy reason. */ - function preview(); + public function preview(); /** * Returns the display type that this display requires. diff --git a/core/modules/views/src/Plugin/views/field/EntityField.php b/core/modules/views/src/Plugin/views/field/EntityField.php index 6a0c762191f42ee51113992aa62a54b2cfba1884..5ee05a24d57bd9c85889fb1c81375fe03db73ed1 100644 --- a/core/modules/views/src/Plugin/views/field/EntityField.php +++ b/core/modules/views/src/Plugin/views/field/EntityField.php @@ -263,7 +263,7 @@ public function query($use_groupby = FALSE) { /** * Determine if the field table should be added to the query. */ - function add_field_table($use_groupby) { + public function add_field_table($use_groupby) { // Grouping is enabled. if ($use_groupby) { return TRUE; @@ -497,7 +497,7 @@ public function submitFormCalculateOptions(array $options, array $form_state_opt /** * Provide options for multiple value fields. */ - function multiple_options_form(&$form, FormStateInterface $form_state) { + public function multiple_options_form(&$form, FormStateInterface $form_state) { $field = $this->getFieldDefinition(); $form['multiple_field_settings'] = [ @@ -906,7 +906,7 @@ protected function createEntityForGroupBy(EntityInterface $entity, ResultRow $ro return $processed_entity; } - function render_item($count, $item) { + public function render_item($count, $item) { return render($item['rendered']); } diff --git a/core/modules/views/src/Plugin/views/field/FieldHandlerInterface.php b/core/modules/views/src/Plugin/views/field/FieldHandlerInterface.php index d7389c937d18bb1b3e45956def9dbc29e00cf764..2562b954c05fc8d26d1c6aed308a41369d5145d6 100644 --- a/core/modules/views/src/Plugin/views/field/FieldHandlerInterface.php +++ b/core/modules/views/src/Plugin/views/field/FieldHandlerInterface.php @@ -265,6 +265,6 @@ public function getRenderTokens($item); * is safe it will be wrapped in an object that implements * MarkupInterface. If it is empty or unsafe it will be a string. */ - function theme(ResultRow $values); + public function theme(ResultRow $values); } diff --git a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php index d9485407716cf250b59d5267feb6b3492d5d1e93..48c59ef7093acecf82a45fc38656f5afd6ac018b 100644 --- a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php +++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php @@ -1725,7 +1725,7 @@ protected function documentSelfTokens(&$tokens) { } /** * {@inheritdoc} */ - function theme(ResultRow $values) { + public function theme(ResultRow $values) { $renderer = $this->getRenderer(); $build = [ '#theme' => $this->themeFunctions(), diff --git a/core/modules/views/src/Plugin/views/filter/Combine.php b/core/modules/views/src/Plugin/views/filter/Combine.php index 0396ff47ec47ce9326832d0eaf0e794ec6d324eb..f8ea624e1eaf1c33a29d1d8cabfd1504c2a19fff 100644 --- a/core/modules/views/src/Plugin/views/filter/Combine.php +++ b/core/modules/views/src/Plugin/views/filter/Combine.php @@ -128,7 +128,7 @@ public function validate() { * By default things like opEqual uses add_where, that doesn't support * complex expressions, so override opEqual (and all operators below). */ - function opEqual($expression) { + public function opEqual($expression) { $placeholder = $this->placeholder(); $operator = $this->operator(); $this->query->addWhereExpression($this->options['group'], "$expression $operator $placeholder", [$placeholder => $this->value]); diff --git a/core/modules/views/src/Plugin/views/filter/InOperator.php b/core/modules/views/src/Plugin/views/filter/InOperator.php index df01536824f12a225e19d9c4aff2632ed5b3447e..c2d5bef2db7ffcf2df3a1fc3397f9458779059f7 100644 --- a/core/modules/views/src/Plugin/views/filter/InOperator.php +++ b/core/modules/views/src/Plugin/views/filter/InOperator.php @@ -107,7 +107,7 @@ protected function defineOptions() { * to add or remove functionality by overriding this function and * adding/removing items from this array. */ - function operators() { + public function operators() { $operators = [ 'in' => [ 'title' => $this->t('Is one of'), diff --git a/core/modules/views/src/Plugin/views/filter/ManyToOne.php b/core/modules/views/src/Plugin/views/filter/ManyToOne.php index 645dc819c2ea8482963a65c00fecbf436303a3dc..e678dee82f3f9c38ee6be2f6059bc4a79ec477f4 100644 --- a/core/modules/views/src/Plugin/views/filter/ManyToOne.php +++ b/core/modules/views/src/Plugin/views/filter/ManyToOne.php @@ -54,7 +54,7 @@ protected function defineOptions() { return $options; } - function operators() { + public function operators() { $operators = [ 'or' => [ 'title' => $this->t('Is one of'), diff --git a/core/modules/views/src/Plugin/views/filter/NumericFilter.php b/core/modules/views/src/Plugin/views/filter/NumericFilter.php index 347c9f2cc472af2cf1d04aad306f5bc2f2d329cd..7f687a14f4d654a6c0b36b92d123308d85a071f1 100644 --- a/core/modules/views/src/Plugin/views/filter/NumericFilter.php +++ b/core/modules/views/src/Plugin/views/filter/NumericFilter.php @@ -29,7 +29,7 @@ protected function defineOptions() { return $options; } - function operators() { + public function operators() { $operators = [ '<' => [ 'title' => $this->t('Is less than'), diff --git a/core/modules/views/src/Plugin/views/filter/StringFilter.php b/core/modules/views/src/Plugin/views/filter/StringFilter.php index d55fe69d6880e4cb7b1fd04250ccddad53c7d7d4..733db53ac7026bca694913a18fb90d166af5d043 100644 --- a/core/modules/views/src/Plugin/views/filter/StringFilter.php +++ b/core/modules/views/src/Plugin/views/filter/StringFilter.php @@ -36,7 +36,7 @@ protected function defineOptions() { * to add or remove functionality by overriding this function and * adding/removing items from this array. */ - function operators() { + public function operators() { $operators = [ '=' => [ 'title' => $this->t('Is equal to'), @@ -236,7 +236,7 @@ protected function valueForm(&$form, FormStateInterface $form_state) { } } - function operator() { + public function operator() { return $this->operator == '=' ? 'LIKE' : 'NOT LIKE'; } diff --git a/core/modules/views/src/Plugin/views/query/QueryPluginBase.php b/core/modules/views/src/Plugin/views/query/QueryPluginBase.php index 3f9535e26093a52314845ee7915e3b7a3f16fa0c..a2c2e105b7d477eaeb8adbdace1d7c85d49feca3 100644 --- a/core/modules/views/src/Plugin/views/query/QueryPluginBase.php +++ b/core/modules/views/src/Plugin/views/query/QueryPluginBase.php @@ -199,7 +199,7 @@ public function setGroupOperator($type = 'AND') { * * Query plugins that don't support entities can leave the method empty. */ - function loadEntities(&$results) {} + public function loadEntities(&$results) {} /** * Returns a Unix timestamp to database native timestamp expression. diff --git a/core/modules/views/src/Plugin/views/row/RowPluginBase.php b/core/modules/views/src/Plugin/views/row/RowPluginBase.php index fd2b96c32261eb58f6920e172d8f07a29e07cc29..1cc3f79a1ea1cafb1cdffb69d3f8879cd84b0307 100644 --- a/core/modules/views/src/Plugin/views/row/RowPluginBase.php +++ b/core/modules/views/src/Plugin/views/row/RowPluginBase.php @@ -54,7 +54,7 @@ abstract class RowPluginBase extends PluginBase { * * @return bool */ - function usesFields() { + public function usesFields() { return $this->usesFields; } diff --git a/core/modules/views/src/Plugin/views/style/StylePluginBase.php b/core/modules/views/src/Plugin/views/style/StylePluginBase.php index 1131b6af0d06926522ed11bdc3b462c1464b7eb9..364c9f83798d7b3da4c237399eae4c936ee65c52 100644 --- a/core/modules/views/src/Plugin/views/style/StylePluginBase.php +++ b/core/modules/views/src/Plugin/views/style/StylePluginBase.php @@ -144,7 +144,7 @@ public function destroy() { * * @return bool */ - function usesRowPlugin() { + public function usesRowPlugin() { return $this->usesRowPlugin; } @@ -154,7 +154,7 @@ function usesRowPlugin() { * * @return bool */ - function usesRowClass() { + public function usesRowClass() { return $this->usesRowClass; } @@ -163,7 +163,7 @@ function usesRowClass() { * * @return bool */ - function usesGrouping() { + public function usesGrouping() { return $this->usesGrouping; } @@ -172,7 +172,7 @@ function usesGrouping() { * * @return bool */ - function usesFields() { + public function usesFields() { // If we use a row plugin, ask the row plugin. Chances are, we don't // care, it does. $row_uses_fields = FALSE; diff --git a/core/modules/views/src/Tests/DefaultViewsTest.php b/core/modules/views/src/Tests/DefaultViewsTest.php index e5349ab4d1e1a2977d74ce95b960f3885a3af94d..48e3caeb3a372ead4fed5ff5f66de28f2302b4d3 100644 --- a/core/modules/views/src/Tests/DefaultViewsTest.php +++ b/core/modules/views/src/Tests/DefaultViewsTest.php @@ -143,7 +143,7 @@ public function testDefaultViews() { /** * Returns a new term with random properties in vocabulary $vid. */ - function createTerm($vocabulary) { + public function createTerm($vocabulary) { $filter_formats = filter_formats(); $format = array_pop($filter_formats); $term = Term::create([ diff --git a/core/modules/views/src/Tests/FieldApiDataTest.php b/core/modules/views/src/Tests/FieldApiDataTest.php index 24b2cf30e0b2b86d398868df87f9c5519ea94168..0e1569592f9f6da78570c9a0e8e42a339fdafabb 100644 --- a/core/modules/views/src/Tests/FieldApiDataTest.php +++ b/core/modules/views/src/Tests/FieldApiDataTest.php @@ -50,7 +50,7 @@ protected function setUp() { * * We check data structure for both node and node revision tables. */ - function testViewsData() { + public function testViewsData() { $table_mapping = \Drupal::entityManager()->getStorage('node')->getTableMapping(); $field_storage = $this->fieldStorages[0]; $current_table = $table_mapping->getDedicatedDataTableName($field_storage); diff --git a/core/modules/views/src/Tests/Handler/ArgumentStringTest.php b/core/modules/views/src/Tests/Handler/ArgumentStringTest.php index 9d83fad572fb617be4b9710057b9efa9ec2111ca..0682892e89570cea042976a7f055a554cf1bbca7 100644 --- a/core/modules/views/src/Tests/Handler/ArgumentStringTest.php +++ b/core/modules/views/src/Tests/Handler/ArgumentStringTest.php @@ -28,7 +28,7 @@ class ArgumentStringTest extends HandlerTestBase { /** * Tests the glossary feature. */ - function testGlossary() { + public function testGlossary() { // Setup some nodes, one with a, two with b and three with c. $counter = 1; foreach (['a', 'b', 'c'] as $char) { diff --git a/core/modules/views/src/Tests/Handler/FieldEntityOperationsTest.php b/core/modules/views/src/Tests/Handler/FieldEntityOperationsTest.php index 57544b5c66f460034b1e72098c9deab6e2a1c3a8..7efd1d7414491ae5859b129b1d42d24fffc26557 100644 --- a/core/modules/views/src/Tests/Handler/FieldEntityOperationsTest.php +++ b/core/modules/views/src/Tests/Handler/FieldEntityOperationsTest.php @@ -27,7 +27,7 @@ class FieldEntityOperationsTest extends HandlerTestBase { */ public static $modules = ['node', 'language', 'views_ui']; - function setUp() { + public function setUp() { parent::setUp(); // Create Article content type. diff --git a/core/modules/views/src/Tests/Plugin/AccessTest.php b/core/modules/views/src/Tests/Plugin/AccessTest.php index 2278f6771c8ecec1cb42df24527782b3a91238bc..7a4eb1a5b37643047d49c2c4d0219b95a506efb5 100644 --- a/core/modules/views/src/Tests/Plugin/AccessTest.php +++ b/core/modules/views/src/Tests/Plugin/AccessTest.php @@ -61,7 +61,7 @@ protected function setUp() { /** * Tests none access plugin. */ - function testAccessNone() { + public function testAccessNone() { $view = Views::getView('test_access_none'); $view->setDisplay(); @@ -78,7 +78,7 @@ function testAccessNone() { * * @see \Drupal\views_test\Plugin\views\access\StaticTest */ - function testStaticAccessPlugin() { + public function testStaticAccessPlugin() { $view = Views::getView('test_access_static'); $view->setDisplay(); diff --git a/core/modules/views/src/Tests/Plugin/NumericFormatPluralTest.php b/core/modules/views/src/Tests/Plugin/NumericFormatPluralTest.php index 79f1922a922f177b9657ce0d3c1dc2b6f4b68d80..d463336c4182300418b903e25f8d505a3ec7e346 100644 --- a/core/modules/views/src/Tests/Plugin/NumericFormatPluralTest.php +++ b/core/modules/views/src/Tests/Plugin/NumericFormatPluralTest.php @@ -37,7 +37,7 @@ protected function setUp() { /** * Test plural formatting setting on a numeric views handler. */ - function testNumericFormatPlural() { + public function testNumericFormatPlural() { // Create a file. $file = $this->createFile(); diff --git a/core/modules/views/src/Tests/Plugin/PagerTest.php b/core/modules/views/src/Tests/Plugin/PagerTest.php index 907fef2a5690095c9dd1d7c9795cb58559e98ca2..6ba4c069b46052e9d476bacf934067f81289183f 100644 --- a/core/modules/views/src/Tests/Plugin/PagerTest.php +++ b/core/modules/views/src/Tests/Plugin/PagerTest.php @@ -285,7 +285,7 @@ public function testRenderNullPager() { /** * Test the api functions on the view object. */ - function testPagerApi() { + public function testPagerApi() { $view = Views::getView('test_pager_full'); $view->setDisplay(); // On the first round don't initialize the pager. diff --git a/core/modules/views/src/Tests/Plugin/StyleTest.php b/core/modules/views/src/Tests/Plugin/StyleTest.php index 61798a6773bc9e55295003d34de61dc117a8aa5c..e059275617bd15a8fc933d0a4834bde741dca56a 100644 --- a/core/modules/views/src/Tests/Plugin/StyleTest.php +++ b/core/modules/views/src/Tests/Plugin/StyleTest.php @@ -87,7 +87,7 @@ public function testStyle() { $this->assertTrue(strpos($output, $random_text) !== FALSE, 'Make sure that the rendering of the style plugin appears in the output of the view.'); } - function testGrouping() { + public function testGrouping() { $this->_testGrouping(FALSE); $this->_testGrouping(TRUE); } @@ -95,7 +95,7 @@ function testGrouping() { /** * Tests the grouping features of styles. */ - function _testGrouping($stripped = FALSE) { + public function _testGrouping($stripped = FALSE) { $view = Views::getView('test_view'); $view->setDisplay(); // Setup grouping by the job and the age field. @@ -256,7 +256,7 @@ function _testGrouping($stripped = FALSE) { /** * Tests custom css classes. */ - function testCustomRowClasses() { + public function testCustomRowClasses() { $view = Views::getView('test_view'); $view->setDisplay(); diff --git a/core/modules/views/src/Tests/Wizard/BasicTest.php b/core/modules/views/src/Tests/Wizard/BasicTest.php index e63583227f80abdd99cebdb5cb9b6744b8befffe..7394991d238b78cccc56ffa06cff1d56567fb936 100644 --- a/core/modules/views/src/Tests/Wizard/BasicTest.php +++ b/core/modules/views/src/Tests/Wizard/BasicTest.php @@ -20,7 +20,7 @@ protected function setUp() { $this->drupalPlaceBlock('page_title_block'); } - function testViewsWizardAndListing() { + public function testViewsWizardAndListing() { $this->drupalCreateContentType(['type' => 'article']); $this->drupalCreateContentType(['type' => 'page']); diff --git a/core/modules/views/src/Tests/Wizard/ItemsPerPageTest.php b/core/modules/views/src/Tests/Wizard/ItemsPerPageTest.php index 500eff2563d3bdbfde85a43a05c4f2fcd5403562..58f22a8424686aecfefda2f404b1d2b3a1ced020 100644 --- a/core/modules/views/src/Tests/Wizard/ItemsPerPageTest.php +++ b/core/modules/views/src/Tests/Wizard/ItemsPerPageTest.php @@ -19,7 +19,7 @@ protected function setUp() { /** * Tests the number of items per page. */ - function testItemsPerPage() { + public function testItemsPerPage() { $this->drupalCreateContentType(['type' => 'article']); // Create articles, each with a different creation time so that we can do a diff --git a/core/modules/views/src/Tests/Wizard/MenuTest.php b/core/modules/views/src/Tests/Wizard/MenuTest.php index 242065f245ef83b3b88c3d106ebecb81c27b2c18..0805de6168e5f68d5ccecf329af138451298bd96 100644 --- a/core/modules/views/src/Tests/Wizard/MenuTest.php +++ b/core/modules/views/src/Tests/Wizard/MenuTest.php @@ -15,7 +15,7 @@ class MenuTest extends WizardTestBase { /** * Tests the menu functionality. */ - function testMenus() { + public function testMenus() { $this->drupalPlaceBlock('system_menu_block:main'); // Create a view with a page display and a menu link in the Main Menu. diff --git a/core/modules/views/src/Tests/Wizard/SortingTest.php b/core/modules/views/src/Tests/Wizard/SortingTest.php index 545c50db4a7a6ad8484cd38cc95c495bcb0eb58b..58926aabca93d07aacde3f6b97053242071ba1e6 100644 --- a/core/modules/views/src/Tests/Wizard/SortingTest.php +++ b/core/modules/views/src/Tests/Wizard/SortingTest.php @@ -18,7 +18,7 @@ protected function setUp() { /** * Tests the sorting functionality. */ - function testSorting() { + public function testSorting() { // Create nodes, each with a different creation time so that we can do a // meaningful sort. $this->drupalCreateContentType(['type' => 'page']); diff --git a/core/modules/views/src/Tests/Wizard/TaggedWithTest.php b/core/modules/views/src/Tests/Wizard/TaggedWithTest.php index d9299461993669290343900cffadeeec96f26444..f723950419890950ec2416ca1b88965596391a84 100644 --- a/core/modules/views/src/Tests/Wizard/TaggedWithTest.php +++ b/core/modules/views/src/Tests/Wizard/TaggedWithTest.php @@ -114,7 +114,7 @@ protected function setUp() { /** * Tests the "tagged with" functionality. */ - function testTaggedWith() { + public function testTaggedWith() { // In this test we will only create nodes that have an instance of the tag // field. $node_add_path = 'node/add/' . $this->nodeTypeWithTags->id(); @@ -180,7 +180,7 @@ function testTaggedWith() { /** * Tests that the "tagged with" form element only shows for node types that support it. */ - function testTaggedWithByNodeType() { + public function testTaggedWithByNodeType() { // The tagging field is associated with one of our node types only. So the // "tagged with" form element on the view wizard should appear on the form // by default (when the wizard is configured to display all content) and diff --git a/core/modules/views/tests/src/Kernel/Handler/ArgumentNullTest.php b/core/modules/views/tests/src/Kernel/Handler/ArgumentNullTest.php index 99fa7c8675169ca6767829f46f467b208c51ab72..933a00099f2ba72257772804283be318b493a178 100644 --- a/core/modules/views/tests/src/Kernel/Handler/ArgumentNullTest.php +++ b/core/modules/views/tests/src/Kernel/Handler/ArgumentNullTest.php @@ -19,7 +19,7 @@ class ArgumentNullTest extends ViewsKernelTestBase { */ public static $testViews = ['test_view']; - function viewsData() { + public function viewsData() { $data = parent::viewsData(); $data['views_test_data']['id']['argument']['id'] = 'null'; diff --git a/core/modules/views/tests/src/Kernel/Handler/FieldBooleanTest.php b/core/modules/views/tests/src/Kernel/Handler/FieldBooleanTest.php index 01f5166447b75f6027c7b3fb50499aa319088a22..0690fc12cafff37a04683d0fa98f7ace1412ccbf 100644 --- a/core/modules/views/tests/src/Kernel/Handler/FieldBooleanTest.php +++ b/core/modules/views/tests/src/Kernel/Handler/FieldBooleanTest.php @@ -19,7 +19,7 @@ class FieldBooleanTest extends ViewsKernelTestBase { */ public static $testViews = ['test_view']; - function dataSet() { + public function dataSet() { // Use default dataset but remove the age from john and paul $data = parent::dataSet(); $data[0]['age'] = 0; @@ -27,7 +27,7 @@ function dataSet() { return $data; } - function viewsData() { + public function viewsData() { $data = parent::viewsData(); $data['views_test_data']['age']['field']['id'] = 'boolean'; return $data; diff --git a/core/modules/views/tests/src/Kernel/Handler/FieldCounterTest.php b/core/modules/views/tests/src/Kernel/Handler/FieldCounterTest.php index 49d914eee45e2c579ba5b659f13cdfdcd24c4ef2..b5c52fef7727b04d2b1d107736e805414b890891 100644 --- a/core/modules/views/tests/src/Kernel/Handler/FieldCounterTest.php +++ b/core/modules/views/tests/src/Kernel/Handler/FieldCounterTest.php @@ -26,7 +26,7 @@ class FieldCounterTest extends ViewsKernelTestBase { */ public static $testViews = ['test_view']; - function testSimple() { + public function testSimple() { $view = Views::getView('test_view'); $view->setDisplay(); $view->displayHandlers->get('default')->overrideOption('fields', [ @@ -87,7 +87,7 @@ function testSimple() { /** * @todo: Write tests for pager. */ - function testPager() { + public function testPager() { } } diff --git a/core/modules/views/tests/src/Kernel/Handler/FieldCustomTest.php b/core/modules/views/tests/src/Kernel/Handler/FieldCustomTest.php index fb6e3c4db69ffcfb44296374ab6710399cb51365..599052dcbf18b0a8495c50828ac15e3f6c48c561 100644 --- a/core/modules/views/tests/src/Kernel/Handler/FieldCustomTest.php +++ b/core/modules/views/tests/src/Kernel/Handler/FieldCustomTest.php @@ -23,7 +23,7 @@ class FieldCustomTest extends ViewsKernelTestBase { /** * {@inheritdoc} */ - function viewsData() { + public function viewsData() { $data = parent::viewsData(); $data['views_test_data']['name']['field']['id'] = 'custom'; return $data; diff --git a/core/modules/views/tests/src/Kernel/Handler/FieldFileSizeTest.php b/core/modules/views/tests/src/Kernel/Handler/FieldFileSizeTest.php index 7af6442e480a7b34b5809ed8e19963dcc8bd678a..892e82fce8c5fc9fb8560114fa4236b2e4364191 100644 --- a/core/modules/views/tests/src/Kernel/Handler/FieldFileSizeTest.php +++ b/core/modules/views/tests/src/Kernel/Handler/FieldFileSizeTest.php @@ -20,7 +20,7 @@ class FieldFileSizeTest extends ViewsKernelTestBase { */ public static $testViews = ['test_view']; - function dataSet() { + public function dataSet() { $data = parent::dataSet(); $data[0]['age'] = 0; $data[1]['age'] = 10; @@ -30,7 +30,7 @@ function dataSet() { return $data; } - function viewsData() { + public function viewsData() { $data = parent::viewsData(); $data['views_test_data']['age']['field']['id'] = 'file_size'; diff --git a/core/modules/views/tests/src/Kernel/Handler/FieldKernelTest.php b/core/modules/views/tests/src/Kernel/Handler/FieldKernelTest.php index b5b04b00dd52fb73e72be1553e65e58a57351f7f..677a3f5e4084a59adbfee13543ee2fdfb4fa042d 100644 --- a/core/modules/views/tests/src/Kernel/Handler/FieldKernelTest.php +++ b/core/modules/views/tests/src/Kernel/Handler/FieldKernelTest.php @@ -412,7 +412,7 @@ public function testExclude() { /** * Tests everything related to empty output of a field. */ - function testEmpty() { + public function testEmpty() { $this->_testHideIfEmpty(); $this->_testEmptyText(); } @@ -423,7 +423,7 @@ function testEmpty() { * This tests alters the result to get easier and less coupled results. It is * important that assertIdentical() is used in this test since in PHP 0 == ''. */ - function _testHideIfEmpty() { + public function _testHideIfEmpty() { /** @var \Drupal\Core\Render\RendererInterface $renderer */ $renderer = \Drupal::service('renderer'); @@ -704,7 +704,7 @@ function _testHideIfEmpty() { /** * Tests the usage of the empty text. */ - function _testEmptyText() { + public function _testEmptyText() { /** @var \Drupal\Core\Render\RendererInterface $renderer */ $renderer = \Drupal::service('renderer'); @@ -754,7 +754,7 @@ function _testEmptyText() { /** * Tests views_handler_field::isValueEmpty(). */ - function testIsValueEmpty() { + public function testIsValueEmpty() { $view = Views::getView('test_view'); $view->initHandlers(); $field = $view->field['name']; diff --git a/core/modules/views/tests/src/Kernel/Handler/FieldUrlTest.php b/core/modules/views/tests/src/Kernel/Handler/FieldUrlTest.php index 828fdb4fdf1f0b2e3c4f4d7053bf1c181fcb645d..0814402ca6d6a36712f2aa75981ce8e144af1d13 100644 --- a/core/modules/views/tests/src/Kernel/Handler/FieldUrlTest.php +++ b/core/modules/views/tests/src/Kernel/Handler/FieldUrlTest.php @@ -22,7 +22,7 @@ class FieldUrlTest extends ViewsKernelTestBase { */ public static $testViews = ['test_view']; - function viewsData() { + public function viewsData() { $data = parent::viewsData(); $data['views_test_data']['name']['field']['id'] = 'url'; return $data; diff --git a/core/modules/views/tests/src/Kernel/Handler/FilterEqualityTest.php b/core/modules/views/tests/src/Kernel/Handler/FilterEqualityTest.php index 41002e806c3437b9b181f3c37c0a487bf58e3b8c..d78f7c92e2b714659411ed34b47d01445adb0c6d 100644 --- a/core/modules/views/tests/src/Kernel/Handler/FilterEqualityTest.php +++ b/core/modules/views/tests/src/Kernel/Handler/FilterEqualityTest.php @@ -30,13 +30,13 @@ class FilterEqualityTest extends ViewsKernelTestBase { 'views_test_data_name' => 'name', ]; - function viewsData() { + public function viewsData() { $data = parent::viewsData(); $data['views_test_data']['name']['filter']['id'] = 'equality'; return $data; } - function testEqual() { + public function testEqual() { $view = Views::getView('test_view'); $view->setDisplay(); @@ -82,7 +82,7 @@ public function testEqualGroupedExposed() { $this->assertIdenticalResultset($view, $resultset, $this->columnMap); } - function testNotEqual() { + public function testNotEqual() { $view = Views::getView('test_view'); $view->setDisplay(); diff --git a/core/modules/views/tests/src/Kernel/Handler/FilterInOperatorTest.php b/core/modules/views/tests/src/Kernel/Handler/FilterInOperatorTest.php index b542c9c1dad1cd7c1acefc1ced426479e1b8ec7f..e02a8430c7317780b29073b236b6b54b578bec6a 100644 --- a/core/modules/views/tests/src/Kernel/Handler/FilterInOperatorTest.php +++ b/core/modules/views/tests/src/Kernel/Handler/FilterInOperatorTest.php @@ -31,7 +31,7 @@ class FilterInOperatorTest extends ViewsKernelTestBase { 'views_test_data_age' => 'age', ]; - function viewsData() { + public function viewsData() { $data = parent::viewsData(); $data['views_test_data']['age']['filter']['id'] = 'in_operator'; return $data; diff --git a/core/modules/views/tests/src/Kernel/Handler/FilterNumericTest.php b/core/modules/views/tests/src/Kernel/Handler/FilterNumericTest.php index d10b792080638ed8d79f381a5b151e4a007b7d57..b154a785298c0845bc8e93b6280ce6f0f320734b 100644 --- a/core/modules/views/tests/src/Kernel/Handler/FilterNumericTest.php +++ b/core/modules/views/tests/src/Kernel/Handler/FilterNumericTest.php @@ -31,7 +31,7 @@ class FilterNumericTest extends ViewsKernelTestBase { 'views_test_data_age' => 'age', ]; - function viewsData() { + public function viewsData() { $data = parent::viewsData(); $data['views_test_data']['age']['filter']['allow empty'] = TRUE; $data['views_test_data']['id']['filter']['allow empty'] = FALSE; diff --git a/core/modules/views/tests/src/Kernel/Handler/FilterStringTest.php b/core/modules/views/tests/src/Kernel/Handler/FilterStringTest.php index c21df9a0f78652127a768d8530d47d18b2bc192a..9ad0f88f633029a681abf84daa75dc8958ee8452 100644 --- a/core/modules/views/tests/src/Kernel/Handler/FilterStringTest.php +++ b/core/modules/views/tests/src/Kernel/Handler/FilterStringTest.php @@ -30,7 +30,7 @@ class FilterStringTest extends ViewsKernelTestBase { 'views_test_data_name' => 'name', ]; - function viewsData() { + public function viewsData() { $data = parent::viewsData(); $data['views_test_data']['name']['filter']['allow empty'] = TRUE; $data['views_test_data']['job']['filter']['allow empty'] = FALSE; @@ -81,7 +81,7 @@ protected function getBasicPageView() { return $view; } - function testFilterStringEqual() { + public function testFilterStringEqual() { $view = Views::getView('test_view'); $view->setDisplay(); @@ -106,7 +106,7 @@ function testFilterStringEqual() { $this->assertIdenticalResultset($view, $resultset, $this->columnMap); } - function testFilterStringGroupedExposedEqual() { + public function testFilterStringGroupedExposedEqual() { $filters = $this->getGroupedExposedFilters(); $view = $this->getBasicPageView(); @@ -128,7 +128,7 @@ function testFilterStringGroupedExposedEqual() { $this->assertIdenticalResultset($view, $resultset, $this->columnMap); } - function testFilterStringNotEqual() { + public function testFilterStringNotEqual() { $view = Views::getView('test_view'); $view->setDisplay(); @@ -162,7 +162,7 @@ function testFilterStringNotEqual() { $this->assertIdenticalResultset($view, $resultset, $this->columnMap); } - function testFilterStringGroupedExposedNotEqual() { + public function testFilterStringGroupedExposedNotEqual() { $filters = $this->getGroupedExposedFilters(); $view = $this->getBasicPageView(); @@ -194,7 +194,7 @@ function testFilterStringGroupedExposedNotEqual() { $this->assertIdenticalResultset($view, $resultset, $this->columnMap); } - function testFilterStringContains() { + public function testFilterStringContains() { $view = Views::getView('test_view'); $view->setDisplay(); @@ -220,7 +220,7 @@ function testFilterStringContains() { } - function testFilterStringGroupedExposedContains() { + public function testFilterStringGroupedExposedContains() { $filters = $this->getGroupedExposedFilters(); $view = $this->getBasicPageView(); @@ -243,7 +243,7 @@ function testFilterStringGroupedExposedContains() { } - function testFilterStringWord() { + public function testFilterStringWord() { $view = Views::getView('test_view'); $view->setDisplay(); @@ -296,7 +296,7 @@ function testFilterStringWord() { } - function testFilterStringGroupedExposedWord() { + public function testFilterStringGroupedExposedWord() { $filters = $this->getGroupedExposedFilters(); $view = $this->getBasicPageView(); @@ -338,7 +338,7 @@ function testFilterStringGroupedExposedWord() { $this->assertIdenticalResultset($view, $resultset, $this->columnMap); } - function testFilterStringStarts() { + public function testFilterStringStarts() { $view = Views::getView('test_view'); $view->setDisplay(); @@ -363,7 +363,7 @@ function testFilterStringStarts() { $this->assertIdenticalResultset($view, $resultset, $this->columnMap); } - function testFilterStringGroupedExposedStarts() { + public function testFilterStringGroupedExposedStarts() { $filters = $this->getGroupedExposedFilters(); $view = $this->getBasicPageView(); @@ -384,7 +384,7 @@ function testFilterStringGroupedExposedStarts() { $this->assertIdenticalResultset($view, $resultset, $this->columnMap); } - function testFilterStringNotStarts() { + public function testFilterStringNotStarts() { $view = Views::getView('test_view'); $view->setDisplay(); @@ -416,7 +416,7 @@ function testFilterStringNotStarts() { $this->assertIdenticalResultset($view, $resultset, $this->columnMap); } - function testFilterStringGroupedExposedNotStarts() { + public function testFilterStringGroupedExposedNotStarts() { $filters = $this->getGroupedExposedFilters(); $view = $this->getBasicPageView(); @@ -444,7 +444,7 @@ function testFilterStringGroupedExposedNotStarts() { $this->assertIdenticalResultset($view, $resultset, $this->columnMap); } - function testFilterStringEnds() { + public function testFilterStringEnds() { $view = Views::getView('test_view'); $view->setDisplay(); @@ -472,7 +472,7 @@ function testFilterStringEnds() { $this->assertIdenticalResultset($view, $resultset, $this->columnMap); } - function testFilterStringGroupedExposedEnds() { + public function testFilterStringGroupedExposedEnds() { $filters = $this->getGroupedExposedFilters(); $view = $this->getBasicPageView(); @@ -496,7 +496,7 @@ function testFilterStringGroupedExposedEnds() { $this->assertIdenticalResultset($view, $resultset, $this->columnMap); } - function testFilterStringNotEnds() { + public function testFilterStringNotEnds() { $view = Views::getView('test_view'); $view->setDisplay(); @@ -525,7 +525,7 @@ function testFilterStringNotEnds() { $this->assertIdenticalResultset($view, $resultset, $this->columnMap); } - function testFilterStringGroupedExposedNotEnds() { + public function testFilterStringGroupedExposedNotEnds() { $filters = $this->getGroupedExposedFilters(); $view = $this->getBasicPageView(); @@ -550,7 +550,7 @@ function testFilterStringGroupedExposedNotEnds() { $this->assertIdenticalResultset($view, $resultset, $this->columnMap); } - function testFilterStringNot() { + public function testFilterStringNot() { $view = Views::getView('test_view'); $view->setDisplay(); @@ -580,7 +580,7 @@ function testFilterStringNot() { } - function testFilterStringGroupedExposedNot() { + public function testFilterStringGroupedExposedNot() { $filters = $this->getGroupedExposedFilters(); $view = $this->getBasicPageView(); @@ -606,7 +606,7 @@ function testFilterStringGroupedExposedNot() { } - function testFilterStringShorter() { + public function testFilterStringShorter() { $view = Views::getView('test_view'); $view->setDisplay(); @@ -634,7 +634,7 @@ function testFilterStringShorter() { $this->assertIdenticalResultset($view, $resultset, $this->columnMap); } - function testFilterStringGroupedExposedShorter() { + public function testFilterStringGroupedExposedShorter() { $filters = $this->getGroupedExposedFilters(); $view = $this->getBasicPageView(); @@ -657,7 +657,7 @@ function testFilterStringGroupedExposedShorter() { $this->assertIdenticalResultset($view, $resultset, $this->columnMap); } - function testFilterStringLonger() { + public function testFilterStringLonger() { $view = Views::getView('test_view'); $view->setDisplay(); @@ -682,7 +682,7 @@ function testFilterStringLonger() { $this->assertIdenticalResultset($view, $resultset, $this->columnMap); } - function testFilterStringGroupedExposedLonger() { + public function testFilterStringGroupedExposedLonger() { $filters = $this->getGroupedExposedFilters(); $view = $this->getBasicPageView(); @@ -703,7 +703,7 @@ function testFilterStringGroupedExposedLonger() { } - function testFilterStringEmpty() { + public function testFilterStringEmpty() { $view = Views::getView('test_view'); $view->setDisplay(); @@ -727,7 +727,7 @@ function testFilterStringEmpty() { $this->assertIdenticalResultset($view, $resultset, $this->columnMap); } - function testFilterStringGroupedExposedEmpty() { + public function testFilterStringGroupedExposedEmpty() { $filters = $this->getGroupedExposedFilters(); $view = $this->getBasicPageView(); diff --git a/core/modules/views/tests/src/Kernel/ModuleTest.php b/core/modules/views/tests/src/Kernel/ModuleTest.php index 4ed5e0a969740304b0f4ab5b12576f4c7c4c9771..68612b78f40beaf3cc0f948e4d53449b99565d72 100644 --- a/core/modules/views/tests/src/Kernel/ModuleTest.php +++ b/core/modules/views/tests/src/Kernel/ModuleTest.php @@ -208,7 +208,7 @@ public function testLoadFunctions() { /** * Tests view enable and disable procedural wrapper functions. */ - function testStatusFunctions() { + public function testStatusFunctions() { $view = Views::getView('test_view_status')->storage; $this->assertFalse($view->status(), 'The view status is disabled.'); @@ -360,7 +360,7 @@ protected function formatViewOptions(array $views = []) { /** * Ensure that a certain handler is a instance of a certain table/field. */ - function assertInstanceHandler($handler, $table, $field, $id) { + public function assertInstanceHandler($handler, $table, $field, $id) { $table_data = $this->container->get('views.views_data')->get($table); $field_data = $table_data[$field][$id]; diff --git a/core/modules/views/tests/src/Kernel/Plugin/ArgumentValidatorTest.php b/core/modules/views/tests/src/Kernel/Plugin/ArgumentValidatorTest.php index cac798555ca449121757f7982e4ccd516ecc1c70..34d426dc761e706cc8ea7c0111df878f20a93095 100644 --- a/core/modules/views/tests/src/Kernel/Plugin/ArgumentValidatorTest.php +++ b/core/modules/views/tests/src/Kernel/Plugin/ArgumentValidatorTest.php @@ -20,7 +20,7 @@ class ArgumentValidatorTest extends ViewsKernelTestBase { */ public static $testViews = ['test_view_argument_validate_numeric', 'test_view']; - function testArgumentValidateNumeric() { + public function testArgumentValidateNumeric() { $view = Views::getView('test_view_argument_validate_numeric'); $view->initHandlers(); $this->assertFalse($view->argument['null']->validateArgument($this->randomString())); diff --git a/core/modules/views/tests/src/Kernel/Plugin/CacheTest.php b/core/modules/views/tests/src/Kernel/Plugin/CacheTest.php index 01c6721726796fb4423c2577df07cbb9e7d43c14..9f6066eff31411b36d340d294c9eb75b6208330c 100644 --- a/core/modules/views/tests/src/Kernel/Plugin/CacheTest.php +++ b/core/modules/views/tests/src/Kernel/Plugin/CacheTest.php @@ -224,7 +224,7 @@ public function testTimeResultCachingWithPager() { * * @see views_plugin_cache_time */ - function testNoneResultCaching() { + public function testNoneResultCaching() { // Create a basic result which just 2 results. $view = Views::getView('test_cache'); $view->setDisplay(); @@ -261,7 +261,7 @@ function testNoneResultCaching() { /** * Tests css/js storage and restoring mechanism. */ - function testHeaderStorage() { + public function testHeaderStorage() { // Create a view with output caching enabled. // Some hook_views_pre_render in views_test_data.module adds the test css/js file. // so they should be added to the css/js storage. diff --git a/core/modules/views/tests/src/Kernel/Plugin/StyleHtmlListTest.php b/core/modules/views/tests/src/Kernel/Plugin/StyleHtmlListTest.php index 717403dacc65d5dbc25a4ac987d09e56b9ee5862..0e99439e7ed25532bbb8bebd79485e0a0a567cd5 100644 --- a/core/modules/views/tests/src/Kernel/Plugin/StyleHtmlListTest.php +++ b/core/modules/views/tests/src/Kernel/Plugin/StyleHtmlListTest.php @@ -23,7 +23,7 @@ class StyleHtmlListTest extends ViewsKernelTestBase { /** * Make sure that the HTML list style markup is correct. */ - function testDefaultRowClasses() { + public function testDefaultRowClasses() { $view = Views::getView('test_style_html_list'); $output = $view->preview(); $output = \Drupal::service('renderer')->renderRoot($output); diff --git a/core/modules/views/tests/src/Kernel/Plugin/StyleTestBase.php b/core/modules/views/tests/src/Kernel/Plugin/StyleTestBase.php index 00dd9f98b6701683c65132b145e10b4abf0e375e..91900cea2773646540a65461ea7a39b650139744 100644 --- a/core/modules/views/tests/src/Kernel/Plugin/StyleTestBase.php +++ b/core/modules/views/tests/src/Kernel/Plugin/StyleTestBase.php @@ -20,7 +20,7 @@ abstract class StyleTestBase extends ViewsKernelTestBase { /** * Stores a view output in the elements. */ - function storeViewPreview($output) { + public function storeViewPreview($output) { $html5 = new HTML5(); $htmlDom = $html5->loadHTML('' . $output . ''); if ($htmlDom) { diff --git a/core/modules/views/tests/src/Kernel/Plugin/StyleUnformattedTest.php b/core/modules/views/tests/src/Kernel/Plugin/StyleUnformattedTest.php index f1b254cf7e6d5d903751578b7baf162dea8db020..af58b7000610435df75d9e10a552e7d1c516035b 100644 --- a/core/modules/views/tests/src/Kernel/Plugin/StyleUnformattedTest.php +++ b/core/modules/views/tests/src/Kernel/Plugin/StyleUnformattedTest.php @@ -21,7 +21,7 @@ class StyleUnformattedTest extends StyleTestBase { /** * Make sure that the default css classes works as expected. */ - function testDefaultRowClasses() { + public function testDefaultRowClasses() { $view = Views::getView('test_view'); $view->setDisplay(); $output = $view->preview(); diff --git a/core/modules/views/tests/src/Kernel/TokenReplaceTest.php b/core/modules/views/tests/src/Kernel/TokenReplaceTest.php index 41f2cf07afda39e02c87fd224f52e4d5f55a66f4..4b1cfc362c83f17300937b4b04452d9954ec839c 100644 --- a/core/modules/views/tests/src/Kernel/TokenReplaceTest.php +++ b/core/modules/views/tests/src/Kernel/TokenReplaceTest.php @@ -29,7 +29,7 @@ protected function setUp($import_test_views = TRUE) { /** * Tests core token replacements generated from a view. */ - function testTokenReplacement() { + public function testTokenReplacement() { $token_handler = \Drupal::token(); $view = Views::getView('test_tokens'); $view->setDisplay('page_1'); @@ -76,7 +76,7 @@ function testTokenReplacement() { /** * Tests core token replacements generated from a view. */ - function testTokenReplacementWithMiniPager() { + public function testTokenReplacementWithMiniPager() { $token_handler = \Drupal::token(); $view = Views::getView('test_tokens'); $view->setDisplay('page_3'); @@ -113,7 +113,7 @@ function testTokenReplacementWithMiniPager() { /** * Tests core token replacements generated from a view without results. */ - function testTokenReplacementNoResults() { + public function testTokenReplacementNoResults() { $token_handler = \Drupal::token(); $view = Views::getView('test_tokens'); $view->setDisplay('page_2'); @@ -132,7 +132,7 @@ function testTokenReplacementNoResults() { /** * Tests path token replacements generated from a view without a path. */ - function testTokenReplacementNoPath() { + public function testTokenReplacementNoPath() { $token_handler = \Drupal::token(); $view = Views::getView('test_invalid_tokens'); $view->setDisplay('block_1'); diff --git a/core/modules/views/tests/src/Kernel/ViewStorageTest.php b/core/modules/views/tests/src/Kernel/ViewStorageTest.php index 29f19963446cafa295f261781979e85c9af81431..7cf953af740b0682b5349f5fc82e6e9a40db0fd5 100644 --- a/core/modules/views/tests/src/Kernel/ViewStorageTest.php +++ b/core/modules/views/tests/src/Kernel/ViewStorageTest.php @@ -57,7 +57,7 @@ class ViewStorageTest extends ViewsKernelTestBase { /** * Tests CRUD operations. */ - function testConfigurationEntityCRUD() { + public function testConfigurationEntityCRUD() { // Get the configuration entity type and controller. $this->entityType = \Drupal::entityManager()->getDefinition('view'); $this->controller = $this->container->get('entity.manager')->getStorage('view'); diff --git a/core/modules/views_ui/src/Tests/AnalyzeTest.php b/core/modules/views_ui/src/Tests/AnalyzeTest.php index ef1744b3b710cbde1f1e9fb91ef2630d79db2da0..83e25313d67c1219d85280dd2ca2404e01018876 100644 --- a/core/modules/views_ui/src/Tests/AnalyzeTest.php +++ b/core/modules/views_ui/src/Tests/AnalyzeTest.php @@ -37,7 +37,7 @@ protected function setUp() { /** * Tests that analyze works in general. */ - function testAnalyzeBasic() { + public function testAnalyzeBasic() { $this->drupalLogin($this->admin); $this->drupalGet('admin/structure/views/view/test_view/edit'); diff --git a/core/modules/views_ui/src/Tests/DefaultViewsTest.php b/core/modules/views_ui/src/Tests/DefaultViewsTest.php index 855cbdad7d77dea409b63847a19dd6efb9b02173..a709d1f41382dee4bbd62389a7bc8ea3457e3865 100644 --- a/core/modules/views_ui/src/Tests/DefaultViewsTest.php +++ b/core/modules/views_ui/src/Tests/DefaultViewsTest.php @@ -30,7 +30,7 @@ protected function setUp() { /** * Tests default views. */ - function testDefaultViews() { + public function testDefaultViews() { // Make sure the view starts off as disabled (does not appear on the listing // page). $edit_href = 'admin/structure/views/view/glossary'; @@ -159,7 +159,7 @@ function testDefaultViews() { /** * Tests that enabling views moves them to the correct table. */ - function testSplitListing() { + public function testSplitListing() { // Build a re-usable xpath query. $xpath = '//div[@id="views-entity-list"]/div[@class = :status]/table//td/text()[contains(., :title)]'; @@ -227,7 +227,7 @@ public function testPathDestination() { * The page content that results from clicking on the link, or FALSE on * failure. Failure also results in a failed assertion. */ - function clickViewsOperationLink($label, $unique_href_part) { + public function clickViewsOperationLink($label, $unique_href_part) { $links = $this->xpath('//a[normalize-space(text())=:label]', [':label' => $label]); foreach ($links as $link_index => $link) { $position = strpos($link['href'], $unique_href_part); diff --git a/core/modules/views_ui/src/Tests/ExposedFormUITest.php b/core/modules/views_ui/src/Tests/ExposedFormUITest.php index 7d29f3e1fd411656966e69cee419fed582b7128a..0aaa6ee7c53abe02f9543bb4d05fe81c10c489a8 100644 --- a/core/modules/views_ui/src/Tests/ExposedFormUITest.php +++ b/core/modules/views_ui/src/Tests/ExposedFormUITest.php @@ -52,7 +52,7 @@ protected function setUp() { /** * Tests the admin interface of exposed filter and sort items. */ - function testExposedAdminUi() { + public function testExposedAdminUi() { $edit = []; $this->drupalGet('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/filter/type'); @@ -134,7 +134,7 @@ function testExposedAdminUi() { /** * Tests the admin interface of exposed grouped filters. */ - function testGroupedFilterAdminUi() { + public function testGroupedFilterAdminUi() { $edit = []; $this->drupalGet('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/filter/type'); diff --git a/core/modules/views_ui/src/Tests/GroupByTest.php b/core/modules/views_ui/src/Tests/GroupByTest.php index 1bf8f01929d8d447961b04bb6a09d78a16c01255..4b564c518688efaee19db53567015547d3a6ac02 100644 --- a/core/modules/views_ui/src/Tests/GroupByTest.php +++ b/core/modules/views_ui/src/Tests/GroupByTest.php @@ -21,7 +21,7 @@ class GroupByTest extends UITestBase { * * @todo This should check the change of the settings as well. */ - function testGroupBySave() { + public function testGroupBySave() { $this->drupalGet('admin/structure/views/view/test_views_groupby_save/edit'); $edit_groupby_url = 'admin/structure/views/nojs/handler-group/test_views_groupby_save/default/field/id'; diff --git a/core/modules/views_ui/src/Tests/OverrideDisplaysTest.php b/core/modules/views_ui/src/Tests/OverrideDisplaysTest.php index fdd73e130221ef8be3dba1d292e22ec22d87ece5..ba425424087952a4cecd66ad3beef7a85dbed633 100644 --- a/core/modules/views_ui/src/Tests/OverrideDisplaysTest.php +++ b/core/modules/views_ui/src/Tests/OverrideDisplaysTest.php @@ -18,7 +18,7 @@ protected function setUp() { /** * Tests that displays can be overridden via the UI. */ - function testOverrideDisplays() { + public function testOverrideDisplays() { // Create a basic view that shows all content, with a page and a block // display. $view['label'] = $this->randomMachineName(16); @@ -77,7 +77,7 @@ function testOverrideDisplays() { /** * Tests that the wizard correctly sets up default and overridden displays. */ - function testWizardMixedDefaultOverriddenDisplays() { + public function testWizardMixedDefaultOverriddenDisplays() { // Create a basic view with a page, block, and feed. Give the page and feed // identical titles, but give the block a different one, so we expect the // page and feed to inherit their titles from the default display, but the @@ -172,7 +172,7 @@ function testWizardMixedDefaultOverriddenDisplays() { /** * Tests that the revert to all displays select-option works as expected. */ - function testRevertAllDisplays() { + public function testRevertAllDisplays() { // Create a basic view with a page, block. // Because there is both a title on page and block we expect the title on // the block be overridden. diff --git a/core/modules/views_ui/src/Tests/PreviewTest.php b/core/modules/views_ui/src/Tests/PreviewTest.php index 48e0ada2a9fc81d4e2ba7cc7db387e280f878463..95fba8c6ad0340f82d59ab9b32f3239fe320e532 100644 --- a/core/modules/views_ui/src/Tests/PreviewTest.php +++ b/core/modules/views_ui/src/Tests/PreviewTest.php @@ -45,7 +45,7 @@ public function testPreviewContextual() { /** * Tests arguments in the preview form. */ - function testPreviewUI() { + public function testPreviewUI() { $this->drupalGet('admin/structure/views/view/test_preview/edit'); $this->assertResponse(200); diff --git a/core/modules/views_ui/src/Tests/SettingsTest.php b/core/modules/views_ui/src/Tests/SettingsTest.php index 40a52e9ae0659b4f661455f5797ddc515baac400..f583185cdb576c8939da8dc375a34b1488199561 100644 --- a/core/modules/views_ui/src/Tests/SettingsTest.php +++ b/core/modules/views_ui/src/Tests/SettingsTest.php @@ -27,7 +27,7 @@ protected function setUp() { /** * Tests the settings for the edit ui. */ - function testEditUI() { + public function testEditUI() { $this->drupalLogin($this->adminUser); // Test the settings tab exists. diff --git a/core/phpcs.xml.dist b/core/phpcs.xml.dist index bcfa4a347a86069436f257e5e4685ed9702a1246..0c35743a313a31ff4519204f45eef17b308b4224 100644 --- a/core/phpcs.xml.dist +++ b/core/phpcs.xml.dist @@ -78,6 +78,7 @@ + diff --git a/core/profiles/minimal/src/Tests/MinimalTest.php b/core/profiles/minimal/src/Tests/MinimalTest.php index 7a505cd0a23b2b62aef8624bdc0a8a32f52999e6..c7e3228b0abd1b16561ee7474de6464219741541 100644 --- a/core/profiles/minimal/src/Tests/MinimalTest.php +++ b/core/profiles/minimal/src/Tests/MinimalTest.php @@ -16,7 +16,7 @@ class MinimalTest extends WebTestBase { /** * Tests Minimal installation profile. */ - function testMinimal() { + public function testMinimal() { $this->drupalGet(''); // Check the login block is present. $this->assertLink(t('Create new account')); diff --git a/core/profiles/standard/tests/src/Functional/StandardTest.php b/core/profiles/standard/tests/src/Functional/StandardTest.php index 9baae37c82a818c864fb673f6a02d13f95f21100..f449c10a12f0742ec93f98091ca8d646a33b813e 100644 --- a/core/profiles/standard/tests/src/Functional/StandardTest.php +++ b/core/profiles/standard/tests/src/Functional/StandardTest.php @@ -31,7 +31,7 @@ class StandardTest extends BrowserTestBase { /** * Tests Standard installation profile. */ - function testStandard() { + public function testStandard() { $this->drupalGet(''); $this->assertLink(t('Contact')); $this->clickLink(t('Contact')); diff --git a/core/profiles/testing/modules/drupal_system_listing_compatible_test/src/Tests/SystemListingCompatibleTest.php b/core/profiles/testing/modules/drupal_system_listing_compatible_test/src/Tests/SystemListingCompatibleTest.php index ac2087be77abbf6fa54445273e6b0d4476a35b28..7df92f26075e21d158702bcbc816cffb370e412a 100644 --- a/core/profiles/testing/modules/drupal_system_listing_compatible_test/src/Tests/SystemListingCompatibleTest.php +++ b/core/profiles/testing/modules/drupal_system_listing_compatible_test/src/Tests/SystemListingCompatibleTest.php @@ -35,7 +35,7 @@ class SystemListingCompatibleTest extends WebTestBase { /** * Non-empty test* method required to executed the test case class. */ - function testSystemListing() { + public function testSystemListing() { $this->pass(__CLASS__ . ' test executed.'); } diff --git a/core/tests/Drupal/FunctionalTests/GetTestMethodCallerTest.php b/core/tests/Drupal/FunctionalTests/GetTestMethodCallerTest.php index 0281d26fc11175210a40152d0adeeb875ce972e6..f40ff20e921a02afab9b0e51d2a0bf4a6761b315 100644 --- a/core/tests/Drupal/FunctionalTests/GetTestMethodCallerTest.php +++ b/core/tests/Drupal/FunctionalTests/GetTestMethodCallerTest.php @@ -14,7 +14,7 @@ class GetTestMethodCallerTest extends BrowserTestBase { /** * Tests BrowserTestBase::getTestMethodCaller(). */ - function testGetTestMethodCaller() { + public function testGetTestMethodCaller() { $method_caller = $this->getTestMethodCaller(); $expected = [ 'file' => __FILE__, diff --git a/core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php b/core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php index 3e058028110d14f94d7f0e75ad834bde13a9d2ad..fa409afc8b76d7150c0a74f6c46b6764944ea804 100644 --- a/core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php +++ b/core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php @@ -55,7 +55,7 @@ protected function setUp() { /** * Tests that default CSS and JavaScript is empty. */ - function testDefault() { + public function testDefault() { $assets = new AttachedAssets(); $this->assertEqual([], $this->assetResolver->getCssAssets($assets, FALSE), 'Default CSS is empty.'); list($js_assets_header, $js_assets_footer) = $this->assetResolver->getJsAssets($assets, FALSE); @@ -66,7 +66,7 @@ function testDefault() { /** * Tests non-existing libraries. */ - function testLibraryUnknown() { + public function testLibraryUnknown() { $build['#attached']['library'][] = 'core/unknown'; $assets = AttachedAssets::createFromRenderArray($build); @@ -76,7 +76,7 @@ function testLibraryUnknown() { /** * Tests adding a CSS and a JavaScript file. */ - function testAddFiles() { + public function testAddFiles() { $build['#attached']['library'][] = 'common_test/files'; $assets = AttachedAssets::createFromRenderArray($build); @@ -97,7 +97,7 @@ function testAddFiles() { /** * Tests adding JavaScript settings. */ - function testAddJsSettings() { + public function testAddJsSettings() { // Add a file in order to test default settings. $build['#attached']['library'][] = 'core/drupalSettings'; $assets = AttachedAssets::createFromRenderArray($build); @@ -116,7 +116,7 @@ function testAddJsSettings() { /** * Tests adding external CSS and JavaScript files. */ - function testAddExternalFiles() { + public function testAddExternalFiles() { $build['#attached']['library'][] = 'common_test/external'; $assets = AttachedAssets::createFromRenderArray($build); @@ -136,7 +136,7 @@ function testAddExternalFiles() { /** * Tests adding JavaScript files with additional attributes. */ - function testAttributes() { + public function testAttributes() { $build['#attached']['library'][] = 'common_test/js-attributes'; $assets = AttachedAssets::createFromRenderArray($build); @@ -152,7 +152,7 @@ function testAttributes() { /** * Tests that attributes are maintained when JS aggregation is enabled. */ - function testAggregatedAttributes() { + public function testAggregatedAttributes() { $build['#attached']['library'][] = 'common_test/js-attributes'; $assets = AttachedAssets::createFromRenderArray($build); @@ -168,7 +168,7 @@ function testAggregatedAttributes() { /** * Integration test for CSS/JS aggregation. */ - function testAggregation() { + public function testAggregation() { $build['#attached']['library'][] = 'core/drupal.timezone'; $build['#attached']['library'][] = 'core/drupal.vertical-tabs'; $assets = AttachedAssets::createFromRenderArray($build); @@ -186,7 +186,7 @@ function testAggregation() { /** * Tests JavaScript settings. */ - function testSettings() { + public function testSettings() { $build = []; $build['#attached']['library'][] = 'core/drupalSettings'; // Nonsensical value to verify if it's possible to override path settings. @@ -226,7 +226,7 @@ function testSettings() { /** * Tests JS assets depending on the 'core/' virtual library. */ - function testHeaderHTML() { + public function testHeaderHTML() { $build['#attached']['library'][] = 'common_test/js-header'; $assets = AttachedAssets::createFromRenderArray($build); @@ -242,7 +242,7 @@ function testHeaderHTML() { /** * Tests that for assets with cache = FALSE, Drupal sets preprocess = FALSE. */ - function testNoCache() { + public function testNoCache() { $build['#attached']['library'][] = 'common_test/no-cache'; $assets = AttachedAssets::createFromRenderArray($build); @@ -255,7 +255,7 @@ function testNoCache() { * * @see \Drupal\Core\Render\Element\HtmlTag::preRenderConditionalComments() */ - function testBrowserConditionalComments() { + public function testBrowserConditionalComments() { $default_query_string = $this->container->get('state')->get('system.css_js_query_string') ?: '0'; $build['#attached']['library'][] = 'common_test/browsers'; @@ -274,7 +274,7 @@ function testBrowserConditionalComments() { /** * Tests JavaScript versioning. */ - function testVersionQueryString() { + public function testVersionQueryString() { $build['#attached']['library'][] = 'core/backbone'; $build['#attached']['library'][] = 'core/domready'; $assets = AttachedAssets::createFromRenderArray($build); @@ -289,7 +289,7 @@ function testVersionQueryString() { /** * Tests JavaScript and CSS asset ordering. */ - function testRenderOrder() { + public function testRenderOrder() { $build['#attached']['library'][] = 'common_test/order'; $assets = AttachedAssets::createFromRenderArray($build); @@ -366,7 +366,7 @@ function testRenderOrder() { /** * Tests rendering the JavaScript with a file's weight above jQuery's. */ - function testRenderDifferentWeight() { + public function testRenderDifferentWeight() { // If a library contains assets A and B, and A is listed first, then B can // still make itself appear first by defining a lower weight. $build['#attached']['library'][] = 'core/jquery'; @@ -386,7 +386,7 @@ function testRenderDifferentWeight() { * * @see simpletest_js_alter() */ - function testAlter() { + public function testAlter() { // Add both tableselect.js and simpletest.js. $build['#attached']['library'][] = 'core/drupal.tableselect'; $build['#attached']['library'][] = 'simpletest/drupal.simpletest'; @@ -406,7 +406,7 @@ function testAlter() { * * @see common_test_library_info_alter() */ - function testLibraryAlter() { + public function testLibraryAlter() { // Verify that common_test altered the title of Farbtastic. /** @var \Drupal\Core\Asset\LibraryDiscoveryInterface $library_discovery */ $library_discovery = \Drupal::service('library.discovery'); @@ -425,7 +425,7 @@ function testLibraryAlter() { /** * Dynamically defines an asset library and alters it. */ - function testDynamicLibrary() { + public function testDynamicLibrary() { /** @var \Drupal\Core\Asset\LibraryDiscoveryInterface $library_discovery */ $library_discovery = \Drupal::service('library.discovery'); // Retrieve a dynamic library definition. @@ -449,7 +449,7 @@ function testDynamicLibrary() { * * @see common_test.library.yml */ - function testLibraryNameConflicts() { + public function testLibraryNameConflicts() { /** @var \Drupal\Core\Asset\LibraryDiscoveryInterface $library_discovery */ $library_discovery = \Drupal::service('library.discovery'); $farbtastic = $library_discovery->getLibraryByName('common_test', 'jquery.farbtastic'); @@ -459,7 +459,7 @@ function testLibraryNameConflicts() { /** * Tests JavaScript files that have querystrings attached get added right. */ - function testAddJsFileWithQueryString() { + public function testAddJsFileWithQueryString() { $build['#attached']['library'][] = 'common_test/querystring'; $assets = AttachedAssets::createFromRenderArray($build); diff --git a/core/tests/Drupal/KernelTests/Core/Bootstrap/GetFilenameTest.php b/core/tests/Drupal/KernelTests/Core/Bootstrap/GetFilenameTest.php index 9246eaa22edd866fb05499811e9c51c92ec171b4..4c5448718ed2e3f8d27af1c43c36166a97bebba4 100644 --- a/core/tests/Drupal/KernelTests/Core/Bootstrap/GetFilenameTest.php +++ b/core/tests/Drupal/KernelTests/Core/Bootstrap/GetFilenameTest.php @@ -29,7 +29,7 @@ public function register(ContainerBuilder $container) { /** * Tests that drupal_get_filename() works when the file is not in database. */ - function testDrupalGetFilename() { + public function testDrupalGetFilename() { // Rebuild system.module.files state data. // @todo Remove as part of https://www.drupal.org/node/2186491 drupal_static_reset('system_rebuild_module_data'); diff --git a/core/tests/Drupal/KernelTests/Core/Bootstrap/ResettableStaticTest.php b/core/tests/Drupal/KernelTests/Core/Bootstrap/ResettableStaticTest.php index 7b90ec1167c30231818e0857c0d11467f9a162cd..a2a7a85b8c74041366d3313798eb7ecc685947bd 100644 --- a/core/tests/Drupal/KernelTests/Core/Bootstrap/ResettableStaticTest.php +++ b/core/tests/Drupal/KernelTests/Core/Bootstrap/ResettableStaticTest.php @@ -17,7 +17,7 @@ class ResettableStaticTest extends KernelTestBase { * Tests that a variable reference returned by drupal_static() gets reset when * drupal_static_reset() is called. */ - function testDrupalStatic() { + public function testDrupalStatic() { $name = __CLASS__ . '_' . __METHOD__; $var = &drupal_static($name, 'foo'); $this->assertEqual($var, 'foo', 'Variable returned by drupal_static() was set to its default.'); diff --git a/core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php b/core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php index 8179d7d5a1d1bc8e456664ba34c490945fe873d6..4e57a71f6cdf7ac3d37d0d7669487892cbf92e2d 100644 --- a/core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php +++ b/core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php @@ -491,7 +491,7 @@ public function testDeleteAll() { * Test Drupal\Core\Cache\CacheBackendInterface::invalidate() and * Drupal\Core\Cache\CacheBackendInterface::invalidateMultiple(). */ - function testInvalidate() { + public function testInvalidate() { $backend = $this->getCacheBackend(); $backend->set('test1', 1); $backend->set('test2', 2); @@ -523,7 +523,7 @@ function testInvalidate() { /** * Tests Drupal\Core\Cache\CacheBackendInterface::invalidateTags(). */ - function testInvalidateTags() { + public function testInvalidateTags() { $backend = $this->getCacheBackend(); // Create two cache entries with the same tag and tag value. diff --git a/core/tests/Drupal/KernelTests/Core/Common/SizeTest.php b/core/tests/Drupal/KernelTests/Core/Common/SizeTest.php index a759bb5c16dc601a11cd16ec936158e06f0b3d9c..9829b266d347de3f9dd220d11c7d0bda1c97d5df 100644 --- a/core/tests/Drupal/KernelTests/Core/Common/SizeTest.php +++ b/core/tests/Drupal/KernelTests/Core/Common/SizeTest.php @@ -41,7 +41,7 @@ protected function setUp() { /** * Checks that format_size() returns the expected string. */ - function testCommonFormatSize() { + public function testCommonFormatSize() { foreach ([$this->exactTestCases, $this->roundedTestCases] as $test_cases) { foreach ($test_cases as $expected => $input) { $this->assertEqual( @@ -56,7 +56,7 @@ function testCommonFormatSize() { /** * Cross-tests Bytes::toInt() and format_size(). */ - function testCommonParseSizeFormatSize() { + public function testCommonParseSizeFormatSize() { foreach ($this->exactTestCases as $size) { $this->assertEqual( $size, diff --git a/core/tests/Drupal/KernelTests/Core/Common/XssUnitTest.php b/core/tests/Drupal/KernelTests/Core/Common/XssUnitTest.php index 0a67384148d19fee6bdf045c882c358383446ced..23754879eb8783f17e2c7708ac120f6feecbb0c8 100644 --- a/core/tests/Drupal/KernelTests/Core/Common/XssUnitTest.php +++ b/core/tests/Drupal/KernelTests/Core/Common/XssUnitTest.php @@ -28,7 +28,7 @@ protected function setUp() { /** * Tests t() functionality. */ - function testT() { + public function testT() { $text = t('Simple text'); $this->assertEqual($text, 'Simple text', 't leaves simple text alone.'); $text = t('Escaped text: @value', ['@value' => '