diff --git a/composer.json b/composer.json
index b7a6b830..2fdc5c7a 100644
--- a/composer.json
+++ b/composer.json
@@ -18,8 +18,10 @@
"composer/installers": "^1.2",
"drupal/address": "^1.8",
"drupal/audiofield": "^1.9",
+ "drupal/backup_migrate": "^4.1",
"drupal/core-composer-scaffold": "^8.8",
"drupal/core-recommended": "^8.8",
+ "drupal/entity_browser_enhanced": "^1.0",
"drupal/field_group": "^3.0",
"drupal/field_token_value": "^1.0",
"drupal/linkit": "^4.3",
@@ -28,8 +30,11 @@
"drupal/paragraphs": "^1.12",
"drupal/pathauto": "^1.8",
"drupal/schema_metatag": "^1.5",
+ "drupal/site_settings": "^1.19",
"drupal/subpathauto": "^1.1",
"drupal/time_range": "^8.1",
+ "drupal/transliterate_filenames": "^1.4",
+ "drupal/varbase_total_control": "^6.11",
"drupal/video_embed_field": "^2.4",
"drupal/views_url_path_arguments": "^1.1",
"drush/drush": "^10.2",
diff --git a/composer.lock b/composer.lock
index 0d4c9e14..5764fc16 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "d330160d73756a7a964f55d654df05cc",
+ "content-hash": "bc0461f18dc854574df2bf17fd849558",
"packages": [
{
"name": "asm89/stack-cors",
@@ -1125,6 +1125,50 @@
"abandoned": "psr/container",
"time": "2017-02-14T19:40:03+00:00"
},
+ {
+ "name": "cweagans/composer-patches",
+ "version": "1.6.7",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/cweagans/composer-patches.git",
+ "reference": "2e6f72a2ad8d59cd7e2b729f218bf42adb14f590"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/2e6f72a2ad8d59cd7e2b729f218bf42adb14f590",
+ "reference": "2e6f72a2ad8d59cd7e2b729f218bf42adb14f590",
+ "shasum": ""
+ },
+ "require": {
+ "composer-plugin-api": "^1.0",
+ "php": ">=5.3.0"
+ },
+ "require-dev": {
+ "composer/composer": "~1.0",
+ "phpunit/phpunit": "~4.6"
+ },
+ "type": "composer-plugin",
+ "extra": {
+ "class": "cweagans\\Composer\\Patches"
+ },
+ "autoload": {
+ "psr-4": {
+ "cweagans\\Composer\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Cameron Eagans",
+ "email": "me@cweagans.net"
+ }
+ ],
+ "description": "Provides a way to patch Composer packages.",
+ "time": "2019-08-29T20:11:49+00:00"
+ },
{
"name": "dflydev/dot-access-data",
"version": "v1.1.0",
@@ -1750,17 +1794,145 @@
}
},
{
- "name": "drupal/core",
- "version": "8.9.0",
+ "name": "drupal/backup_migrate",
+ "version": "4.1.0",
"source": {
"type": "git",
- "url": "https://github.com/drupal/core.git",
- "reference": "f90882ab0723becda2333e4d33e1a6ab27cb8f0c"
+ "url": "https://git.drupalcode.org/project/backup_migrate.git",
+ "reference": "8.x-4.1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/drupal/core/zipball/f90882ab0723becda2333e4d33e1a6ab27cb8f0c",
- "reference": "f90882ab0723becda2333e4d33e1a6ab27cb8f0c",
+ "url": "https://ftp.drupal.org/files/projects/backup_migrate-8.x-4.1.zip",
+ "reference": "8.x-4.1",
+ "shasum": "5ee3b9a1131e6dd1ad4bc65cdef8248c7784dc51"
+ },
+ "require": {
+ "drupal/core": "~8.0"
+ },
+ "type": "drupal-module",
+ "extra": {
+ "drupal": {
+ "version": "8.x-4.1",
+ "datestamp": "1576877587",
+ "security-coverage": {
+ "status": "covered",
+ "message": "Covered by Drupal's security advisory policy"
+ }
+ }
+ },
+ "notification-url": "https://packages.drupal.org/8/downloads",
+ "license": [
+ "GPL-2.0+"
+ ],
+ "authors": [
+ {
+ "name": "Ronan Dowling",
+ "homepage": "https://www.drupal.org/u/ronan",
+ "role": "Maintainer"
+ },
+ {
+ "name": "Alex Andrascu",
+ "homepage": "https://www.drupal.org/u/alex-andrascu",
+ "role": "Maintainer"
+ },
+ {
+ "name": "dgorton",
+ "homepage": "https://www.drupal.org/user/19044"
+ },
+ {
+ "name": "ikit-claw",
+ "homepage": "https://www.drupal.org/user/3285813"
+ },
+ {
+ "name": "ronan",
+ "homepage": "https://www.drupal.org/user/72815"
+ }
+ ],
+ "description": "Backup and Migrate Drupal Module",
+ "homepage": "https://www.drupal.org/project/backup_migrate",
+ "support": {
+ "source": "http://cgit.drupalcode.org/backup_migrate",
+ "issues": "https://www.drupal.org/project/issues/backup_migrate",
+ "slack": "https://drupal.slack.com/messages/C7C4M4QJV/details/"
+ }
+ },
+ {
+ "name": "drupal/charts",
+ "version": "3.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://git.drupalcode.org/project/charts.git",
+ "reference": "8.x-3.2"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://ftp.drupal.org/files/projects/charts-8.x-3.2.zip",
+ "reference": "8.x-3.2",
+ "shasum": "7caf427ce981962036f8335e94f41fc88f36db72"
+ },
+ "require": {
+ "drupal/core": "^8 || ^9"
+ },
+ "type": "drupal-module",
+ "extra": {
+ "drupal": {
+ "version": "8.x-3.2",
+ "datestamp": "1588134278",
+ "security-coverage": {
+ "status": "covered",
+ "message": "Covered by Drupal's security advisory policy"
+ }
+ }
+ },
+ "notification-url": "https://packages.drupal.org/8/downloads",
+ "license": [
+ "GPL-2.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Pierre.Vriens",
+ "homepage": "https://www.drupal.org/user/1689304"
+ },
+ {
+ "name": "andileco",
+ "homepage": "https://www.drupal.org/user/2054544"
+ },
+ {
+ "name": "brmassa",
+ "homepage": "https://www.drupal.org/user/67164"
+ },
+ {
+ "name": "kenorb",
+ "homepage": "https://www.drupal.org/user/191974"
+ },
+ {
+ "name": "quicksketch",
+ "homepage": "https://www.drupal.org/user/35821"
+ },
+ {
+ "name": "rashad612",
+ "homepage": "https://www.drupal.org/user/319686"
+ }
+ ],
+ "description": "A charting API for Drupal that provides chart elements and integration with Views.",
+ "homepage": "https://www.drupal.org/project/charts",
+ "support": {
+ "source": "https://git.drupalcode.org/project/charts"
+ }
+ },
+ {
+ "name": "drupal/core",
+ "version": "8.9.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/drupal/core.git",
+ "reference": "8f0e24555c093669ce41edbb30637fe19df16802"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/drupal/core/zipball/8f0e24555c093669ce41edbb30637fe19df16802",
+ "reference": "8f0e24555c093669ce41edbb30637fe19df16802",
"shasum": ""
},
"require": {
@@ -1973,22 +2145,16 @@
"lib/Drupal/Core/Site/Settings.php"
]
},
- "scripts": {
- "pre-autoload-dump": [
- "Drupal\\Core\\Composer\\Composer::preAutoloadDump"
- ],
- "post-autoload-dump": [
- "Drupal\\Core\\Composer\\Composer::ensureHtaccess"
- ]
- },
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-2.0-or-later"
],
- "description": "Drupal is an open source content management platform powering millions of websites and applications."
+ "description": "Drupal is an open source content management platform powering millions of websites and applications.",
+ "time": "2020-07-08T18:53:45+00:00"
},
{
"name": "drupal/core-composer-scaffold",
- "version": "8.9.0",
+ "version": "8.9.2",
"source": {
"type": "git",
"url": "https://github.com/drupal/core-composer-scaffold.git",
@@ -2022,6 +2188,7 @@
"Drupal\\Composer\\Plugin\\Scaffold\\": ""
}
},
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-2.0-or-later"
],
@@ -2029,20 +2196,21 @@
"homepage": "https://www.drupal.org/project/drupal",
"keywords": [
"drupal"
- ]
+ ],
+ "time": "2020-05-29T11:36:27+00:00"
},
{
"name": "drupal/core-recommended",
- "version": "8.9.0",
+ "version": "8.9.2",
"source": {
"type": "git",
"url": "https://github.com/drupal/core-recommended.git",
- "reference": "1b87cf5dea633a66a1c4f22d635bc92c127071d9"
+ "reference": "8301ff766f17ce8a9eb36d3ffd183cbfff01dad6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/drupal/core-recommended/zipball/1b87cf5dea633a66a1c4f22d635bc92c127071d9",
- "reference": "1b87cf5dea633a66a1c4f22d635bc92c127071d9",
+ "url": "https://api.github.com/repos/drupal/core-recommended/zipball/8301ff766f17ce8a9eb36d3ffd183cbfff01dad6",
+ "reference": "8301ff766f17ce8a9eb36d3ffd183cbfff01dad6",
"shasum": ""
},
"require": {
@@ -2054,7 +2222,7 @@
"doctrine/common": "v2.7.3",
"doctrine/inflector": "v1.2.0",
"doctrine/lexer": "1.0.2",
- "drupal/core": "8.9.0",
+ "drupal/core": "8.9.2",
"easyrdf/easyrdf": "0.9.1",
"egulias/email-validator": "2.1.17",
"guzzlehttp/guzzle": "6.5.4",
@@ -2106,10 +2274,12 @@
"webflo/drupal-core-strict": "*"
},
"type": "metapackage",
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-2.0-or-later"
],
- "description": "Locked core dependencies; require this project INSTEAD OF drupal/core."
+ "description": "Locked core dependencies; require this project INSTEAD OF drupal/core.",
+ "time": "2020-07-08T18:53:45+00:00"
},
{
"name": "drupal/ctools",
@@ -2201,6 +2371,185 @@
"issues": "https://www.drupal.org/project/issues/ctools"
}
},
+ {
+ "name": "drupal/drupal-library-installer-plugin",
+ "version": "0.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/promet/drupal-libraries-installer-plugin.git",
+ "reference": "6d4eb744a1f244dfc290976104ecf522466a768b"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/promet/drupal-libraries-installer-plugin/zipball/6d4eb744a1f244dfc290976104ecf522466a768b",
+ "reference": "6d4eb744a1f244dfc290976104ecf522466a768b",
+ "shasum": ""
+ },
+ "require": {
+ "composer-plugin-api": "^1.0"
+ },
+ "type": "composer-plugin",
+ "extra": {
+ "class": "Drupal\\Composer\\DrupalLibraryInstallerPlugin"
+ },
+ "autoload": {
+ "psr-0": {
+ "Drupal\\Composer": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "authors": [
+ {
+ "name": "Allan Chappell",
+ "email": "generalredneck@gmail.com"
+ }
+ ],
+ "time": "2015-12-04T21:39:03+00:00"
+ },
+ {
+ "name": "drupal/entity_browser",
+ "version": "2.5.0",
+ "source": {
+ "type": "git",
+ "url": "https://git.drupalcode.org/project/entity_browser.git",
+ "reference": "8.x-2.5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://ftp.drupal.org/files/projects/entity_browser-8.x-2.5.zip",
+ "reference": "8.x-2.5",
+ "shasum": "29456b961f0f90ff064601ab8a382446a8143774"
+ },
+ "require": {
+ "drupal/core": "^8.8 || ^9"
+ },
+ "require-dev": {
+ "drupal/embed": "~1.0",
+ "drupal/entity_embed": "1.x-dev",
+ "drupal/entity_reference_revisions": "1.x-dev",
+ "drupal/entityqueue": "1.x-dev",
+ "drupal/inline_entity_form": "1.x-dev",
+ "drupal/paragraphs": "1.x-dev",
+ "drupal/token": "~1.0"
+ },
+ "type": "drupal-module",
+ "extra": {
+ "drupal": {
+ "version": "8.x-2.5",
+ "datestamp": "1588015429",
+ "security-coverage": {
+ "status": "covered",
+ "message": "Covered by Drupal's security advisory policy"
+ }
+ }
+ },
+ "notification-url": "https://packages.drupal.org/8/downloads",
+ "license": [
+ "GPL-2.0+"
+ ],
+ "authors": [
+ {
+ "name": "Janez Urevc",
+ "homepage": "https://github.com/slashrsm",
+ "role": "Maintainer"
+ },
+ {
+ "name": "Primoz Hmeljak",
+ "homepage": "https://github.com/primsi",
+ "role": "Maintainer"
+ },
+ {
+ "name": "See other contributors",
+ "homepage": "https://www.drupal.org/node/1943336/committers",
+ "role": "contributor"
+ },
+ {
+ "name": "Drupal Media Team",
+ "homepage": "https://www.drupal.org/user/3260690"
+ },
+ {
+ "name": "Primsi",
+ "homepage": "https://www.drupal.org/user/282629"
+ },
+ {
+ "name": "marcingy",
+ "homepage": "https://www.drupal.org/user/77320"
+ },
+ {
+ "name": "oknate",
+ "homepage": "https://www.drupal.org/user/471638"
+ },
+ {
+ "name": "samuel.mortenson",
+ "homepage": "https://www.drupal.org/user/2582268"
+ },
+ {
+ "name": "slashrsm",
+ "homepage": "https://www.drupal.org/user/744628"
+ }
+ ],
+ "description": "Entity browsing and selecting component.",
+ "homepage": "http://drupal.org/project/entity_browser",
+ "support": {
+ "source": "https://git.drupalcode.org/project/entity_browser",
+ "issues": "https://www.drupal.org/project/issues/entity_browser",
+ "irc": "irc://irc.freenode.org/drupal-contribute"
+ }
+ },
+ {
+ "name": "drupal/entity_browser_enhanced",
+ "version": "1.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://git.drupalcode.org/project/entity_browser_enhanced.git",
+ "reference": "8.x-1.0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://ftp.drupal.org/files/projects/entity_browser_enhanced-8.x-1.0.zip",
+ "reference": "8.x-1.0",
+ "shasum": "c309e3c3eb65c358fafc577de68f3cbb8c118865"
+ },
+ "require": {
+ "drupal/core": "^8 || ^9",
+ "drupal/entity_browser": "~2.0"
+ },
+ "type": "drupal-module",
+ "extra": {
+ "drupal": {
+ "version": "8.x-1.0",
+ "datestamp": "1581940931",
+ "security-coverage": {
+ "status": "covered",
+ "message": "Covered by Drupal's security advisory policy"
+ }
+ },
+ "branch-alias": {
+ "dev-8.x-1.x": "8.1.x-dev"
+ }
+ },
+ "notification-url": "https://packages.drupal.org/8/downloads",
+ "license": [
+ "GPL-2.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Vardot",
+ "homepage": "https://www.drupal.org/vardot",
+ "role": "Maintainer"
+ },
+ {
+ "name": "RajabNatshah",
+ "homepage": "https://www.drupal.org/user/1414312"
+ }
+ ],
+ "description": "Provides some behavior and style enhancements to Entity Browsers, specifically for multiselect and image/media browsers.",
+ "homepage": "https://www.drupal.org/project/entity_browser_enhanced",
+ "support": {
+ "source": "http://cgit.drupalcode.org/entity_browser_enhanced",
+ "issues": "https://www.drupal.org/project/issues/entity_browser_enhanced"
+ }
+ },
{
"name": "drupal/entity_reference_revisions",
"version": "1.8.0",
@@ -2265,26 +2614,29 @@
},
{
"name": "drupal/field_group",
- "version": "3.0.0",
+ "version": "3.1.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/field_group.git",
- "reference": "8.x-3.0"
+ "reference": "8.x-3.1"
},
"dist": {
"type": "zip",
- "url": "https://ftp.drupal.org/files/projects/field_group-8.x-3.0.zip",
- "reference": "8.x-3.0",
- "shasum": "8d87cdc4abc417aa4d411bffcaeb0a3ef1afa497"
+ "url": "https://ftp.drupal.org/files/projects/field_group-8.x-3.1.zip",
+ "reference": "8.x-3.1",
+ "shasum": "8a719eaea594f0ba874172831cb28da93c66b77a"
},
"require": {
- "drupal/core": "^8 || ^9"
+ "drupal/core": "^8.8 || ^9"
+ },
+ "require-dev": {
+ "drupal/jquery_ui_accordion": "^1.0"
},
"type": "drupal-module",
"extra": {
"drupal": {
- "version": "8.x-3.0",
- "datestamp": "1580250787",
+ "version": "8.x-3.1",
+ "datestamp": "1591772567",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
@@ -2293,7 +2645,7 @@
},
"notification-url": "https://packages.drupal.org/8/downloads",
"license": [
- "GPL-2.0+"
+ "GPL-2.0-or-later"
],
"authors": [
{
@@ -2320,7 +2672,8 @@
"description": "Provides the field_group module.",
"homepage": "https://www.drupal.org/project/field_group",
"support": {
- "source": "https://git.drupalcode.org/project/field_group"
+ "source": "https://git.drupalcode.org/project/field_group",
+ "issues": "https://www.drupal.org/project/issues/field_group"
}
},
{
@@ -2371,6 +2724,328 @@
"source": "https://git.drupalcode.org/project/field_token_value"
}
},
+ {
+ "name": "drupal/google_analytics_reports",
+ "version": "3.0.0-rc2",
+ "source": {
+ "type": "git",
+ "url": "https://git.drupalcode.org/project/google_analytics_reports.git",
+ "reference": "8.x-3.0-rc2"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://ftp.drupal.org/files/projects/google_analytics_reports-8.x-3.0-rc2.zip",
+ "reference": "8.x-3.0-rc2",
+ "shasum": "fbe050883db8f1264973e420e42e555f6539f436"
+ },
+ "require": {
+ "drupal/core": "^8 || ^9",
+ "drupal/google_analytics_reports_api": "*"
+ },
+ "type": "drupal-module",
+ "extra": {
+ "drupal": {
+ "version": "8.x-3.0-rc2",
+ "datestamp": "1591782424",
+ "security-coverage": {
+ "status": "not-covered",
+ "message": "RC releases are not covered by Drupal security advisories."
+ }
+ }
+ },
+ "notification-url": "https://packages.drupal.org/8/downloads",
+ "license": [
+ "GPL-2.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Mohammed J. Razem",
+ "homepage": "https://www.drupal.org/user/255384"
+ },
+ {
+ "name": "Plazik",
+ "homepage": "https://www.drupal.org/user/982724"
+ },
+ {
+ "name": "RajabNatshah",
+ "homepage": "https://www.drupal.org/user/1414312"
+ },
+ {
+ "name": "grendzy",
+ "homepage": "https://www.drupal.org/user/96647"
+ },
+ {
+ "name": "jantoine",
+ "homepage": "https://www.drupal.org/user/192192"
+ },
+ {
+ "name": "jkitching",
+ "homepage": "https://www.drupal.org/user/159067"
+ },
+ {
+ "name": "jojonaloha",
+ "homepage": "https://www.drupal.org/user/1579186"
+ },
+ {
+ "name": "raspberryman",
+ "homepage": "https://www.drupal.org/user/71464"
+ }
+ ],
+ "description": "Display statistics from Google Analytics using Views.",
+ "homepage": "https://www.drupal.org/project/google_analytics_reports",
+ "support": {
+ "source": "https://git.drupalcode.org/project/google_analytics_reports"
+ }
+ },
+ {
+ "name": "drupal/google_analytics_reports_api",
+ "version": "3.0.0-rc2",
+ "require": {
+ "drupal/core": "^8 || ^9",
+ "drupal/google_analytics_reports": "self.version"
+ },
+ "type": "metapackage",
+ "extra": {
+ "drupal": {
+ "version": "8.x-3.0-rc2",
+ "datestamp": "1591782424",
+ "security-coverage": {
+ "status": "not-covered",
+ "message": "RC releases are not covered by Drupal security advisories."
+ }
+ }
+ },
+ "notification-url": "https://packages.drupal.org/8/downloads",
+ "license": [
+ "GPL-2.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Mohammed J. Razem",
+ "homepage": "https://www.drupal.org/user/255384"
+ },
+ {
+ "name": "Plazik",
+ "homepage": "https://www.drupal.org/user/982724"
+ },
+ {
+ "name": "RajabNatshah",
+ "homepage": "https://www.drupal.org/user/1414312"
+ },
+ {
+ "name": "grendzy",
+ "homepage": "https://www.drupal.org/user/96647"
+ },
+ {
+ "name": "jantoine",
+ "homepage": "https://www.drupal.org/user/192192"
+ },
+ {
+ "name": "jkitching",
+ "homepage": "https://www.drupal.org/user/159067"
+ },
+ {
+ "name": "jojonaloha",
+ "homepage": "https://www.drupal.org/user/1579186"
+ },
+ {
+ "name": "raspberryman",
+ "homepage": "https://www.drupal.org/user/71464"
+ }
+ ],
+ "description": "API to access statistics from the Google Analytics Core Reporting API.",
+ "homepage": "https://www.drupal.org/project/google_analytics_reports",
+ "support": {
+ "source": "https://git.drupalcode.org/project/google_analytics_reports"
+ }
+ },
+ {
+ "name": "drupal/jquery_ui",
+ "version": "1.4.0",
+ "source": {
+ "type": "git",
+ "url": "https://git.drupalcode.org/project/jquery_ui.git",
+ "reference": "8.x-1.4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://ftp.drupal.org/files/projects/jquery_ui-8.x-1.4.zip",
+ "reference": "8.x-1.4",
+ "shasum": "64c19ecc8902e2b4b1ab0cc5f5fe28dbc83bfebe"
+ },
+ "require": {
+ "drupal/core": "^8 || ^9"
+ },
+ "type": "drupal-module",
+ "extra": {
+ "drupal": {
+ "version": "8.x-1.4",
+ "datestamp": "1582149957",
+ "security-coverage": {
+ "status": "covered",
+ "message": "Covered by Drupal's security advisory policy"
+ }
+ }
+ },
+ "notification-url": "https://packages.drupal.org/8/downloads",
+ "license": [
+ "GPL-2.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "RobLoach",
+ "homepage": "https://www.drupal.org/user/61114"
+ },
+ {
+ "name": "jjeff",
+ "homepage": "https://www.drupal.org/user/17190"
+ },
+ {
+ "name": "lauriii",
+ "homepage": "https://www.drupal.org/user/1078742"
+ },
+ {
+ "name": "litwol",
+ "homepage": "https://www.drupal.org/user/78134"
+ },
+ {
+ "name": "mfb",
+ "homepage": "https://www.drupal.org/user/12302"
+ },
+ {
+ "name": "mfer",
+ "homepage": "https://www.drupal.org/user/25701"
+ },
+ {
+ "name": "mikelutz",
+ "homepage": "https://www.drupal.org/user/2972409"
+ },
+ {
+ "name": "sun",
+ "homepage": "https://www.drupal.org/user/54136"
+ },
+ {
+ "name": "webchick",
+ "homepage": "https://www.drupal.org/user/24967"
+ },
+ {
+ "name": "zrpnr",
+ "homepage": "https://www.drupal.org/user/1448368"
+ }
+ ],
+ "description": "Provides jQuery UI library.",
+ "homepage": "https://www.drupal.org/project/jquery_ui",
+ "support": {
+ "source": "https://git.drupalcode.org/project/jquery_ui"
+ }
+ },
+ {
+ "name": "drupal/jquery_ui_draggable",
+ "version": "1.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://git.drupalcode.org/project/jquery_ui_draggable.git",
+ "reference": "8.x-1.2"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://ftp.drupal.org/files/projects/jquery_ui_draggable-8.x-1.2.zip",
+ "reference": "8.x-1.2",
+ "shasum": "09e17046e38aebf84ed573822b0d5be6de3f0c94"
+ },
+ "require": {
+ "drupal/core": "^8 || ^9",
+ "drupal/jquery_ui": "*"
+ },
+ "type": "drupal-module",
+ "extra": {
+ "drupal": {
+ "version": "8.x-1.2",
+ "datestamp": "1582150027",
+ "security-coverage": {
+ "status": "covered",
+ "message": "Covered by Drupal's security advisory policy"
+ }
+ }
+ },
+ "notification-url": "https://packages.drupal.org/8/downloads",
+ "license": [
+ "GPL-2.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "bnjmnm",
+ "homepage": "https://www.drupal.org/user/2369194"
+ },
+ {
+ "name": "lauriii",
+ "homepage": "https://www.drupal.org/user/1078742"
+ },
+ {
+ "name": "zrpnr",
+ "homepage": "https://www.drupal.org/user/1448368"
+ }
+ ],
+ "description": "Provides jQuery UI Draggable library.",
+ "homepage": "https://www.drupal.org/project/jquery_ui_draggable",
+ "support": {
+ "source": "https://git.drupalcode.org/project/jquery_ui_draggable"
+ }
+ },
+ {
+ "name": "drupal/jquery_ui_droppable",
+ "version": "1.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://git.drupalcode.org/project/jquery_ui_droppable.git",
+ "reference": "8.x-1.2"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://ftp.drupal.org/files/projects/jquery_ui_droppable-8.x-1.2.zip",
+ "reference": "8.x-1.2",
+ "shasum": "6e53043f2d3215f211721eea4d4c6ab5d1672b14"
+ },
+ "require": {
+ "drupal/core": "^8 || ^9",
+ "drupal/jquery_ui": "*",
+ "drupal/jquery_ui_draggable": "*"
+ },
+ "type": "drupal-module",
+ "extra": {
+ "drupal": {
+ "version": "8.x-1.2",
+ "datestamp": "1582150071",
+ "security-coverage": {
+ "status": "covered",
+ "message": "Covered by Drupal's security advisory policy"
+ }
+ }
+ },
+ "notification-url": "https://packages.drupal.org/8/downloads",
+ "license": [
+ "GPL-2.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "bnjmnm",
+ "homepage": "https://www.drupal.org/user/2369194"
+ },
+ {
+ "name": "lauriii",
+ "homepage": "https://www.drupal.org/user/1078742"
+ },
+ {
+ "name": "zrpnr",
+ "homepage": "https://www.drupal.org/user/1448368"
+ }
+ ],
+ "description": "Provides jQuery UI Droppable library.",
+ "homepage": "https://www.drupal.org/project/jquery_ui_droppable",
+ "support": {
+ "source": "https://git.drupalcode.org/project/jquery_ui_droppable"
+ }
+ },
{
"name": "drupal/linkit",
"version": "4.3.0",
@@ -2419,18 +3094,68 @@
}
},
{
- "name": "drupal/mediteran",
- "version": "1.10.0",
+ "name": "drupal/masonry",
+ "version": "1.1.0",
"source": {
"type": "git",
- "url": "https://git.drupalcode.org/project/mediteran.git",
- "reference": "8.x-1.10"
+ "url": "https://git.drupalcode.org/project/masonry.git",
+ "reference": "8.x-1.1"
},
"dist": {
"type": "zip",
- "url": "https://ftp.drupal.org/files/projects/mediteran-8.x-1.10.zip",
- "reference": "8.x-1.10",
- "shasum": "da1b7389a7e33189ebdb9106d162c07aa68ced5d"
+ "url": "https://ftp.drupal.org/files/projects/masonry-8.x-1.1.zip",
+ "reference": "8.x-1.1",
+ "shasum": "c45e4b21e08b5fa3998bb1852282131ec8761c74"
+ },
+ "require": {
+ "drupal/core": "^8 || ^9"
+ },
+ "type": "drupal-module",
+ "extra": {
+ "drupal": {
+ "version": "8.x-1.1",
+ "datestamp": "1594537870",
+ "security-coverage": {
+ "status": "covered",
+ "message": "Covered by Drupal's security advisory policy"
+ }
+ }
+ },
+ "notification-url": "https://packages.drupal.org/8/downloads",
+ "license": [
+ "GPL-2.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Dominique Clause (Dom.)",
+ "homepage": "https://www.drupal.org/u/dom",
+ "role": "Maintainer"
+ },
+ {
+ "name": "Dom.",
+ "homepage": "https://www.drupal.org/user/801982"
+ }
+ ],
+ "description": "Masonry integrates with Masonry library",
+ "homepage": "https://www.drupal.org/project/masonry",
+ "support": {
+ "source": "https://git.drupalcode.org/project/masonry",
+ "issues": "https://www.drupal.org/project/issues/masonry?version=8.x"
+ }
+ },
+ {
+ "name": "drupal/mediteran",
+ "version": "1.11.0",
+ "source": {
+ "type": "git",
+ "url": "https://git.drupalcode.org/project/mediteran.git",
+ "reference": "8.x-1.11"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://ftp.drupal.org/files/projects/mediteran-8.x-1.11.zip",
+ "reference": "8.x-1.11",
+ "shasum": "93a72f234b862f73ec0fa43dc3a9d5fd5857f163"
},
"require": {
"drupal/core": "^8 || ^9"
@@ -2438,8 +3163,8 @@
"type": "drupal-theme",
"extra": {
"drupal": {
- "version": "8.x-1.10",
- "datestamp": "1590662208",
+ "version": "8.x-1.11",
+ "datestamp": "1594537822",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
@@ -2532,6 +3257,164 @@
"docs": "https://www.drupal.org/docs/8/modules/metatag"
}
},
+ {
+ "name": "drupal/page_manager",
+ "version": "4.0.0-beta6",
+ "source": {
+ "type": "git",
+ "url": "https://git.drupalcode.org/project/page_manager.git",
+ "reference": "8.x-4.0-beta6"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://ftp.drupal.org/files/projects/page_manager-8.x-4.0-beta6.zip",
+ "reference": "8.x-4.0-beta6",
+ "shasum": "bf0ac07177b1cd6c1a3da80f727f1448221ee98a"
+ },
+ "require": {
+ "drupal/core": "^8.8 || ^9",
+ "drupal/ctools": "^3.1"
+ },
+ "type": "drupal-module",
+ "extra": {
+ "drupal": {
+ "version": "8.x-4.0-beta6",
+ "datestamp": "1591125562",
+ "security-coverage": {
+ "status": "not-covered",
+ "message": "Project has not opted into security advisory coverage!"
+ }
+ },
+ "branch-alias": {
+ "dev-8.x-4.x": "4.x-dev"
+ }
+ },
+ "notification-url": "https://packages.drupal.org/8/downloads",
+ "license": [
+ "GPL-2.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Tim Plunkett",
+ "homepage": "https://www.drupal.org/u/tim.plunkett",
+ "role": "Maintainer"
+ },
+ {
+ "name": "dsnopek",
+ "homepage": "https://www.drupal.org/user/266527"
+ },
+ {
+ "name": "japerry",
+ "homepage": "https://www.drupal.org/user/45640"
+ },
+ {
+ "name": "manuel.adan",
+ "homepage": "https://www.drupal.org/user/516420"
+ },
+ {
+ "name": "phenaproxima",
+ "homepage": "https://www.drupal.org/user/205645"
+ }
+ ],
+ "description": "Provides a way to place blocks on a custom page.",
+ "homepage": "https://www.drupal.org/project/page_manager",
+ "support": {
+ "source": "https://git.drupal.org/project/page_manager.git",
+ "issues": "https://www.drupal.org/project/issues/page_manager",
+ "irc": "irc://irc.freenode.org/drupal-contribute"
+ }
+ },
+ {
+ "name": "drupal/panels",
+ "version": "4.6.0",
+ "source": {
+ "type": "git",
+ "url": "https://git.drupalcode.org/project/panels.git",
+ "reference": "8.x-4.6"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://ftp.drupal.org/files/projects/panels-8.x-4.6.zip",
+ "reference": "8.x-4.6",
+ "shasum": "6430436a4d8fb64f8c113729dd92505a1e46b794"
+ },
+ "require": {
+ "drupal/core": "^8.8 || ^9",
+ "drupal/ctools": ">=3.0.0",
+ "drupal/jquery_ui_droppable": "^1.2"
+ },
+ "require-dev": {
+ "drupal/jquery_ui_droppable": "*",
+ "drupal/page_manager": "^4"
+ },
+ "type": "drupal-module",
+ "extra": {
+ "drupal": {
+ "version": "8.x-4.6",
+ "datestamp": "1585870866",
+ "security-coverage": {
+ "status": "covered",
+ "message": "Covered by Drupal's security advisory policy"
+ }
+ },
+ "branch-alias": {
+ "dev-8.x-4.x": "4.x-dev"
+ }
+ },
+ "notification-url": "https://packages.drupal.org/8/downloads",
+ "license": [
+ "GPL-2.0+"
+ ],
+ "authors": [
+ {
+ "name": "Jakob Perry",
+ "homepage": "https://www.drupal.org/u/japerry"
+ },
+ {
+ "name": "Samuel Mortenson",
+ "homepage": "https://www.drupal.org/u/samuel.mortenson"
+ },
+ {
+ "name": "See other contributors",
+ "homepage": "https://www.drupal.org/node/74958/committers"
+ },
+ {
+ "name": "japerry",
+ "homepage": "https://www.drupal.org/user/45640"
+ },
+ {
+ "name": "joelpittet",
+ "homepage": "https://www.drupal.org/user/160302"
+ },
+ {
+ "name": "merlinofchaos",
+ "homepage": "https://www.drupal.org/user/26979"
+ },
+ {
+ "name": "neclimdul",
+ "homepage": "https://www.drupal.org/user/48673"
+ },
+ {
+ "name": "phenaproxima",
+ "homepage": "https://www.drupal.org/user/205645"
+ },
+ {
+ "name": "samuel.mortenson",
+ "homepage": "https://www.drupal.org/user/2582268"
+ },
+ {
+ "name": "tim.plunkett",
+ "homepage": "https://www.drupal.org/user/241634"
+ }
+ ],
+ "description": "Core Panels display functions; provides no external UI, at least one other Panels module should be enabled.",
+ "homepage": "https://www.drupal.org/project/panels",
+ "support": {
+ "source": "http://git.drupal.org/project/panels.git",
+ "issues": "https://www.drupal.org/project/issues/panels",
+ "irc": "irc://irc.freenode.org/drupal-scotch"
+ }
+ },
{
"name": "drupal/paragraphs",
"version": "1.12.0",
@@ -2683,17 +3566,17 @@
},
{
"name": "drupal/schema_metatag",
- "version": "1.5.0",
+ "version": "1.6.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/schema_metatag.git",
- "reference": "8.x-1.5"
+ "reference": "8.x-1.6"
},
"dist": {
"type": "zip",
- "url": "https://ftp.drupal.org/files/projects/schema_metatag-8.x-1.5.zip",
- "reference": "8.x-1.5",
- "shasum": "06334fadc2c6b80312319cbce11b1c3621b2e918"
+ "url": "https://ftp.drupal.org/files/projects/schema_metatag-8.x-1.6.zip",
+ "reference": "8.x-1.6",
+ "shasum": "89816975afc0345b57c3b0550c88a8f371ba56c9"
},
"require": {
"drupal/core": "^8 || ^9",
@@ -2707,8 +3590,8 @@
"type": "drupal-module",
"extra": {
"drupal": {
- "version": "8.x-1.5",
- "datestamp": "1590323806",
+ "version": "8.x-1.6",
+ "datestamp": "1592573603",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
@@ -2735,6 +3618,58 @@
"issues": "https://www.drupal.org/project/issues/schema_metatag"
}
},
+ {
+ "name": "drupal/site_settings",
+ "version": "1.19.0",
+ "source": {
+ "type": "git",
+ "url": "https://git.drupalcode.org/project/site_settings.git",
+ "reference": "8.x-1.19"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://ftp.drupal.org/files/projects/site_settings-8.x-1.19.zip",
+ "reference": "8.x-1.19",
+ "shasum": "93977299549d33c4fbaad7a332fe7d3e1e2648b8"
+ },
+ "require": {
+ "drupal/core": "^8 || ^9"
+ },
+ "type": "drupal-module",
+ "extra": {
+ "drupal": {
+ "version": "8.x-1.19",
+ "datestamp": "1590234916",
+ "security-coverage": {
+ "status": "covered",
+ "message": "Covered by Drupal's security advisory policy"
+ }
+ }
+ },
+ "notification-url": "https://packages.drupal.org/8/downloads",
+ "license": [
+ "GPL-2.0+"
+ ],
+ "authors": [
+ {
+ "name": "scott_euser",
+ "homepage": "https://www.drupal.org/user/3267594"
+ },
+ {
+ "name": "stuart.wilkes@actionaid.org",
+ "homepage": "https://www.drupal.org/user/3584735"
+ }
+ ],
+ "description": "Provides a site settings entity",
+ "homepage": "https://www.drupal.org/project/site_settings",
+ "keywords": [
+ "Drupal"
+ ],
+ "support": {
+ "source": "http://cgit.drupalcode.org/site_settings",
+ "issues": "http://drupal.org/project/issues/site_settings"
+ }
+ },
{
"name": "drupal/subpathauto",
"version": "1.1.0",
@@ -2897,6 +3832,238 @@
"source": "https://git.drupalcode.org/project/token"
}
},
+ {
+ "name": "drupal/total_control",
+ "version": "2.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://git.drupalcode.org/project/total_control.git",
+ "reference": "8.x-2.0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://ftp.drupal.org/files/projects/total_control-8.x-2.0.zip",
+ "reference": "8.x-2.0",
+ "shasum": "67e4bcf348fbc4647402de7903b48fc6414beece"
+ },
+ "require": {
+ "drupal/core": "^8 || ^9",
+ "drupal/ctools": "~3.0",
+ "drupal/page_manager": "~4.0",
+ "drupal/panels": "~4.0"
+ },
+ "type": "drupal-module",
+ "extra": {
+ "drupal": {
+ "version": "8.x-2.0",
+ "datestamp": "1583399169",
+ "security-coverage": {
+ "status": "covered",
+ "message": "Covered by Drupal's security advisory policy"
+ }
+ },
+ "branch-alias": {
+ "dev-8.x-2.x": "8.2.x-dev"
+ }
+ },
+ "notification-url": "https://packages.drupal.org/8/downloads",
+ "license": [
+ "GPL-2.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Jen Lampton",
+ "homepage": "https://www.drupal.org/u/jenlampton",
+ "role": "Maintainer"
+ },
+ {
+ "name": "Mohammed J. Razem",
+ "homepage": "https://www.drupal.org/u/mohammed-j-razem",
+ "role": "Maintainer"
+ },
+ {
+ "name": "Abdulla Abu-Zakham",
+ "homepage": "https://www.drupal.org/u/abu-zakham",
+ "role": "Maintainer"
+ },
+ {
+ "name": "Rajab Natshah",
+ "homepage": "https://www.drupal.org/u/rajabnatshah",
+ "role": "Maintainer"
+ },
+ {
+ "name": "populist",
+ "homepage": "https://www.drupal.org/user/58600"
+ },
+ {
+ "name": "squiggy",
+ "homepage": "https://www.drupal.org/user/44299"
+ }
+ ],
+ "description": "Total Control Administration Dashboard",
+ "homepage": "https://www.drupal.org/project/total_control",
+ "support": {
+ "source": "https://git.drupalcode.org/project/total_control/tree/8.x-2.x",
+ "issues": "https://www.drupal.org/project/issues/total_control"
+ }
+ },
+ {
+ "name": "drupal/transliterate_filenames",
+ "version": "1.4.0",
+ "source": {
+ "type": "git",
+ "url": "https://git.drupalcode.org/project/transliterate_filenames.git",
+ "reference": "8.x-1.4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://ftp.drupal.org/files/projects/transliterate_filenames-8.x-1.4.zip",
+ "reference": "8.x-1.4",
+ "shasum": "de190ae6d1923f95c61e597a00ef50d64cfd982b"
+ },
+ "require": {
+ "drupal/core": "^8 || ^9"
+ },
+ "type": "drupal-module",
+ "extra": {
+ "drupal": {
+ "version": "8.x-1.4",
+ "datestamp": "1589218989",
+ "security-coverage": {
+ "status": "covered",
+ "message": "Covered by Drupal's security advisory policy"
+ }
+ }
+ },
+ "notification-url": "https://packages.drupal.org/8/downloads",
+ "license": [
+ "GPL-2.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Alexander Dubovskoy",
+ "homepage": "https://www.drupal.org/u/adubovskoy",
+ "role": "Maintainer"
+ },
+ {
+ "name": "Andrei Ivnitskii",
+ "homepage": "https://www.drupal.org/u/ivnish",
+ "role": "Maintainer"
+ },
+ {
+ "name": "ivnish",
+ "homepage": "https://www.drupal.org/user/3547706"
+ }
+ ],
+ "description": "Transliteration for all uploading files (includes fields and ckeditor inline upload)",
+ "homepage": "https://www.drupal.org/project/transliterate_filenames",
+ "support": {
+ "source": "https://git.drupalcode.org/project/transliterate_filenames",
+ "issues": "https://www.drupal.org/project/issues/transliterate_filenames"
+ }
+ },
+ {
+ "name": "drupal/varbase_total_control",
+ "version": "6.11.0",
+ "source": {
+ "type": "git",
+ "url": "https://git.drupalcode.org/project/varbase_total_control.git",
+ "reference": "8.x-6.11"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://ftp.drupal.org/files/projects/varbase_total_control-8.x-6.11.zip",
+ "reference": "8.x-6.11",
+ "shasum": "ce01ed87c8733433f3b129ae040d03e14bcdd3db"
+ },
+ "require": {
+ "composer/installers": "~1.0",
+ "cweagans/composer-patches": "~1.0",
+ "drupal/charts": "~3.0",
+ "drupal/core": "^8.8.0 || ~9.0.0",
+ "drupal/drupal-library-installer-plugin": "^0.3",
+ "drupal/google_analytics_reports": "~3.0",
+ "drupal/masonry": "~1.0",
+ "drupal/total_control": "~2.0",
+ "oomphinc/composer-installers-extender": "~1.0"
+ },
+ "suggest": {
+ "bower-asset/c3": "0.4.*: Provides JavaScript library necessary for C3",
+ "bower-asset/chartjs": "2.7.*: Provides JavaScript library necessary for Chart JS",
+ "bower-asset/d3": "3.5.*: Provides JavaScript library necessary for D3",
+ "npm-asset/imagesloaded": "~4.0: Provides JavaScript library necessary for Image Loaded",
+ "npm-asset/masonry-layout": "~4.0: Provides JavaScript library necessary for Masonry Layout"
+ },
+ "type": "drupal-module",
+ "extra": {
+ "drupal": {
+ "version": "8.x-6.11",
+ "datestamp": "1591080576",
+ "security-coverage": {
+ "status": "covered",
+ "message": "Covered by Drupal's security advisory policy"
+ }
+ },
+ "branch-alias": {
+ "dev-8.x-6.x": "8.6.x-dev"
+ },
+ "installer-types": [
+ "bower-asset",
+ "npm-asset"
+ ],
+ "drupal-libraries": {
+ "libraries": [
+ {
+ "name": "chartjs",
+ "package": "bower-asset/chartjs"
+ },
+ {
+ "name": "c3",
+ "package": "bower-asset/c3"
+ },
+ {
+ "name": "d3",
+ "package": "bower-asset/d3"
+ },
+ {
+ "name": "masonry",
+ "package": "npm-asset/masonry-layout"
+ },
+ {
+ "name": "imagesloaded",
+ "package": "npm-asset/imagesloaded"
+ }
+ ]
+ },
+ "enable-patching": true,
+ "composer-exit-on-patch-failure": true
+ },
+ "notification-url": "https://packages.drupal.org/8/downloads",
+ "license": [
+ "GPL-2.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Vardot",
+ "homepage": "https://www.drupal.org/vardot",
+ "role": "Maintainer"
+ },
+ {
+ "name": "RajabNatshah",
+ "homepage": "https://www.drupal.org/user/1414312"
+ },
+ {
+ "name": "abu-zakham",
+ "homepage": "https://www.drupal.org/user/2836067"
+ }
+ ],
+ "description": "Varbase Total Control Dashboard: A dashboard is what is missing for better Drupal administration experience. This dashboard is built on top of Total Control Admin Dashboard module, utilizing Panels, Google Analytics Reports, and several enhanced blocks and widgets for an intuitive and flexible administration experience.",
+ "homepage": "https://github.com/Vardot/varbase_total_control",
+ "support": {
+ "source": "http://cgit.drupalcode.org/varbase_total_control",
+ "issues": "https://www.drupal.org/project/issues/varbase_total_control"
+ }
+ },
{
"name": "drupal/video_embed_field",
"version": "2.4.0",
@@ -3003,16 +4170,16 @@
},
{
"name": "drush/drush",
- "version": "10.2.2",
+ "version": "10.3.1",
"source": {
"type": "git",
"url": "https://github.com/drush-ops/drush.git",
- "reference": "8307a4e7dae9c63a279d8b59b9dca6c1973576c2"
+ "reference": "aad2b17ad34801d9b55cff903e3e7db65d754b80"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/drush-ops/drush/zipball/8307a4e7dae9c63a279d8b59b9dca6c1973576c2",
- "reference": "8307a4e7dae9c63a279d8b59b9dca6c1973576c2",
+ "url": "https://api.github.com/repos/drush-ops/drush/zipball/aad2b17ad34801d9b55cff903e3e7db65d754b80",
+ "reference": "aad2b17ad34801d9b55cff903e3e7db65d754b80",
"shasum": ""
},
"require": {
@@ -3020,7 +4187,7 @@
"composer/semver": "^1.4",
"consolidation/config": "^1.2",
"consolidation/filter-via-dot-access-data": "^1",
- "consolidation/robo": "^1 || ^2",
+ "consolidation/robo": "^1.4.11 || ^2",
"consolidation/site-alias": "^3.0.0@stable",
"consolidation/site-process": "^2.1 || ^4",
"ext-dom": "*",
@@ -3039,6 +4206,7 @@
"require-dev": {
"composer/installers": "^1.7",
"cweagans/composer-patches": "~1.0",
+ "david-garcia/phpwhois": "4.3.0",
"drupal/alinks": "1.0.0",
"drupal/core-recommended": "^8.8",
"g1a/composer-test-scenarios": "^3",
@@ -3128,7 +4296,13 @@
],
"description": "Drush is a command line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.",
"homepage": "http://www.drush.org",
- "time": "2020-02-26T21:07:53+00:00"
+ "funding": [
+ {
+ "url": "https://github.com/weitzman",
+ "type": "github"
+ }
+ ],
+ "time": "2020-06-30T19:43:45+00:00"
},
{
"name": "easyrdf/easyrdf",
@@ -3965,16 +5139,16 @@
},
{
"name": "nikic/php-parser",
- "version": "v4.5.0",
+ "version": "v4.6.0",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
- "reference": "53c2753d756f5adb586dca79c2ec0e2654dd9463"
+ "reference": "c346bbfafe2ff60680258b631afb730d186ed864"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/53c2753d756f5adb586dca79c2ec0e2654dd9463",
- "reference": "53c2753d756f5adb586dca79c2ec0e2654dd9463",
+ "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/c346bbfafe2ff60680258b631afb730d186ed864",
+ "reference": "c346bbfafe2ff60680258b631afb730d186ed864",
"shasum": ""
},
"require": {
@@ -4013,7 +5187,49 @@
"parser",
"php"
],
- "time": "2020-06-03T07:24:19+00:00"
+ "time": "2020-07-02T17:12:47+00:00"
+ },
+ {
+ "name": "oomphinc/composer-installers-extender",
+ "version": "v1.1.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/oomphinc/composer-installers-extender.git",
+ "reference": "ca1c4b16b0905c81d1e77e608f36a2eff1a56f56"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/oomphinc/composer-installers-extender/zipball/ca1c4b16b0905c81d1e77e608f36a2eff1a56f56",
+ "reference": "ca1c4b16b0905c81d1e77e608f36a2eff1a56f56",
+ "shasum": ""
+ },
+ "require": {
+ "composer-plugin-api": "^1.0",
+ "composer/installers": "^1.0"
+ },
+ "type": "composer-plugin",
+ "extra": {
+ "class": "OomphInc\\ComposerInstallersExtender\\Plugin"
+ },
+ "autoload": {
+ "psr-4": {
+ "OomphInc\\ComposerInstallersExtender\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Stephen Beemsterboer",
+ "email": "stephen@oomphinc.com",
+ "homepage": "https://github.com/balbuf"
+ }
+ ],
+ "description": "Extend the composer/installers plugin to accept any arbitrary package type.",
+ "homepage": "http://www.oomphinc.com/",
+ "time": "2017-03-31T16:57:39+00:00"
},
{
"name": "paragonie/random_compat",
@@ -5028,7 +6244,7 @@
},
{
"name": "symfony/filesystem",
- "version": "v4.4.9",
+ "version": "v4.4.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
@@ -5092,7 +6308,7 @@
},
{
"name": "symfony/finder",
- "version": "v4.4.9",
+ "version": "v4.4.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
@@ -5833,16 +7049,16 @@
},
{
"name": "symfony/polyfill-php80",
- "version": "v1.17.0",
+ "version": "v1.17.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
- "reference": "5e30b2799bc1ad68f7feb62b60a73743589438dd"
+ "reference": "4a5b6bba3259902e386eb80dd1956181ee90b5b2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/5e30b2799bc1ad68f7feb62b60a73743589438dd",
- "reference": "5e30b2799bc1ad68f7feb62b60a73743589438dd",
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4a5b6bba3259902e386eb80dd1956181ee90b5b2",
+ "reference": "4a5b6bba3259902e386eb80dd1956181ee90b5b2",
"shasum": ""
},
"require": {
@@ -5852,6 +7068,10 @@
"extra": {
"branch-alias": {
"dev-master": "1.17-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
@@ -5905,7 +7125,7 @@
"type": "tidelift"
}
],
- "time": "2020-05-12T16:47:27+00:00"
+ "time": "2020-06-06T08:46:27+00:00"
},
{
"name": "symfony/polyfill-util",
@@ -6468,7 +7688,7 @@
},
{
"name": "symfony/var-dumper",
- "version": "v4.4.9",
+ "version": "v4.4.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
@@ -6843,23 +8063,24 @@
},
{
"name": "webmozart/assert",
- "version": "1.8.0",
+ "version": "1.9.1",
"source": {
"type": "git",
"url": "https://github.com/webmozart/assert.git",
- "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6"
+ "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/webmozart/assert/zipball/ab2cb0b3b559010b75981b1bdce728da3ee90ad6",
- "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6",
+ "url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389",
+ "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389",
"shasum": ""
},
"require": {
- "php": "^5.3.3 || ^7.0",
+ "php": "^5.3.3 || ^7.0 || ^8.0",
"symfony/polyfill-ctype": "^1.8"
},
"conflict": {
+ "phpstan/phpstan": "<0.12.20",
"vimeo/psalm": "<3.9.1"
},
"require-dev": {
@@ -6887,7 +8108,7 @@
"check",
"validate"
],
- "time": "2020-04-18T12:12:48+00:00"
+ "time": "2020-07-08T17:02:28+00:00"
},
{
"name": "webmozart/path-util",
diff --git a/web/core/CHANGELOG.txt b/web/core/CHANGELOG.txt
index 49587bc7..3b99f6bd 100644
--- a/web/core/CHANGELOG.txt
+++ b/web/core/CHANGELOG.txt
@@ -3,6 +3,6 @@ patch (bugfix) releases are released every month. More information on the
Drupal release cycle: https://www.drupal.org/core/release-cycle-overview
* For a full list of fixes in the latest release, visit:
- https://www.drupal.org/8/download
+ https://www.drupal.org/latest-release
* API change records for Drupal core:
https://www.drupal.org/list-changes/drupal
diff --git a/web/core/INSTALL.sqlite.txt b/web/core/INSTALL.sqlite.txt
index e22aaa89..96092c37 100644
--- a/web/core/INSTALL.sqlite.txt
+++ b/web/core/INSTALL.sqlite.txt
@@ -20,13 +20,13 @@ SQLITE DATABASE CREATION
The Drupal installer will create the SQLite database for you. The only
requirement is that the installer must have write permissions to the directory
where the database file resides. This directory (not just the database file) also
-has to remain writeable by the web server going forward for SQLite to continue to
+has to remain writable by the web server going forward for SQLite to continue to
be able to operate.
On the "Database configuration" form in the "Database file" field, you must
supply the exact path to where you wish your database file to reside. It is
strongly suggested that you choose a path that is outside of the webroot, yet
-ensure that the directory is writeable by the web server.
+ensure that the directory is writable by the web server.
If you must place your database file in your webroot, you could try using the
following in your "Database file" field:
diff --git a/web/core/INSTALL.txt b/web/core/INSTALL.txt
index 5dbc9e02..fcfa09d1 100644
--- a/web/core/INSTALL.txt
+++ b/web/core/INSTALL.txt
@@ -190,7 +190,7 @@ INSTALLATION
chmod a+w sites/default/files
Be sure to set the permissions for the default directory back after the
- installation is finished! (Leave the files directory writeable.)
+ installation is finished! (Leave the files directory writable.)
Sample command:
chmod go-w sites/default
diff --git a/web/core/includes/bootstrap.inc b/web/core/includes/bootstrap.inc
index d2a0313a..0f8e7f10 100644
--- a/web/core/includes/bootstrap.inc
+++ b/web/core/includes/bootstrap.inc
@@ -681,11 +681,17 @@ function drupal_valid_test_ua($new_prefix = NULL) {
// Ensure that no information leaks on production sites.
$test_db = new TestDatabase($prefix);
$key_file = DRUPAL_ROOT . '/' . $test_db->getTestSitePath() . '/.htkey';
- if (!is_readable($key_file)) {
+ if (!is_readable($key_file) || is_dir($key_file)) {
header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden');
exit;
}
$private_key = file_get_contents($key_file);
+ // The string from drupal_generate_test_ua() is 74 bytes long. If we don't
+ // have it, tests cannot be allowed.
+ if (empty($private_key) || strlen($private_key) < 74) {
+ header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden');
+ exit;
+ }
// The file properties add more entropy not easily accessible to others.
$key = $private_key . filectime(__FILE__) . fileinode(__FILE__);
$time_diff = REQUEST_TIME - $time;
diff --git a/web/core/includes/file.inc b/web/core/includes/file.inc
index 859ed8d0..c9eec6c9 100644
--- a/web/core/includes/file.inc
+++ b/web/core/includes/file.inc
@@ -683,7 +683,7 @@ function file_munge_filename($filename, $extensions, $alerts = TRUE) {
// http://php.net/manual/security.filesystem.nullbytes.php
$filename = str_replace(chr(0), '', $filename);
- $whitelist = array_unique(explode(' ', strtolower(trim($extensions))));
+ $allowed_extensions = array_unique(explode(' ', strtolower(trim($extensions))));
// Split the filename up by periods. The first part becomes the basename
// the last part the final extension.
@@ -698,7 +698,7 @@ function file_munge_filename($filename, $extensions, $alerts = TRUE) {
// of allowed extensions.
foreach ($filename_parts as $filename_part) {
$new_filename .= '.' . $filename_part;
- if (!in_array(strtolower($filename_part), $whitelist) && preg_match("/^[a-zA-Z]{2,5}\d?$/", $filename_part)) {
+ if (!in_array(strtolower($filename_part), $allowed_extensions) && preg_match("/^[a-zA-Z]{2,5}\d?$/", $filename_part)) {
$new_filename .= '_';
}
}
diff --git a/web/core/includes/install.core.inc b/web/core/includes/install.core.inc
index b4ec5680..85981876 100644
--- a/web/core/includes/install.core.inc
+++ b/web/core/includes/install.core.inc
@@ -1023,7 +1023,7 @@ function install_display_output($output, $install_state) {
// Prevent install.php from being indexed when installed in a sub folder.
// robots.txt rules are not read if the site is within domain.com/subfolder
// resulting in /subfolder/install.php being found through search engines.
- // When settings.php is writeable this can be used via an external database
+ // When settings.php is writable this can be used via an external database
// leading a malicious user to gain php access to the server.
$noindex_meta_tag = [
'#tag' => 'meta',
diff --git a/web/core/includes/install.inc b/web/core/includes/install.inc
index ce0f94fc..987186f5 100644
--- a/web/core/includes/install.inc
+++ b/web/core/includes/install.inc
@@ -478,6 +478,7 @@ function _drupal_rewrite_settings_global(&$ref, $variable) {
* The container for variable values.
* @param string $variable_name
* Name of variable.
+ *
* @return string
* A string containing valid PHP code of the variable suitable for placing
* into settings.php.
@@ -508,6 +509,7 @@ function _drupal_rewrite_settings_dump($variable, $variable_name) {
* A string to prepend to the variable's value.
* @param string $suffix
* A string to append to the variable's value.
+ *
* @return string
* A string containing valid PHP code of the variable suitable for placing
* into settings.php.
diff --git a/web/core/lib/Drupal.php b/web/core/lib/Drupal.php
index 7cc2d0c4..b51f2401 100644
--- a/web/core/lib/Drupal.php
+++ b/web/core/lib/Drupal.php
@@ -82,7 +82,7 @@ class Drupal {
/**
* The current system version.
*/
- const VERSION = '8.9.0';
+ const VERSION = '8.9.2';
/**
* Core API compatibility.
diff --git a/web/core/lib/Drupal/Component/Annotation/Plugin.php b/web/core/lib/Drupal/Component/Annotation/Plugin.php
index 790440d1..504ff401 100644
--- a/web/core/lib/Drupal/Component/Annotation/Plugin.php
+++ b/web/core/lib/Drupal/Component/Annotation/Plugin.php
@@ -39,7 +39,7 @@ class Plugin implements AnnotationInterface {
return $value !== NULL;
});
$parsed_values = $this->parse($values);
- $this->definition = NestedArray::mergeDeep($defaults, $parsed_values);
+ $this->definition = NestedArray::mergeDeepArray([$defaults, $parsed_values], TRUE);
}
/**
diff --git a/web/core/lib/Drupal/Component/FileSecurity/FileSecurity.php b/web/core/lib/Drupal/Component/FileSecurity/FileSecurity.php
index d9996bbb..1b90afd8 100644
--- a/web/core/lib/Drupal/Component/FileSecurity/FileSecurity.php
+++ b/web/core/lib/Drupal/Component/FileSecurity/FileSecurity.php
@@ -26,7 +26,7 @@ class FileSecurity {
* TRUE if the file already exists or was created. FALSE otherwise.
*/
public static function writeHtaccess($directory, $deny_public_access = TRUE, $force = FALSE) {
- return self::writeFile($directory, '/.htaccess', self::htaccessLines($deny_public_access), $force);
+ return self::writeFile($directory, '.htaccess', self::htaccessLines($deny_public_access), $force);
}
/**
@@ -110,7 +110,7 @@ EOF;
* TRUE if the file already exists or was created. FALSE otherwise.
*/
public static function writeWebConfig($directory, $force = FALSE) {
- return self::writeFile($directory, '/web.config', self::webConfigLines(), $force);
+ return self::writeFile($directory, 'web.config', self::webConfigLines(), $force);
}
/**
@@ -152,7 +152,12 @@ EOT;
if (file_exists($file_path) && !$force) {
return TRUE;
}
- if (file_exists($directory) && is_writable($directory) && file_put_contents($file_path, $contents)) {
+ // Writing the file can fail if:
+ // - concurrent requests are both trying to write at the same time.
+ // - $directory does not exist or is not writable.
+ // Testing for these conditions introduces windows for concurrency issues to
+ // occur.
+ if (@file_put_contents($file_path, $contents)) {
return @chmod($file_path, 0444);
}
return FALSE;
diff --git a/web/core/lib/Drupal/Component/PhpStorage/MTimeProtectedFastFileStorage.php b/web/core/lib/Drupal/Component/PhpStorage/MTimeProtectedFastFileStorage.php
index c7e6febe..ff194941 100644
--- a/web/core/lib/Drupal/Component/PhpStorage/MTimeProtectedFastFileStorage.php
+++ b/web/core/lib/Drupal/Component/PhpStorage/MTimeProtectedFastFileStorage.php
@@ -222,6 +222,7 @@ class MTimeProtectedFastFileStorage extends FileStorage {
* The directory where the temporary filename will be created.
* @param $prefix
* The prefix of the generated temporary filename.
+ *
* @return string
* Returns the new temporary filename (with path), or FALSE on failure.
*/
diff --git a/web/core/lib/Drupal/Component/PhpStorage/PhpStorageInterface.php b/web/core/lib/Drupal/Component/PhpStorage/PhpStorageInterface.php
index fb9194c9..7a370d25 100644
--- a/web/core/lib/Drupal/Component/PhpStorage/PhpStorageInterface.php
+++ b/web/core/lib/Drupal/Component/PhpStorage/PhpStorageInterface.php
@@ -52,7 +52,7 @@ interface PhpStorageInterface {
public function save($name, $code);
/**
- * Whether this is a writeable storage.
+ * Whether this is a writable storage.
*
* @return bool
*/
diff --git a/web/core/lib/Drupal/Component/Plugin/Derivative/DeriverInterface.php b/web/core/lib/Drupal/Component/Plugin/Derivative/DeriverInterface.php
index 1932983e..32b59ef7 100644
--- a/web/core/lib/Drupal/Component/Plugin/Derivative/DeriverInterface.php
+++ b/web/core/lib/Drupal/Component/Plugin/Derivative/DeriverInterface.php
@@ -32,6 +32,7 @@ interface DeriverInterface {
*
* @param array $base_plugin_definition
* The definition array of the base plugin.
+ *
* @return array
* An array of full derivative definitions keyed on derivative id.
*
diff --git a/web/core/lib/Drupal/Component/Utility/Random.php b/web/core/lib/Drupal/Component/Utility/Random.php
index 57287f9d..6c2f9056 100644
--- a/web/core/lib/Drupal/Component/Utility/Random.php
+++ b/web/core/lib/Drupal/Component/Utility/Random.php
@@ -249,6 +249,7 @@ class Random {
* Generate paragraphs separated by double new line.
*
* @param int $paragraph_count
+ *
* @return string
*/
public function paragraphs($paragraph_count = 12) {
diff --git a/web/core/lib/Drupal/Component/Utility/Xss.php b/web/core/lib/Drupal/Component/Utility/Xss.php
index f5e99fe8..4bb8bbd1 100644
--- a/web/core/lib/Drupal/Component/Utility/Xss.php
+++ b/web/core/lib/Drupal/Component/Utility/Xss.php
@@ -70,7 +70,7 @@ class Xss {
// Defuse all HTML entities.
$string = str_replace('&', '&', $string);
- // Change back only well-formed entities in our whitelist:
+ // Change back only well-formed entities in our list of allowed html tags:
// Decimal numeric entities.
$string = preg_replace('/&#([0-9]+;)/', '\1', $string);
// Hexadecimal numeric entities.
@@ -83,7 +83,7 @@ class Xss {
$splitter = function ($matches) use ($html_tags, $class) {
return $class::split($matches[1], $html_tags, $class);
};
- // Strip any tags that are not in the whitelist.
+ // Strip any tags that are not in the list of allowed html tags.
return preg_replace_callback('%
(
<(?=[^a-zA-Z!/]) # a lone <
@@ -161,7 +161,9 @@ class Xss {
$elem = '!--';
}
- // When in whitelist mode, an element is disallowed when not listed.
+ // Defer to the ::needsRemoval() method to decide if the element is to be
+ // removed. This allows the list of tags to be treated as either a list of
+ // allowed tags or a list of denied tags.
if ($class::needsRemoval($html_tags, $elem)) {
return '';
}
diff --git a/web/core/lib/Drupal/Core/Asset/AssetResolver.php b/web/core/lib/Drupal/Core/Asset/AssetResolver.php
index c0b0f26f..c52ee7ff 100644
--- a/web/core/lib/Drupal/Core/Asset/AssetResolver.php
+++ b/web/core/lib/Drupal/Core/Asset/AssetResolver.php
@@ -188,6 +188,7 @@ class AssetResolver implements AssetResolverInterface {
*
* @param \Drupal\Core\Asset\AttachedAssetsInterface $assets
* The assets attached to the current response.
+ *
* @return array
* A (possibly optimized) collection of JavaScript assets.
*/
diff --git a/web/core/lib/Drupal/Core/Batch/BatchBuilder.php b/web/core/lib/Drupal/Core/Batch/BatchBuilder.php
index dce66987..91550e71 100644
--- a/web/core/lib/Drupal/Core/Batch/BatchBuilder.php
+++ b/web/core/lib/Drupal/Core/Batch/BatchBuilder.php
@@ -205,12 +205,18 @@ class BatchBuilder {
* The path should be relative to base_path(), and thus should be built using
* drupal_get_path(). Defaults to {module_name}.module.
*
+ * The file needs to be set before using ::addOperation(),
+ * ::setFinishCallback(), or any other function that uses callbacks from the
+ * file. This is so that PHP knows about the included functions.
+ *
* @param string $filename
* The path to the file.
*
* @return $this
*/
public function setFile($filename) {
+ include_once $filename;
+
$this->file = $filename;
return $this;
}
diff --git a/web/core/lib/Drupal/Core/Command/DbCommandBase.php b/web/core/lib/Drupal/Core/Command/DbCommandBase.php
index ec3b1889..d5a80e08 100644
--- a/web/core/lib/Drupal/Core/Command/DbCommandBase.php
+++ b/web/core/lib/Drupal/Core/Command/DbCommandBase.php
@@ -26,6 +26,7 @@ class DbCommandBase extends Command {
*
* @param \Symfony\Component\Console\Input\InputInterface $input
* Input object.
+ *
* @return \Drupal\Core\Database\Connection
*/
protected function getDatabaseConnection(InputInterface $input) {
diff --git a/web/core/lib/Drupal/Core/Command/DbDumpCommand.php b/web/core/lib/Drupal/Core/Command/DbDumpCommand.php
index bd6ca624..d112da5e 100644
--- a/web/core/lib/Drupal/Core/Command/DbDumpCommand.php
+++ b/web/core/lib/Drupal/Core/Command/DbDumpCommand.php
@@ -70,6 +70,7 @@ class DbDumpCommand extends DbCommandBase {
* The database connection to use.
* @param array $schema_only
* Table patterns for which to only dump the schema, no data.
+ *
* @return string
* The PHP script.
*/
@@ -105,6 +106,7 @@ class DbDumpCommand extends DbCommandBase {
*
* @param \Drupal\Core\Database\Connection $connection
* The database connection to use.
+ *
* @return array
* An array of table names.
*/
diff --git a/web/core/lib/Drupal/Core/Config/TypedConfigManager.php b/web/core/lib/Drupal/Core/Config/TypedConfigManager.php
index c6ddfb5e..8585f839 100644
--- a/web/core/lib/Drupal/Core/Config/TypedConfigManager.php
+++ b/web/core/lib/Drupal/Core/Config/TypedConfigManager.php
@@ -269,6 +269,7 @@ class TypedConfigManager extends TypedDataManager implements TypedConfigManagerI
* Configuration name with variables in square brackets.
* @param mixed $data
* Configuration data for the element.
+ *
* @return string
* Configuration name with variables replaced.
*/
diff --git a/web/core/lib/Drupal/Core/Database/Connection.php b/web/core/lib/Drupal/Core/Database/Connection.php
index dc96435f..00e6d6c9 100644
--- a/web/core/lib/Drupal/Core/Database/Connection.php
+++ b/web/core/lib/Drupal/Core/Database/Connection.php
@@ -778,6 +778,7 @@ abstract class Connection {
*
* @param string $class
* The class for which we want the potentially driver-specific class.
+ *
* @return string
* The name of the class that should be used for this driver.
*/
diff --git a/web/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php b/web/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php
index ed0f9c8f..5ef4d70e 100644
--- a/web/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php
+++ b/web/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php
@@ -87,6 +87,7 @@ class Schema extends DatabaseSchema {
* The name of the table to create.
* @param $table
* A Schema API table definition array.
+ *
* @return
* An array of SQL statements to create the table.
*/
diff --git a/web/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php b/web/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php
index 025b2503..14286c76 100644
--- a/web/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php
+++ b/web/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php
@@ -281,6 +281,7 @@ class Connection extends DatabaseConnection {
*
* @param $string
* The string to escape.
+ *
* @return string
* The escaped string.
*/
diff --git a/web/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php b/web/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php
index cf1a3108..14d8afe2 100644
--- a/web/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php
+++ b/web/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php
@@ -99,6 +99,7 @@ class Schema extends DatabaseSchema {
*
* @param $table_name
* The non-prefixed name of the table.
+ *
* @return
* An object with two member variables:
* - 'blob_fields' that lists all the blob fields in the table.
@@ -264,6 +265,7 @@ EOD;
* The name of the table to create.
* @param $table
* A Schema API table definition array.
+ *
* @return
* An array of SQL statements to create the table.
*/
@@ -1074,6 +1076,7 @@ EOD;
*
* @param $data
* String to be hashed.
+ *
* @return string
* A base-64 encoded sha-256 hash, with + and / replaced with _ and any =
* padding characters removed.
diff --git a/web/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php b/web/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php
index 41106995..ea3be4a9 100644
--- a/web/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php
+++ b/web/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php
@@ -48,6 +48,7 @@ class Schema extends DatabaseSchema {
* The name of the table to create.
* @param $table
* A Schema API table definition array.
+ *
* @return
* An array of SQL statements to create the table.
*/
diff --git a/web/core/lib/Drupal/Core/Database/Log.php b/web/core/lib/Drupal/Core/Database/Log.php
index 74e08e7c..6cf8d207 100644
--- a/web/core/lib/Drupal/Core/Database/Log.php
+++ b/web/core/lib/Drupal/Core/Database/Log.php
@@ -69,6 +69,7 @@ class Log {
*
* @param $logging_key
* The logging key to fetch.
+ *
* @return
* An indexed array of all query records for this logging key.
*/
diff --git a/web/core/lib/Drupal/Core/Database/Query/SelectInterface.php b/web/core/lib/Drupal/Core/Database/Query/SelectInterface.php
index 71087723..b2f24566 100644
--- a/web/core/lib/Drupal/Core/Database/Query/SelectInterface.php
+++ b/web/core/lib/Drupal/Core/Database/Query/SelectInterface.php
@@ -169,6 +169,7 @@ interface SelectInterface extends ConditionInterface, AlterableInterface, Extend
*
* @param $distinct
* TRUE to flag this query DISTINCT, FALSE to disable it.
+ *
* @return $this
* The called object.
*/
@@ -188,6 +189,7 @@ interface SelectInterface extends ConditionInterface, AlterableInterface, Extend
* automatically based on the $table_alias and $field. The alias will be
* checked for uniqueness, so the requested alias may not be the alias
* that is assigned in all cases.
+ *
* @return
* The unique alias that was assigned for this field.
*/
@@ -211,6 +213,7 @@ interface SelectInterface extends ConditionInterface, AlterableInterface, Extend
* An indexed array of fields present in the specified table that should be
* included in this query. If not specified, $table_alias.* will be generated
* without any aliases.
+ *
* @return $this
* The called object.
*/
@@ -232,6 +235,7 @@ interface SelectInterface extends ConditionInterface, AlterableInterface, Extend
* in all cases.
* @param $arguments
* Any placeholder arguments needed for this expression.
+ *
* @return
* The unique alias that was assigned for this expression.
*/
@@ -260,6 +264,7 @@ interface SelectInterface extends ConditionInterface, AlterableInterface, Extend
* system, for example, when joining the same table more than once.
* @param $arguments
* An array of arguments to replace into the $condition of this join.
+ *
* @return
* The unique alias that was assigned for this table.
*/
@@ -286,6 +291,7 @@ interface SelectInterface extends ConditionInterface, AlterableInterface, Extend
* system, for example, when joining the same table more than once.
* @param $arguments
* An array of arguments to replace into the $condition of this join.
+ *
* @return
* The unique alias that was assigned for this table.
*/
@@ -312,6 +318,7 @@ interface SelectInterface extends ConditionInterface, AlterableInterface, Extend
* system, for example, when joining the same table more than once.
* @param $arguments
* An array of arguments to replace into the $condition of this join.
+ *
* @return
* The unique alias that was assigned for this table.
*/
@@ -338,6 +345,7 @@ interface SelectInterface extends ConditionInterface, AlterableInterface, Extend
* system, for example, when joining the same table more than once.
* @param $arguments
* An array of arguments to replace into the $condition of this join.
+ *
* @return
* The unique alias that was assigned for this table.
*
@@ -379,6 +387,7 @@ interface SelectInterface extends ConditionInterface, AlterableInterface, Extend
* system, for example, when joining the same table more than once.
* @param $arguments
* An array of arguments to replace into the $condition of this join.
+ *
* @return
* The unique alias that was assigned for this table.
*/
@@ -411,6 +420,7 @@ interface SelectInterface extends ConditionInterface, AlterableInterface, Extend
* @param $direction
* The direction to sort. Legal values are "ASC" and "DESC". Any other value
* will be converted to "ASC".
+ *
* @return $this
* The called object.
*/
@@ -449,6 +459,7 @@ interface SelectInterface extends ConditionInterface, AlterableInterface, Extend
* range directives that are set.
* @param $length
* The number of records to return from the result set.
+ *
* @return $this
* The called object.
*/
@@ -474,6 +485,7 @@ interface SelectInterface extends ConditionInterface, AlterableInterface, Extend
* @param $type
* The type of UNION to add to the query. Defaults to plain
* UNION.
+ *
* @return $this
* The called object.
*/
@@ -484,6 +496,7 @@ interface SelectInterface extends ConditionInterface, AlterableInterface, Extend
*
* @param $field
* The field on which to group. This should be the field as aliased.
+ *
* @return $this
* The called object.
*/
@@ -539,6 +552,7 @@ interface SelectInterface extends ConditionInterface, AlterableInterface, Extend
* The comparison operator, such as =, <, or >=. It also accepts more complex
* options such as IN, LIKE, or BETWEEN. Defaults to IN if $value is an array
* = otherwise.
+ *
* @return \Drupal\Core\Database\Query\ConditionInterface
* The called object.
*/
diff --git a/web/core/lib/Drupal/Core/Database/StatementPrefetch.php b/web/core/lib/Drupal/Core/Database/StatementPrefetch.php
index 90beeae1..da0fea5b 100644
--- a/web/core/lib/Drupal/Core/Database/StatementPrefetch.php
+++ b/web/core/lib/Drupal/Core/Database/StatementPrefetch.php
@@ -216,6 +216,7 @@ class StatementPrefetch implements \Iterator, StatementInterface {
* The query.
* @param array|null $args
* An array of arguments. This can be NULL.
+ *
* @return \PDOStatement
* A PDOStatement object.
*/
diff --git a/web/core/lib/Drupal/Core/Entity/EntityDisplayBase.php b/web/core/lib/Drupal/Core/Entity/EntityDisplayBase.php
index 3df078a0..48663594 100644
--- a/web/core/lib/Drupal/Core/Entity/EntityDisplayBase.php
+++ b/web/core/lib/Drupal/Core/Entity/EntityDisplayBase.php
@@ -452,6 +452,7 @@ abstract class EntityDisplayBase extends ConfigEntityBase implements EntityDispl
*
* @param \Drupal\Core\Field\FieldDefinitionInterface $definition
* A field definition.
+ *
* @return array|null
*/
private function fieldHasDisplayOptions(FieldDefinitionInterface $definition) {
diff --git a/web/core/lib/Drupal/Core/Entity/Query/ConditionAggregateInterface.php b/web/core/lib/Drupal/Core/Entity/Query/ConditionAggregateInterface.php
index c7480ed9..1926cf63 100644
--- a/web/core/lib/Drupal/Core/Entity/Query/ConditionAggregateInterface.php
+++ b/web/core/lib/Drupal/Core/Entity/Query/ConditionAggregateInterface.php
@@ -35,6 +35,7 @@ interface ConditionAggregateInterface extends \Countable {
*
* @param $field
* @param string $langcode
+ *
* @return ConditionInterface
* @see \Drupal\Core\Entity\Query\QueryInterface::exists()
*/
@@ -44,6 +45,7 @@ interface ConditionAggregateInterface extends \Countable {
* Queries for the nonexistence of a field.
*
* @param string $field
+ *
* @return ConditionInterface
* @see \Drupal\Core\Entity\Query\QueryInterface::notExists()
*/
diff --git a/web/core/lib/Drupal/Core/Entity/Query/QueryInterface.php b/web/core/lib/Drupal/Core/Entity/Query/QueryInterface.php
index 1d5ed5db..48052e47 100644
--- a/web/core/lib/Drupal/Core/Entity/Query/QueryInterface.php
+++ b/web/core/lib/Drupal/Core/Entity/Query/QueryInterface.php
@@ -107,6 +107,7 @@ interface QueryInterface extends AlterableInterface {
* Name of a field.
* @param $langcode
* Language code (optional).
+ *
* @return $this
*/
public function exists($field, $langcode = NULL);
@@ -118,6 +119,7 @@ interface QueryInterface extends AlterableInterface {
* Name of a field.
* @param $langcode
* Language code (optional).
+ *
* @return $this
*/
public function notExists($field, $langcode = NULL);
diff --git a/web/core/lib/Drupal/Core/Entity/Query/Sql/QueryAggregate.php b/web/core/lib/Drupal/Core/Entity/Query/Sql/QueryAggregate.php
index 3e263d83..0f7ae5b2 100644
--- a/web/core/lib/Drupal/Core/Entity/Query/Sql/QueryAggregate.php
+++ b/web/core/lib/Drupal/Core/Entity/Query/Sql/QueryAggregate.php
@@ -144,6 +144,7 @@ class QueryAggregate extends Query implements QueryAggregateInterface {
* The field as passed in by the caller.
* @param string $sql_field
* The sql field as returned by getSqlField.
+ *
* @return string
* The SQL alias expected in the return value. The dots in $sql_field are
* replaced with underscores and if a default fallback to .value happened,
diff --git a/web/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php b/web/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php
index dd23ab65..ac6a3795 100644
--- a/web/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php
+++ b/web/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php
@@ -373,7 +373,9 @@ class Tables implements TablesInterface {
*
* @param $field_name
* Name of the field.
+ *
* @return string
+ *
* @throws \Drupal\Core\Entity\Query\QueryException
*/
protected function ensureFieldTable($index_prefix, &$field, $type, $langcode, $base_table, $entity_id_field, $field_id_field, $delta) {
diff --git a/web/core/lib/Drupal/Core/Extension/ModuleInstaller.php b/web/core/lib/Drupal/Core/Extension/ModuleInstaller.php
index 09f84343..3540a42e 100644
--- a/web/core/lib/Drupal/Core/Extension/ModuleInstaller.php
+++ b/web/core/lib/Drupal/Core/Extension/ModuleInstaller.php
@@ -193,14 +193,9 @@ class ModuleInstaller implements ModuleInstallerInterface {
}
}
- // Update the module handler in order to load the module's code.
- // This allows the module to participate in hooks and its existence to
- // be discovered by other modules.
- // The current ModuleHandler instance is obsolete with the kernel
- // rebuild below.
+ // Update the module handler in order to have the correct module list
+ // for the kernel update.
$this->moduleHandler->setModuleList($module_filenames);
- $this->moduleHandler->load($module);
- module_load_install($module);
// Clear the static cache of the "extension.list.module" service to pick
// up the new module, since it merges the installation status of modules
@@ -210,6 +205,10 @@ class ModuleInstaller implements ModuleInstallerInterface {
// Update the kernel to include it.
$this->updateKernel($module_filenames);
+ // Load the module's .module and .install files.
+ $this->moduleHandler->load($module);
+ module_load_install($module);
+
// Replace the route provider service with a version that will rebuild
// if routes used during installation. This ensures that a module's
// routes are available during installation. This has to occur before
diff --git a/web/core/lib/Drupal/Core/Field/FieldConfigBase.php b/web/core/lib/Drupal/Core/Field/FieldConfigBase.php
index 8f041ad0..922eba4f 100644
--- a/web/core/lib/Drupal/Core/Field/FieldConfigBase.php
+++ b/web/core/lib/Drupal/Core/Field/FieldConfigBase.php
@@ -125,9 +125,10 @@ abstract class FieldConfigBase extends ConfigEntityBase implements FieldConfigIn
*
* The default value is expressed as a numerically indexed array of items,
* each item being an array of key/value pairs matching the set of 'columns'
- * defined by the "field schema" for the field type, as exposed in
- * hook_field_schema(). If the number of items exceeds the cardinality of the
- * field, extraneous items will be ignored.
+ * defined by the "field schema" for the field type, as exposed in the class
+ * implementing \Drupal\Core\Field\FieldItemInterface::schema() method. If the
+ * number of items exceeds the cardinality of the field, extraneous items will
+ * be ignored.
*
* This property is overlooked if the $default_value_callback is non-empty.
*
diff --git a/web/core/lib/Drupal/Core/File/file.api.php b/web/core/lib/Drupal/Core/File/file.api.php
index 9109778e..6c5236fe 100644
--- a/web/core/lib/Drupal/Core/File/file.api.php
+++ b/web/core/lib/Drupal/Core/File/file.api.php
@@ -22,6 +22,7 @@ use Drupal\Core\StreamWrapper\StreamWrapperManager;
*
* @param $uri
* The URI of the file.
+ *
* @return
* If the user does not have permission to access the file, return -1. If the
* user has permission, return an array with the appropriate headers. If the
diff --git a/web/core/lib/Drupal/Core/Form/FormBuilder.php b/web/core/lib/Drupal/Core/Form/FormBuilder.php
index ae2851ed..5e8e22a6 100644
--- a/web/core/lib/Drupal/Core/Form/FormBuilder.php
+++ b/web/core/lib/Drupal/Core/Form/FormBuilder.php
@@ -19,6 +19,7 @@ use Drupal\Core\Security\TrustedCallbackInterface;
use Drupal\Core\Theme\ThemeManagerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\FileBag;
+use Symfony\Component\HttpFoundation\ParameterBag;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Response;
@@ -957,8 +958,16 @@ class FormBuilder implements FormBuilderInterface, FormValidatorInterface, FormS
// This value is checked in self::handleInputElement().
$form_state->setInvalidToken(TRUE);
+ // Ignore all submitted values.
+ $form_state->setUserInput([]);
+
+ $request = $this->requestStack->getCurrentRequest();
+ // Do not trust any POST data.
+ $request->request = new ParameterBag();
// Make sure file uploads do not get processed.
- $this->requestStack->getCurrentRequest()->files = new FileBag();
+ $request->files = new FileBag();
+ // Ensure PHP globals reflect these changes.
+ $request->overrideGlobals();
}
}
}
diff --git a/web/core/lib/Drupal/Core/Form/FormValidator.php b/web/core/lib/Drupal/Core/Form/FormValidator.php
index 57d24cc2..2afcb52b 100644
--- a/web/core/lib/Drupal/Core/Form/FormValidator.php
+++ b/web/core/lib/Drupal/Core/Form/FormValidator.php
@@ -124,10 +124,8 @@ class FormValidator implements FormValidatorInterface {
* {@inheritdoc}
*/
public function setInvalidTokenError(FormStateInterface $form_state) {
- $url = $this->requestStack->getCurrentRequest()->getRequestUri();
-
// Setting this error will cause the form to fail validation.
- $form_state->setErrorByName('form_token', $this->t('The form has become outdated. Copy any unsaved work in the form below and then reload this page.', [':link' => $url]));
+ $form_state->setErrorByName('form_token', $this->t('The form has become outdated. Press the back button, copy any unsaved work in the form, and then reload the page.'));
}
/**
diff --git a/web/core/lib/Drupal/Core/Menu/MenuTreeStorage.php b/web/core/lib/Drupal/Core/Menu/MenuTreeStorage.php
index d53ad5ba..642542b5 100644
--- a/web/core/lib/Drupal/Core/Menu/MenuTreeStorage.php
+++ b/web/core/lib/Drupal/Core/Menu/MenuTreeStorage.php
@@ -1459,6 +1459,7 @@ class MenuTreeStorage implements MenuTreeStorageInterface {
*
* @param array $definitions
* The new menu link definitions.
+ *
* @return array
* A list of menu link IDs that no longer exist.
*/
diff --git a/web/core/lib/Drupal/Core/Menu/menu.api.php b/web/core/lib/Drupal/Core/Menu/menu.api.php
index 758013f4..dfe00097 100644
--- a/web/core/lib/Drupal/Core/Menu/menu.api.php
+++ b/web/core/lib/Drupal/Core/Menu/menu.api.php
@@ -329,7 +329,7 @@ function hook_menu_local_tasks_alter(&$data, $route_name, \Drupal\Core\Cache\Ref
],
];
// The tab we're adding is dependent on a user's access to add content.
- $cacheability->addCacheTags(['user.permissions']);
+ $cacheability->addCacheContexts(['user.permissions']);
}
/**
diff --git a/web/core/lib/Drupal/Core/Render/theme.api.php b/web/core/lib/Drupal/Core/Render/theme.api.php
index ecb76b7d..605c91b1 100644
--- a/web/core/lib/Drupal/Core/Render/theme.api.php
+++ b/web/core/lib/Drupal/Core/Render/theme.api.php
@@ -274,9 +274,9 @@
* vectors while allowing a permissive list of HTML tags that are not XSS
* vectors. (For example, ', 'The block title was properly sanitized when rendered.');
- $this->drupalLogin($this->drupalCreateUser(['administer blocks', 'access administration pages']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer blocks',
+ 'access administration pages',
+ ]));
$default_theme = $this->config('system.theme')->get('default');
$this->drupalGet('admin/structure/block/list/' . $default_theme);
$this->assertNoRaw("", 'The block title was properly sanitized in Block Plugin UI Admin page.');
@@ -61,7 +67,10 @@ class BlockXssTest extends BrowserTestBase {
public function testXssInCategory() {
$this->container->get('module_installer')->install(['block_test']);
$this->drupalPlaceBlock('test_xss_title');
- $this->drupalLogin($this->drupalCreateUser(['administer blocks', 'access administration pages']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer blocks',
+ 'access administration pages',
+ ]));
$this->drupalGet(Url::fromRoute('block.admin_display'));
$this->clickLink('Place block');
$this->assertNoRaw("");
diff --git a/web/core/modules/block/tests/src/Functional/NonDefaultBlockAdminTest.php b/web/core/modules/block/tests/src/Functional/NonDefaultBlockAdminTest.php
index 5564a502..9552809f 100644
--- a/web/core/modules/block/tests/src/Functional/NonDefaultBlockAdminTest.php
+++ b/web/core/modules/block/tests/src/Functional/NonDefaultBlockAdminTest.php
@@ -36,7 +36,10 @@ class NonDefaultBlockAdminTest extends BrowserTestBase {
* Test non-default theme admin.
*/
public function testNonDefaultBlockAdmin() {
- $admin_user = $this->drupalCreateUser(['administer blocks', 'administer themes']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer blocks',
+ 'administer themes',
+ ]);
$this->drupalLogin($admin_user);
$new_theme = 'bartik';
\Drupal::service('theme_installer')->install([$new_theme]);
diff --git a/web/core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php b/web/core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php
index b9125ffc..f4add7d7 100644
--- a/web/core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php
+++ b/web/core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php
@@ -65,7 +65,10 @@ class DisplayBlockTest extends ViewTestBase {
* Tests default and custom block categories.
*/
public function testBlockCategory() {
- $this->drupalLogin($this->drupalCreateUser(['administer views', 'administer blocks']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer views',
+ 'administer blocks',
+ ]));
// Create a new view in the UI.
$edit = [];
@@ -368,7 +371,11 @@ class DisplayBlockTest extends ViewTestBase {
* Tests the contextual links on a Views block.
*/
public function testBlockContextualLinks() {
- $this->drupalLogin($this->drupalCreateUser(['administer views', 'access contextual links', 'administer blocks']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer views',
+ 'access contextual links',
+ 'administer blocks',
+ ]));
$block = $this->drupalPlaceBlock('views_block:test_view_block-block_1');
$cached_block = $this->drupalPlaceBlock('views_block:test_view_block-block_1');
$this->drupalGet('test-page');
diff --git a/web/core/modules/block_content/src/Entity/BlockContentType.php b/web/core/modules/block_content/src/Entity/BlockContentType.php
index 20f9593b..acaa6403 100644
--- a/web/core/modules/block_content/src/Entity/BlockContentType.php
+++ b/web/core/modules/block_content/src/Entity/BlockContentType.php
@@ -11,14 +11,13 @@ use Drupal\block_content\BlockContentTypeInterface;
* @ConfigEntityType(
* id = "block_content_type",
* label = @Translation("Custom block type"),
- * label_collection = @Translation("Custom block types"),
+ * label_collection = @Translation("Custom block library"),
* label_singular = @Translation("custom block type"),
* label_plural = @Translation("custom block types"),
* label_count = @PluralTranslation(
* singular = "@count custom block type",
* plural = "@count custom block types",
* ),
- * label_collection = @Translation("Custom block library"),
* handlers = {
* "form" = {
* "default" = "Drupal\block_content\BlockContentTypeForm",
diff --git a/web/core/modules/block_content/tests/src/Functional/BlockContentListTest.php b/web/core/modules/block_content/tests/src/Functional/BlockContentListTest.php
index c5989726..ed9cb5c1 100644
--- a/web/core/modules/block_content/tests/src/Functional/BlockContentListTest.php
+++ b/web/core/modules/block_content/tests/src/Functional/BlockContentListTest.php
@@ -31,7 +31,10 @@ class BlockContentListTest extends BlockContentTestBase {
* Tests the custom block listing page.
*/
public function testListing() {
- $this->drupalLogin($this->drupalCreateUser(['administer blocks', 'translate configuration']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer blocks',
+ 'translate configuration',
+ ]));
$this->drupalGet('admin/structure/block/block-content');
// Test for the page title.
@@ -55,7 +58,7 @@ class BlockContentListTest extends BlockContentTestBase {
$new_label = 'Albatross';
// Add a new entity using the operations link.
$link_text = t('Add custom block');
- $this->assertLink($link_text);
+ $this->assertSession()->linkExists($link_text);
$this->clickLink($link_text);
$this->assertSession()->statusCodeEquals(200);
$edit = [];
diff --git a/web/core/modules/block_content/tests/src/Functional/BlockContentListViewsTest.php b/web/core/modules/block_content/tests/src/Functional/BlockContentListViewsTest.php
index c7ba7488..01f045ee 100644
--- a/web/core/modules/block_content/tests/src/Functional/BlockContentListViewsTest.php
+++ b/web/core/modules/block_content/tests/src/Functional/BlockContentListViewsTest.php
@@ -34,7 +34,10 @@ class BlockContentListViewsTest extends BlockContentTestBase {
* Tests the custom block listing page.
*/
public function testListing() {
- $this->drupalLogin($this->drupalCreateUser(['administer blocks', 'translate configuration']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer blocks',
+ 'translate configuration',
+ ]));
$this->drupalGet('admin/structure/block/block-content');
// Test for the page title.
@@ -67,7 +70,7 @@ class BlockContentListViewsTest extends BlockContentTestBase {
$new_label = 'Albatross';
// Add a new entity using the operations link.
$link_text = t('Add custom block');
- $this->assertLink($link_text);
+ $this->assertSession()->linkExists($link_text);
$this->clickLink($link_text);
$this->assertSession()->statusCodeEquals(200);
$edit = [];
@@ -123,7 +126,7 @@ class BlockContentListViewsTest extends BlockContentTestBase {
// Confirm that the empty text is displayed.
$this->assertText('There are no custom blocks available.');
- $this->assertLink('custom block');
+ $this->assertSession()->linkExists('custom block');
$block_content = BlockContent::create([
'info' => 'Non-reusable block',
diff --git a/web/core/modules/book/tests/src/Functional/BookBreadcrumbTest.php b/web/core/modules/book/tests/src/Functional/BookBreadcrumbTest.php
index b2355aa2..4f471fbb 100644
--- a/web/core/modules/book/tests/src/Functional/BookBreadcrumbTest.php
+++ b/web/core/modules/book/tests/src/Functional/BookBreadcrumbTest.php
@@ -53,8 +53,24 @@ class BookBreadcrumbTest extends BrowserTestBase {
$this->drupalPlaceBlock('page_title_block');
// Create users.
- $this->bookAuthor = $this->drupalCreateUser(['create new books', 'create book content', 'edit own book content', 'add content to books']);
- $this->adminUser = $this->drupalCreateUser(['create new books', 'create book content', 'edit any book content', 'delete any book content', 'add content to books', 'administer blocks', 'administer permissions', 'administer book outlines', 'administer content types', 'administer site configuration']);
+ $this->bookAuthor = $this->drupalCreateUser([
+ 'create new books',
+ 'create book content',
+ 'edit own book content',
+ 'add content to books',
+ ]);
+ $this->adminUser = $this->drupalCreateUser([
+ 'create new books',
+ 'create book content',
+ 'edit any book content',
+ 'delete any book content',
+ 'add content to books',
+ 'administer blocks',
+ 'administer permissions',
+ 'administer book outlines',
+ 'administer content types',
+ 'administer site configuration',
+ ]);
}
/**
diff --git a/web/core/modules/book/tests/src/Functional/BookContentModerationTest.php b/web/core/modules/book/tests/src/Functional/BookContentModerationTest.php
index 2dde8665..02d489fc 100644
--- a/web/core/modules/book/tests/src/Functional/BookContentModerationTest.php
+++ b/web/core/modules/book/tests/src/Functional/BookContentModerationTest.php
@@ -46,7 +46,16 @@ class BookContentModerationTest extends BrowserTestBase {
$workflow->save();
// We need a user with additional content moderation permissions.
- $this->bookAuthor = $this->drupalCreateUser(['create new books', 'create book content', 'edit own book content', 'add content to books', 'access printer-friendly version', 'view any unpublished content', 'use editorial transition create_new_draft', 'use editorial transition publish']);
+ $this->bookAuthor = $this->drupalCreateUser([
+ 'create new books',
+ 'create book content',
+ 'edit own book content',
+ 'add content to books',
+ 'access printer-friendly version',
+ 'view any unpublished content',
+ 'use editorial transition create_new_draft',
+ 'use editorial transition publish',
+ ]);
}
/**
diff --git a/web/core/modules/book/tests/src/Functional/BookTest.php b/web/core/modules/book/tests/src/Functional/BookTest.php
index f4aaa6de..b57773c8 100644
--- a/web/core/modules/book/tests/src/Functional/BookTest.php
+++ b/web/core/modules/book/tests/src/Functional/BookTest.php
@@ -61,10 +61,32 @@ class BookTest extends BrowserTestBase {
node_access_rebuild();
// Create users.
- $this->bookAuthor = $this->drupalCreateUser(['create new books', 'create book content', 'edit own book content', 'add content to books']);
- $this->webUser = $this->drupalCreateUser(['access printer-friendly version', 'node test view']);
- $this->webUserWithoutNodeAccess = $this->drupalCreateUser(['access printer-friendly version']);
- $this->adminUser = $this->drupalCreateUser(['create new books', 'create book content', 'edit any book content', 'delete any book content', 'add content to books', 'administer blocks', 'administer permissions', 'administer book outlines', 'node test view', 'administer content types', 'administer site configuration']);
+ $this->bookAuthor = $this->drupalCreateUser([
+ 'create new books',
+ 'create book content',
+ 'edit own book content',
+ 'add content to books',
+ ]);
+ $this->webUser = $this->drupalCreateUser([
+ 'access printer-friendly version',
+ 'node test view',
+ ]);
+ $this->webUserWithoutNodeAccess = $this->drupalCreateUser([
+ 'access printer-friendly version',
+ ]);
+ $this->adminUser = $this->drupalCreateUser([
+ 'create new books',
+ 'create book content',
+ 'edit any book content',
+ 'delete any book content',
+ 'add content to books',
+ 'administer blocks',
+ 'administer permissions',
+ 'administer book outlines',
+ 'node test view',
+ 'administer content types',
+ 'administer site configuration',
+ ]);
}
/**
@@ -220,7 +242,7 @@ class BookTest extends BrowserTestBase {
// Load the book and verify there is no printer-friendly version link.
$this->drupalGet('node/' . $this->book->id());
- $this->assertNoLink(t('Printer-friendly version'), 'Anonymous user is not shown link to printer-friendly version.');
+ $this->assertSession()->linkNotExists(t('Printer-friendly version'), 'Anonymous user is not shown link to printer-friendly version.');
// Try getting the URL directly, and verify it fails.
$this->drupalGet('book/export/html/' . $this->book->id());
@@ -402,13 +424,13 @@ class BookTest extends BrowserTestBase {
// Create new node not yet a book.
$empty_book = $this->drupalCreateNode(['type' => 'book']);
$this->drupalGet('node/' . $empty_book->id() . '/outline');
- $this->assertNoLink(t('Book outline'), 'Book Author is not allowed to outline');
+ $this->assertSession()->linkNotExists(t('Book outline'), 'Book Author is not allowed to outline');
$this->drupalLogin($this->adminUser);
$this->drupalGet('node/' . $empty_book->id() . '/outline');
$this->assertRaw(t('Book outline'));
$this->assertOptionSelected('edit-book-bid', 0, 'Node does not belong to a book');
- $this->assertNoLink(t('Remove from book outline'));
+ $this->assertSession()->linkNotExists(t('Remove from book outline'));
$edit = [];
$edit['book[bid]'] = '1';
@@ -557,7 +579,11 @@ class BookTest extends BrowserTestBase {
$this->createBook();
// Create administrator user.
- $administratorUser = $this->drupalCreateUser(['administer blocks', 'administer nodes', 'bypass node access']);
+ $administratorUser = $this->drupalCreateUser([
+ 'administer blocks',
+ 'administer nodes',
+ 'bypass node access',
+ ]);
$this->drupalLogin($administratorUser);
// Enable the block with "Show block only on book pages" mode.
diff --git a/web/core/modules/book/tests/src/Functional/Views/BookRelationshipTest.php b/web/core/modules/book/tests/src/Functional/Views/BookRelationshipTest.php
index b8e7fa04..487abe50 100644
--- a/web/core/modules/book/tests/src/Functional/Views/BookRelationshipTest.php
+++ b/web/core/modules/book/tests/src/Functional/Views/BookRelationshipTest.php
@@ -153,7 +153,7 @@ class BookRelationshipTest extends ViewTestBase {
$this->drupalGet('test-book/' . $nodes[$i]->id());
for ($j = 0; $j < $i; $j++) {
- $this->assertLink($nodes[$j]->label());
+ $this->assertSession()->linkExists($nodes[$j]->label());
}
}
}
diff --git a/web/core/modules/ckeditor/src/CKEditorPluginInterface.php b/web/core/modules/ckeditor/src/CKEditorPluginInterface.php
index a5052dce..1f3158b5 100644
--- a/web/core/modules/ckeditor/src/CKEditorPluginInterface.php
+++ b/web/core/modules/ckeditor/src/CKEditorPluginInterface.php
@@ -45,6 +45,7 @@ interface CKEditorPluginInterface extends PluginInspectionInterface {
*
* @param \Drupal\editor\Entity\Editor $editor
* A configured text editor object.
+ *
* @return array
* An unindexed array of plugin names this plugin requires. Each plugin is
* is identified by its annotated ID.
@@ -59,6 +60,7 @@ interface CKEditorPluginInterface extends PluginInspectionInterface {
*
* @param \Drupal\editor\Entity\Editor $editor
* A configured text editor object.
+ *
* @return array
* An array of libraries suitable for usage in a render API #attached
* property.
@@ -91,6 +93,7 @@ interface CKEditorPluginInterface extends PluginInspectionInterface {
*
* @param \Drupal\editor\Entity\Editor $editor
* A configured text editor object.
+ *
* @return array
* A keyed array, whose keys will end up as keys under CKEDITOR.config.
*/
diff --git a/web/core/modules/ckeditor/src/CKEditorPluginManager.php b/web/core/modules/ckeditor/src/CKEditorPluginManager.php
index 735cfa66..47fa80b0 100644
--- a/web/core/modules/ckeditor/src/CKEditorPluginManager.php
+++ b/web/core/modules/ckeditor/src/CKEditorPluginManager.php
@@ -60,6 +60,7 @@ class CKEditorPluginManager extends DefaultPluginManager {
* @param bool $include_internal_plugins
* Defaults to FALSE. When set to TRUE, plugins whose isInternal() method
* returns TRUE will also be included.
+ *
* @return array
* A list of the enabled CKEditor plugins, with the plugin IDs as keys and
* the Drupal root-relative plugin files as values.
diff --git a/web/core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php b/web/core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php
index dc7595a6..c839f7b4 100644
--- a/web/core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php
+++ b/web/core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php
@@ -117,6 +117,7 @@ class StylesCombo extends CKEditorPluginBase implements CKEditorPluginConfigurab
*
* @param string $styles
* The "styles" setting.
+ *
* @return array|false
* An array containing the "stylesSet" configuration, or FALSE when the
* syntax is invalid.
diff --git a/web/core/modules/ckeditor/src/Plugin/Editor/CKEditor.php b/web/core/modules/ckeditor/src/Plugin/Editor/CKEditor.php
index f62825af..af5a4a65 100644
--- a/web/core/modules/ckeditor/src/Plugin/Editor/CKEditor.php
+++ b/web/core/modules/ckeditor/src/Plugin/Editor/CKEditor.php
@@ -403,6 +403,7 @@ class CKEditor extends EditorBase implements ContainerFactoryPluginInterface {
*
* @param \Drupal\editor\Entity\Editor $editor
* A configured text editor object.
+ *
* @return array
* An array containing the "toolbar" configuration.
*/
@@ -426,6 +427,7 @@ class CKEditor extends EditorBase implements ContainerFactoryPluginInterface {
*
* @param \Drupal\editor\Entity\Editor $editor
* A configured text editor object.
+ *
* @return array
* An array containing the "contentsCss" configuration.
*/
diff --git a/web/core/modules/ckeditor/tests/src/Functional/CKEditorLoadingTest.php b/web/core/modules/ckeditor/tests/src/Functional/CKEditorLoadingTest.php
index c43280cb..1e8f2ae2 100644
--- a/web/core/modules/ckeditor/tests/src/Functional/CKEditorLoadingTest.php
+++ b/web/core/modules/ckeditor/tests/src/Functional/CKEditorLoadingTest.php
@@ -72,8 +72,16 @@ class CKEditorLoadingTest extends BrowserTestBase {
'name' => 'Article',
]);
- $this->untrustedUser = $this->drupalCreateUser(['create article content', 'edit any article content']);
- $this->normalUser = $this->drupalCreateUser(['create article content', 'edit any article content', 'use text format filtered_html', 'use text format full_html']);
+ $this->untrustedUser = $this->drupalCreateUser([
+ 'create article content',
+ 'edit any article content',
+ ]);
+ $this->normalUser = $this->drupalCreateUser([
+ 'create article content',
+ 'edit any article content',
+ 'use text format filtered_html',
+ 'use text format full_html',
+ ]);
}
/**
diff --git a/web/core/modules/ckeditor/tests/src/Functional/CKEditorStylesComboTranslationTest.php b/web/core/modules/ckeditor/tests/src/Functional/CKEditorStylesComboTranslationTest.php
index 27fabffb..30207fbf 100644
--- a/web/core/modules/ckeditor/tests/src/Functional/CKEditorStylesComboTranslationTest.php
+++ b/web/core/modules/ckeditor/tests/src/Functional/CKEditorStylesComboTranslationTest.php
@@ -57,7 +57,10 @@ class CKEditorStylesComboTranslationTest extends BrowserTestBase {
]);
$editor->save();
- $this->adminUser = $this->drupalCreateUser(['administer filters', 'translate configuration']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'administer filters',
+ 'translate configuration',
+ ]);
ConfigurableLanguage::createFromLangcode('de')->save();
}
diff --git a/web/core/modules/comment/src/CommentStorageInterface.php b/web/core/modules/comment/src/CommentStorageInterface.php
index accc9de4..592b1ea9 100644
--- a/web/core/modules/comment/src/CommentStorageInterface.php
+++ b/web/core/modules/comment/src/CommentStorageInterface.php
@@ -75,6 +75,7 @@ interface CommentStorageInterface extends ContentEntityStorageInterface {
*
* @param \Drupal\comment\CommentInterface[] $comments
* An array of comment entities keyed by their ids.
+ *
* @return array
* The entity ids of the passed comment entities' children as an array.
*/
diff --git a/web/core/modules/comment/tests/src/Functional/CommentAnonymousTest.php b/web/core/modules/comment/tests/src/Functional/CommentAnonymousTest.php
index ac30efa0..5f9bbd0c 100644
--- a/web/core/modules/comment/tests/src/Functional/CommentAnonymousTest.php
+++ b/web/core/modules/comment/tests/src/Functional/CommentAnonymousTest.php
@@ -176,7 +176,7 @@ class CommentAnonymousTest extends CommentTestBase {
// "Login or register to post comments" type link may be shown.
$this->drupalGet('node/' . $this->node->id());
$this->assertSession()->responseNotMatches('@
]*>Comments
@', 'Comments were not displayed.');
- $this->assertNoLink('Add new comment', 'Link to add comment was found.');
+ $this->assertSession()->linkNotExists('Add new comment', 'Link to add comment was found.');
// Attempt to view node-comment form while disallowed.
$this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment');
@@ -189,8 +189,8 @@ class CommentAnonymousTest extends CommentTestBase {
]);
$this->drupalGet('node/' . $this->node->id());
$this->assertPattern('@
]*>Comments
@', 'Comments were displayed.');
- $this->assertLink('Log in', 1, 'Link to login was found.');
- $this->assertLink('register', 1, 'Link to register was found.');
+ $this->assertSession()->linkExists('Log in', 1, 'Link to login was found.');
+ $this->assertSession()->linkExists('register', 1, 'Link to register was found.');
user_role_change_permissions(RoleInterface::ANONYMOUS_ID, [
'access comments' => FALSE,
diff --git a/web/core/modules/comment/tests/src/Functional/CommentBookTest.php b/web/core/modules/comment/tests/src/Functional/CommentBookTest.php
index b461f709..76230d1f 100644
--- a/web/core/modules/comment/tests/src/Functional/CommentBookTest.php
+++ b/web/core/modules/comment/tests/src/Functional/CommentBookTest.php
@@ -60,7 +60,11 @@ class CommentBookTest extends BrowserTestBase {
]);
$comment->save();
- $commenting_user = $this->drupalCreateUser(['access printer-friendly version', 'access comments', 'post comments']);
+ $commenting_user = $this->drupalCreateUser([
+ 'access printer-friendly version',
+ 'access comments',
+ 'post comments',
+ ]);
$this->drupalLogin($commenting_user);
$this->drupalGet('node/' . $book_node->id());
diff --git a/web/core/modules/comment/tests/src/Functional/CommentFieldsTest.php b/web/core/modules/comment/tests/src/Functional/CommentFieldsTest.php
index 46fe42d9..7a0298ea 100644
--- a/web/core/modules/comment/tests/src/Functional/CommentFieldsTest.php
+++ b/web/core/modules/comment/tests/src/Functional/CommentFieldsTest.php
@@ -191,7 +191,10 @@ class CommentFieldsTest extends CommentTestBase {
*/
public function testCommentInstallAfterContentModule() {
// Create a user to do module administration.
- $this->adminUser = $this->drupalCreateUser(['access administration pages', 'administer modules']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'access administration pages',
+ 'administer modules',
+ ]);
$this->drupalLogin($this->adminUser);
// Drop default comment field added in CommentTestBase::setup().
@@ -233,7 +236,12 @@ class CommentFieldsTest extends CommentTestBase {
// Try to post a comment on each node. A failure will be triggered if the
// comment body is missing on one of these forms, due to postComment()
// asserting that the body is actually posted correctly.
- $this->webUser = $this->drupalCreateUser(['access content', 'access comments', 'post comments', 'skip comment approval']);
+ $this->webUser = $this->drupalCreateUser([
+ 'access content',
+ 'access comments',
+ 'post comments',
+ 'skip comment approval',
+ ]);
$this->drupalLogin($this->webUser);
$this->postComment($book_node, $this->randomMachineName(), $this->randomMachineName());
}
diff --git a/web/core/modules/comment/tests/src/Functional/CommentLanguageTest.php b/web/core/modules/comment/tests/src/Functional/CommentLanguageTest.php
index cb2c7966..7970718d 100644
--- a/web/core/modules/comment/tests/src/Functional/CommentLanguageTest.php
+++ b/web/core/modules/comment/tests/src/Functional/CommentLanguageTest.php
@@ -45,7 +45,17 @@ class CommentLanguageTest extends BrowserTestBase {
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
// Create and log in user.
- $admin_user = $this->drupalCreateUser(['administer site configuration', 'administer languages', 'access administration pages', 'administer content types', 'administer comments', 'create article content', 'access comments', 'post comments', 'skip comment approval']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer site configuration',
+ 'administer languages',
+ 'access administration pages',
+ 'administer content types',
+ 'administer comments',
+ 'create article content',
+ 'access comments',
+ 'post comments',
+ 'skip comment approval',
+ ]);
$this->drupalLogin($admin_user);
// Add language.
diff --git a/web/core/modules/comment/tests/src/Functional/CommentLinksAlterTest.php b/web/core/modules/comment/tests/src/Functional/CommentLinksAlterTest.php
index 7c4349b1..3abc1f87 100644
--- a/web/core/modules/comment/tests/src/Functional/CommentLinksAlterTest.php
+++ b/web/core/modules/comment/tests/src/Functional/CommentLinksAlterTest.php
@@ -34,7 +34,7 @@ class CommentLinksAlterTest extends CommentTestBase {
$this->drupalGet('node/' . $this->node->id());
- $this->assertLink(t('Report'));
+ $this->assertSession()->linkExists(t('Report'));
}
}
diff --git a/web/core/modules/comment/tests/src/Functional/CommentLinksTest.php b/web/core/modules/comment/tests/src/Functional/CommentLinksTest.php
index 34a815c0..0d501c7b 100644
--- a/web/core/modules/comment/tests/src/Functional/CommentLinksTest.php
+++ b/web/core/modules/comment/tests/src/Functional/CommentLinksTest.php
@@ -101,9 +101,9 @@ class CommentLinksTest extends CommentTestBase {
// In teaser view, a link containing the comment count is always
// expected.
if ($path == 'node') {
- $this->assertLink(t('1 comment'));
+ $this->assertSession()->linkExists(t('1 comment'));
}
- $this->assertLink('Add new comment');
+ $this->assertSession()->linkExists('Add new comment');
}
$display_repository = $this->container->get('entity_display.repository');
@@ -133,13 +133,13 @@ class CommentLinksTest extends CommentTestBase {
->removeComponent('links')
->save();
$this->drupalGet($this->node->toUrl());
- $this->assertNoLink('1 comment');
- $this->assertNoLink('Add new comment');
+ $this->assertSession()->linkNotExists('1 comment');
+ $this->assertSession()->linkNotExists('Add new comment');
// Visit the full node, make sure there are links for the comment.
$this->drupalGet('node/' . $this->node->id());
$this->assertText($comment->getSubject());
- $this->assertLink('Reply');
+ $this->assertSession()->linkExists('Reply');
// Make sure we can hide comment links.
$display_repository->getViewDisplay('comment', 'comment')
@@ -147,7 +147,7 @@ class CommentLinksTest extends CommentTestBase {
->save();
$this->drupalGet('node/' . $this->node->id());
$this->assertText($comment->getSubject());
- $this->assertNoLink('Reply');
+ $this->assertSession()->linkNotExists('Reply');
}
}
diff --git a/web/core/modules/comment/tests/src/Functional/CommentNewIndicatorTest.php b/web/core/modules/comment/tests/src/Functional/CommentNewIndicatorTest.php
index 9f7b74b9..ba0a16bd 100644
--- a/web/core/modules/comment/tests/src/Functional/CommentNewIndicatorTest.php
+++ b/web/core/modules/comment/tests/src/Functional/CommentNewIndicatorTest.php
@@ -60,8 +60,8 @@ class CommentNewIndicatorTest extends CommentTestBase {
// node.
$this->drupalLogin($this->adminUser);
$this->drupalGet('node');
- $this->assertNoLink(t('@count comments', ['@count' => 0]));
- $this->assertLink(t('Read more'));
+ $this->assertSession()->linkNotExists(t('@count comments', ['@count' => 0]));
+ $this->assertSession()->linkExists(t('Read more'));
// Verify the data-history-node-last-comment-timestamp attribute, which is
// used by the drupal.node-new-comments-link library to determine whether
// a "x new comments" link might be necessary or not. We do this in
diff --git a/web/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php b/web/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php
index d7676cdd..295fa377 100644
--- a/web/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php
+++ b/web/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php
@@ -355,7 +355,7 @@ class CommentNonNodeTest extends BrowserTestBase {
// Attempt to view comments while disallowed.
$this->drupalGet('entity-test/' . $this->entity->id());
$this->assertSession()->responseNotMatches('@
]*>Comments
@', 'Comments were not displayed.');
- $this->assertNoLink('Add new comment', 'Link to add comment was found.');
+ $this->assertSession()->linkNotExists('Add new comment', 'Link to add comment was found.');
// Attempt to view test entity comment form while disallowed.
$this->drupalGet('comment/reply/entity_test/' . $this->entity->id() . '/comment');
@@ -371,8 +371,8 @@ class CommentNonNodeTest extends BrowserTestBase {
]);
$this->drupalGet('entity_test/' . $this->entity->id());
$this->assertPattern('@
]*>Comments
@', 'Comments were displayed.');
- $this->assertLink('Log in', 0, 'Link to login was found.');
- $this->assertLink('register', 0, 'Link to register was found.');
+ $this->assertSession()->linkExists('Log in', 0, 'Link to login was found.');
+ $this->assertSession()->linkExists('register', 0, 'Link to register was found.');
$this->assertNoFieldByName('subject[0][value]', '', 'Subject field not found.');
$this->assertNoFieldByName('comment_body[0][value]', '', 'Comment field not found.');
diff --git a/web/core/modules/comment/tests/src/Functional/CommentPreviewTest.php b/web/core/modules/comment/tests/src/Functional/CommentPreviewTest.php
index 4f029a7f..06f8a7bd 100644
--- a/web/core/modules/comment/tests/src/Functional/CommentPreviewTest.php
+++ b/web/core/modules/comment/tests/src/Functional/CommentPreviewTest.php
@@ -128,7 +128,12 @@ class CommentPreviewTest extends CommentTestBase {
* Tests comment edit, preview, and save.
*/
public function testCommentEditPreviewSave() {
- $web_user = $this->drupalCreateUser(['access comments', 'post comments', 'skip comment approval', 'edit own comments']);
+ $web_user = $this->drupalCreateUser([
+ 'access comments',
+ 'post comments',
+ 'skip comment approval',
+ 'edit own comments',
+ ]);
$this->drupalLogin($this->adminUser);
$this->setCommentPreview(DRUPAL_OPTIONAL);
$this->setCommentForm(TRUE);
diff --git a/web/core/modules/config/tests/src/Functional/ConfigDependencyWebTest.php b/web/core/modules/config/tests/src/Functional/ConfigDependencyWebTest.php
index cce78346..f5ddd141 100644
--- a/web/core/modules/config/tests/src/Functional/ConfigDependencyWebTest.php
+++ b/web/core/modules/config/tests/src/Functional/ConfigDependencyWebTest.php
@@ -35,7 +35,9 @@ class ConfigDependencyWebTest extends BrowserTestBase {
* @see \Drupal\Core\Config\Entity\ConfigDependencyDeleteFormTrait
*/
public function testConfigDependencyDeleteFormTrait() {
- $this->drupalLogin($this->drupalCreateUser(['administer site configuration']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer site configuration',
+ ]));
/** @var \Drupal\Core\Config\Entity\ConfigEntityStorage $storage */
$storage = $this->container->get('entity_type.manager')->getStorage('config_test');
diff --git a/web/core/modules/config/tests/src/Functional/ConfigEntityFormOverrideTest.php b/web/core/modules/config/tests/src/Functional/ConfigEntityFormOverrideTest.php
index 628fb4bf..ddb839ed 100644
--- a/web/core/modules/config/tests/src/Functional/ConfigEntityFormOverrideTest.php
+++ b/web/core/modules/config/tests/src/Functional/ConfigEntityFormOverrideTest.php
@@ -25,7 +25,9 @@ class ConfigEntityFormOverrideTest extends BrowserTestBase {
* Tests that overrides do not affect forms or listing screens.
*/
public function testFormsWithOverrides() {
- $this->drupalLogin($this->drupalCreateUser(['administer site configuration']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer site configuration',
+ ]));
$original_label = 'Default';
$overridden_label = 'Overridden label';
diff --git a/web/core/modules/config/tests/src/Functional/ConfigEntityListMultilingualTest.php b/web/core/modules/config/tests/src/Functional/ConfigEntityListMultilingualTest.php
index 882190a9..496d67c4 100644
--- a/web/core/modules/config/tests/src/Functional/ConfigEntityListMultilingualTest.php
+++ b/web/core/modules/config/tests/src/Functional/ConfigEntityListMultilingualTest.php
@@ -41,7 +41,10 @@ class ConfigEntityListMultilingualTest extends BrowserTestBase {
*/
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']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'access administration pages',
+ 'administer site configuration',
+ ]));
// Get the list page.
$this->drupalGet('admin/structure/config_test');
diff --git a/web/core/modules/config/tests/src/Functional/ConfigEntityListTest.php b/web/core/modules/config/tests/src/Functional/ConfigEntityListTest.php
index 786c6296..cd12fbde 100644
--- a/web/core/modules/config/tests/src/Functional/ConfigEntityListTest.php
+++ b/web/core/modules/config/tests/src/Functional/ConfigEntityListTest.php
@@ -156,7 +156,10 @@ class ConfigEntityListTest extends BrowserTestBase {
*/
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']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'access administration pages',
+ 'administer site configuration',
+ ]));
// Get the list callback page.
$this->drupalGet('admin/structure/config_test');
@@ -190,7 +193,7 @@ class ConfigEntityListTest extends BrowserTestBase {
$this->assertNotEmpty($elements[2]->find('xpath', '//ul'), 'Operations list found.');
// Add a new entity using the operations link.
- $this->assertLink('Add test configuration');
+ $this->assertSession()->linkExists('Add test configuration');
$this->clickLink('Add test configuration');
$this->assertSession()->statusCodeEquals(200);
$edit = [
@@ -254,7 +257,9 @@ class ConfigEntityListTest extends BrowserTestBase {
* Test paging.
*/
public function testPager() {
- $this->drupalLogin($this->drupalCreateUser(['administer site configuration']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer site configuration',
+ ]));
$storage = \Drupal::service('entity_type.manager')->getListBuilder('config_test')->getStorage();
diff --git a/web/core/modules/config/tests/src/Functional/ConfigEntityStatusUITest.php b/web/core/modules/config/tests/src/Functional/ConfigEntityStatusUITest.php
index 4b062bcd..ef994d76 100644
--- a/web/core/modules/config/tests/src/Functional/ConfigEntityStatusUITest.php
+++ b/web/core/modules/config/tests/src/Functional/ConfigEntityStatusUITest.php
@@ -27,7 +27,9 @@ class ConfigEntityStatusUITest extends BrowserTestBase {
* Tests status operations.
*/
public function testCRUD() {
- $this->drupalLogin($this->drupalCreateUser(['administer site configuration']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer site configuration',
+ ]));
$id = strtolower($this->randomMachineName());
$edit = [
diff --git a/web/core/modules/config/tests/src/Functional/ConfigEntityTest.php b/web/core/modules/config/tests/src/Functional/ConfigEntityTest.php
index ef6b3275..cff042f7 100644
--- a/web/core/modules/config/tests/src/Functional/ConfigEntityTest.php
+++ b/web/core/modules/config/tests/src/Functional/ConfigEntityTest.php
@@ -236,7 +236,9 @@ class ConfigEntityTest extends BrowserTestBase {
* Tests CRUD operations through the UI.
*/
public function testCRUDUI() {
- $this->drupalLogin($this->drupalCreateUser(['administer site configuration']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer site configuration',
+ ]));
$id = strtolower($this->randomMachineName());
$label1 = $this->randomMachineName();
diff --git a/web/core/modules/config/tests/src/Functional/ConfigFormOverrideTest.php b/web/core/modules/config/tests/src/Functional/ConfigFormOverrideTest.php
index 14edd883..75ab4a7a 100644
--- a/web/core/modules/config/tests/src/Functional/ConfigFormOverrideTest.php
+++ b/web/core/modules/config/tests/src/Functional/ConfigFormOverrideTest.php
@@ -21,7 +21,10 @@ class ConfigFormOverrideTest extends BrowserTestBase {
* Tests that overrides do not affect forms.
*/
public function testFormsWithOverrides() {
- $this->drupalLogin($this->drupalCreateUser(['access administration pages', 'administer site configuration']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'access administration pages',
+ 'administer site configuration',
+ ]));
$overridden_name = 'Site name global conf override';
diff --git a/web/core/modules/config/tests/src/Functional/ConfigInstallWebTest.php b/web/core/modules/config/tests/src/Functional/ConfigInstallWebTest.php
index 3cc8fda7..745a3f54 100644
--- a/web/core/modules/config/tests/src/Functional/ConfigInstallWebTest.php
+++ b/web/core/modules/config/tests/src/Functional/ConfigInstallWebTest.php
@@ -34,7 +34,11 @@ class ConfigInstallWebTest extends BrowserTestBase {
protected function setUp() {
parent::setUp();
- $this->adminUser = $this->drupalCreateUser(['administer modules', 'administer themes', 'administer site configuration']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'administer modules',
+ 'administer themes',
+ 'administer site configuration',
+ ]);
// Ensure the global variable being asserted by this test does not exist;
// a previous test executed in this request/process might have set it.
diff --git a/web/core/modules/config/tests/src/Functional/ConfigLanguageOverrideWebTest.php b/web/core/modules/config/tests/src/Functional/ConfigLanguageOverrideWebTest.php
index b35821cb..4399f581 100644
--- a/web/core/modules/config/tests/src/Functional/ConfigLanguageOverrideWebTest.php
+++ b/web/core/modules/config/tests/src/Functional/ConfigLanguageOverrideWebTest.php
@@ -40,7 +40,10 @@ class ConfigLanguageOverrideWebTest extends BrowserTestBase {
* Tests translating the site name.
*/
public function testSiteNameTranslation() {
- $adminUser = $this->drupalCreateUser(['administer site configuration', 'administer languages']);
+ $adminUser = $this->drupalCreateUser([
+ 'administer site configuration',
+ 'administer languages',
+ ]);
$this->drupalLogin($adminUser);
// Add a custom language.
diff --git a/web/core/modules/config/tests/src/FunctionalJavascript/ConfigEntityTest.php b/web/core/modules/config/tests/src/FunctionalJavascript/ConfigEntityTest.php
index 7ea62e2e..5337ab90 100644
--- a/web/core/modules/config/tests/src/FunctionalJavascript/ConfigEntityTest.php
+++ b/web/core/modules/config/tests/src/FunctionalJavascript/ConfigEntityTest.php
@@ -25,7 +25,9 @@ class ConfigEntityTest extends WebDriverTestBase {
* Tests ajax operations through the UI on 'Add' page.
*/
public function testAjaxOnAddPage() {
- $this->drupalLogin($this->drupalCreateUser(['administer site configuration']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer site configuration',
+ ]));
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
diff --git a/web/core/modules/config_translation/tests/src/Functional/ConfigTranslationInstallTest.php b/web/core/modules/config_translation/tests/src/Functional/ConfigTranslationInstallTest.php
index 4594e06e..a4d174a8 100644
--- a/web/core/modules/config_translation/tests/src/Functional/ConfigTranslationInstallTest.php
+++ b/web/core/modules/config_translation/tests/src/Functional/ConfigTranslationInstallTest.php
@@ -39,6 +39,7 @@ class ConfigTranslationInstallTest extends InstallerTestBase {
*
* @param string $langcode
* The language code.
+ *
* @return string
* Contents for the test .po file.
*/
diff --git a/web/core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php b/web/core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php
index 3519a5c7..99da0efc 100644
--- a/web/core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php
+++ b/web/core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php
@@ -126,7 +126,7 @@ class ConfigTranslationOverviewTest extends BrowserTestBase {
$this->assertRaw('
' . t('Language') . '
');
$this->drupalGet($base_url);
- $this->assertLink(t('Translate @title', ['@title' => $entity_type->getSingularLabel()]));
+ $this->assertSession()->linkExists(t('Translate @title', ['@title' => $entity_type->getSingularLabel()]));
}
}
diff --git a/web/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php b/web/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php
index 343b3481..bc540b00 100644
--- a/web/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php
+++ b/web/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php
@@ -299,7 +299,7 @@ class ConfigTranslationUiTest extends BrowserTestBase {
// While translator can access the translation page, the edit link is not
// present due to lack of permissions.
$this->drupalGet($translation_base_url);
- $this->assertNoLink(t('Edit'));
+ $this->assertSession()->linkNotExists(t('Edit'));
// Check 'Add' link for French.
$this->assertLinkByHref("$translation_base_url/fr/add");
@@ -331,7 +331,7 @@ class ConfigTranslationUiTest extends BrowserTestBase {
// Make sure translate tab is present.
$this->drupalGet('admin/structure/contact/manage/feedback');
- $this->assertLink(t('Translate @type', ['@type' => 'contact form']));
+ $this->assertSession()->linkExists(t('Translate @type', ['@type' => 'contact form']));
// Visit the form to confirm the changes.
$this->drupalGet('contact/feedback');
@@ -339,7 +339,7 @@ class ConfigTranslationUiTest extends BrowserTestBase {
foreach ($this->langcodes as $langcode) {
$this->drupalGet($translation_base_url);
- $this->assertLink(t('Translate @type', ['@type' => 'contact form']));
+ $this->assertSession()->linkExists(t('Translate @type', ['@type' => 'contact form']));
// 'Add' link should be present for $langcode translation.
$translation_page_url = "$translation_base_url/$langcode/add";
@@ -435,7 +435,7 @@ class ConfigTranslationUiTest extends BrowserTestBase {
// While translator can access the translation page, the edit link is not
// present due to lack of permissions.
$this->drupalGet($translation_base_url);
- $this->assertNoLink(t('Edit'));
+ $this->assertSession()->linkNotExists(t('Edit'));
// Check 'Add' link for French.
$this->assertLinkByHref("$translation_base_url/fr/add");
@@ -516,10 +516,10 @@ class ConfigTranslationUiTest extends BrowserTestBase {
$this->drupalLogin($this->adminUser);
$this->drupalGet('admin/config/people/accounts');
- $this->assertLink(t('Translate @type', ['@type' => 'account settings']));
+ $this->assertSession()->linkExists(t('Translate @type', ['@type' => 'account settings']));
$this->drupalGet('admin/config/people/accounts/translate');
- $this->assertLink(t('Translate @type', ['@type' => 'account settings']));
+ $this->assertSession()->linkExists(t('Translate @type', ['@type' => 'account settings']));
$this->assertLinkByHref('admin/config/people/accounts/translate/fr/add');
// Update account settings fields for French.
diff --git a/web/core/modules/contact/tests/src/Functional/ContactPersonalTest.php b/web/core/modules/contact/tests/src/Functional/ContactPersonalTest.php
index a6a5e201..0029b2eb 100644
--- a/web/core/modules/contact/tests/src/Functional/ContactPersonalTest.php
+++ b/web/core/modules/contact/tests/src/Functional/ContactPersonalTest.php
@@ -57,11 +57,19 @@ class ContactPersonalTest extends BrowserTestBase {
parent::setUp();
// Create an admin user.
- $this->adminUser = $this->drupalCreateUser(['administer contact forms', 'administer users', 'administer account settings', 'access site reports']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'administer contact forms',
+ 'administer users',
+ 'administer account settings',
+ 'access site reports',
+ ]);
// Create some normal users with their contact forms enabled by default.
$this->config('contact.settings')->set('user_default_enabled', TRUE)->save();
- $this->webUser = $this->drupalCreateUser(['access user profiles', 'access user contact forms']);
+ $this->webUser = $this->drupalCreateUser([
+ 'access user profiles',
+ 'access user contact forms',
+ ]);
$this->contactUser = $this->drupalCreateUser();
}
diff --git a/web/core/modules/contact/tests/src/Functional/ContactSitewideTest.php b/web/core/modules/contact/tests/src/Functional/ContactSitewideTest.php
index ac8bf0eb..20b924c5 100644
--- a/web/core/modules/contact/tests/src/Functional/ContactSitewideTest.php
+++ b/web/core/modules/contact/tests/src/Functional/ContactSitewideTest.php
@@ -59,7 +59,9 @@ class ContactSitewideTest extends BrowserTestBase {
*/
public function testSiteWideContact() {
// Tests name and email fields for authenticated and anonymous users.
- $this->drupalLogin($this->drupalCreateUser(['access site-wide contact form']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'access site-wide contact form',
+ ]));
$this->drupalGet('contact');
// Ensure that there is no textfield for name.
diff --git a/web/core/modules/content_moderation/src/EntityTypeInfo.php b/web/core/modules/content_moderation/src/EntityTypeInfo.php
index 363ecaac..00ddda2d 100644
--- a/web/core/modules/content_moderation/src/EntityTypeInfo.php
+++ b/web/core/modules/content_moderation/src/EntityTypeInfo.php
@@ -321,37 +321,36 @@ class EntityTypeInfo implements ContainerInjectionInterface {
public function formAlter(array &$form, FormStateInterface $form_state, $form_id) {
$form_object = $form_state->getFormObject();
if ($form_object instanceof BundleEntityFormBase) {
- $config_entity_type = $form_object->getEntity()->getEntityType();
- $bundle_of = $config_entity_type->getBundleOf();
+ $config_entity = $form_object->getEntity();
+ $bundle_of = $config_entity->getEntityType()->getBundleOf();
if ($bundle_of
&& ($bundle_of_entity_type = $this->entityTypeManager->getDefinition($bundle_of))
- && $this->moderationInfo->canModerateEntitiesOfEntityType($bundle_of_entity_type)) {
- $this->entityTypeManager->getHandler($config_entity_type->getBundleOf(), 'moderation')->enforceRevisionsBundleFormAlter($form, $form_state, $form_id);
+ && $this->moderationInfo->shouldModerateEntitiesOfBundle($bundle_of_entity_type, $config_entity->id())) {
+ $this->entityTypeManager->getHandler($bundle_of, 'moderation')->enforceRevisionsBundleFormAlter($form, $form_state, $form_id);
}
}
elseif ($this->isModeratedEntityEditForm($form_object)) {
/** @var \Drupal\Core\Entity\ContentEntityFormInterface $form_object */
/** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
$entity = $form_object->getEntity();
- if ($this->moderationInfo->isModeratedEntity($entity)) {
- $this->entityTypeManager
- ->getHandler($entity->getEntityTypeId(), 'moderation')
- ->enforceRevisionsEntityFormAlter($form, $form_state, $form_id);
- // Submit handler to redirect to the latest version, if available.
- $form['actions']['submit']['#submit'][] = [EntityTypeInfo::class, 'bundleFormRedirect'];
+ $this->entityTypeManager
+ ->getHandler($entity->getEntityTypeId(), 'moderation')
+ ->enforceRevisionsEntityFormAlter($form, $form_state, $form_id);
- // Move the 'moderation_state' field widget to the footer region, if
- // available.
- if (isset($form['footer']) && in_array($form_object->getOperation(), ['edit', 'default'], TRUE)) {
- $form['moderation_state']['#group'] = 'footer';
- }
+ // Submit handler to redirect to the latest version, if available.
+ $form['actions']['submit']['#submit'][] = [EntityTypeInfo::class, 'bundleFormRedirect'];
- // If the publishing status exists in the meta region, replace it with
- // the current state instead.
- if (isset($form['meta']['published'])) {
- $form['meta']['published']['#markup'] = $this->moderationInfo->getWorkflowForEntity($entity)->getTypePlugin()->getState($entity->moderation_state->value)->label();
- }
+ // Move the 'moderation_state' field widget to the footer region, if
+ // available.
+ if (isset($form['footer']) && in_array($form_object->getOperation(), ['edit', 'default'], TRUE)) {
+ $form['moderation_state']['#group'] = 'footer';
+ }
+
+ // If the publishing status exists in the meta region, replace it with
+ // the current state instead.
+ if (isset($form['meta']['published'])) {
+ $form['meta']['published']['#markup'] = $this->moderationInfo->getWorkflowForEntity($entity)->getTypePlugin()->getState($entity->moderation_state->value)->label();
}
}
}
diff --git a/web/core/modules/content_moderation/src/Plugin/Field/ModerationStateFieldItemList.php b/web/core/modules/content_moderation/src/Plugin/Field/ModerationStateFieldItemList.php
index 679fca92..7e717881 100644
--- a/web/core/modules/content_moderation/src/Plugin/Field/ModerationStateFieldItemList.php
+++ b/web/core/modules/content_moderation/src/Plugin/Field/ModerationStateFieldItemList.php
@@ -81,6 +81,7 @@ class ModerationStateFieldItemList extends FieldItemList {
// being reverted.
->condition('content_entity_revision_id', $entity->isNewRevision() ? $entity->getLoadedRevisionId() : $entity->getRevisionId())
->condition('workflow', $moderation_info->getWorkflowForEntity($entity)->id())
+ ->condition('langcode', $entity->language()->getId())
->allRevisions()
->sort('revision_id', 'DESC')
->execute();
diff --git a/web/core/modules/content_moderation/tests/src/Functional/ModeratedContentViewTest.php b/web/core/modules/content_moderation/tests/src/Functional/ModeratedContentViewTest.php
index 0faf532f..d5906e0d 100644
--- a/web/core/modules/content_moderation/tests/src/Functional/ModeratedContentViewTest.php
+++ b/web/core/modules/content_moderation/tests/src/Functional/ModeratedContentViewTest.php
@@ -54,7 +54,12 @@ class ModeratedContentViewTest extends BrowserTestBase {
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'article');
$workflow->save();
- $this->adminUser = $this->drupalCreateUser(['access administration pages', 'view any unpublished content', 'administer nodes', 'bypass node access']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'access administration pages',
+ 'view any unpublished content',
+ 'administer nodes',
+ 'bypass node access',
+ ]);
}
/**
diff --git a/web/core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTypeTest.php b/web/core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTypeTest.php
index 8999dae1..5c4b70a4 100644
--- a/web/core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTypeTest.php
+++ b/web/core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTypeTest.php
@@ -67,9 +67,18 @@ class ModerationStateNodeTypeTest extends ModerationStateTestBase {
], t('Save'));
$this->assertText('Not moderated Test has been created.');
+ // Check that the 'Create new revision' is not disabled.
+ $this->drupalGet('/admin/structure/types/manage/not_moderated');
+ $this->assertNull($this->assertSession()->fieldExists('options[revision]')->getAttribute('disabled'));
+
// Now enable moderation state.
$this->enableModerationThroughUi('not_moderated');
+ // Check that the 'Create new revision' checkbox is checked and disabled.
+ $this->drupalGet('/admin/structure/types/manage/not_moderated');
+ $this->assertSession()->checkboxChecked('options[revision]');
+ $this->assertSession()->fieldDisabled('options[revision]');
+
// And make sure it works.
$nodes = \Drupal::entityTypeManager()->getStorage('node')
->loadByProperties(['title' => 'Test']);
diff --git a/web/core/modules/content_moderation/tests/src/Functional/ModerationStateTestBase.php b/web/core/modules/content_moderation/tests/src/Functional/ModerationStateTestBase.php
index a2600abd..530acff3 100644
--- a/web/core/modules/content_moderation/tests/src/Functional/ModerationStateTestBase.php
+++ b/web/core/modules/content_moderation/tests/src/Functional/ModerationStateTestBase.php
@@ -112,10 +112,6 @@ abstract class ModerationStateTestBase extends BrowserTestBase {
$this->drupalGet('admin/structure/types');
$this->clickLink('Add content type');
- // Check that the 'Create new revision' checkbox is checked and disabled.
- $this->assertSession()->checkboxChecked('options[revision]');
- $this->assertSession()->fieldDisabled('options[revision]');
-
$edit = [
'name' => $content_type_name,
'type' => $content_type_id,
diff --git a/web/core/modules/content_moderation/tests/src/Functional/ViewsModerationStateFilterTest.php b/web/core/modules/content_moderation/tests/src/Functional/ViewsModerationStateFilterTest.php
index 9598e1bd..7aa509f2 100644
--- a/web/core/modules/content_moderation/tests/src/Functional/ViewsModerationStateFilterTest.php
+++ b/web/core/modules/content_moderation/tests/src/Functional/ViewsModerationStateFilterTest.php
@@ -66,7 +66,10 @@ class ViewsModerationStateFilterTest extends ViewTestBase {
$new_workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'example_c');
$new_workflow->save();
- $this->drupalLogin($this->drupalCreateUser(['administer workflows', 'administer views']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer workflows',
+ 'administer views',
+ ]));
$this->container->get('module_installer')->install(['content_moderation_test_views']);
diff --git a/web/core/modules/content_moderation/tests/src/Kernel/ModerationStateFieldItemListTest.php b/web/core/modules/content_moderation/tests/src/Kernel/ModerationStateFieldItemListTest.php
index ee03797d..6479afd7 100644
--- a/web/core/modules/content_moderation/tests/src/Kernel/ModerationStateFieldItemListTest.php
+++ b/web/core/modules/content_moderation/tests/src/Kernel/ModerationStateFieldItemListTest.php
@@ -401,4 +401,33 @@ class ModerationStateFieldItemListTest extends KernelTestBase {
$this->assertEquals('published', $translation->moderation_state->value);
}
+ /**
+ * Tests field item list translation support with unmoderated content.
+ */
+ public function testTranslationWithExistingUnmoderatedContent() {
+ $node = Node::create([
+ 'title' => 'Published en',
+ 'langcode' => 'en',
+ 'type' => 'unmoderated',
+ ]);
+ $node->setPublished();
+ $node->save();
+
+ $workflow = Workflow::load('editorial');
+ $workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'unmoderated');
+ $workflow->save();
+
+ $translation = $node->addTranslation('de');
+ $translation->moderation_state = 'draft';
+ $translation->save();
+
+ $node_storage = $this->container->get('entity_type.manager')->getStorage('node');
+ $node = $node_storage->loadRevision($node_storage->getLatestRevisionId($node->id()));
+
+ $this->assertEquals('published', $node->moderation_state->value);
+ $this->assertEquals('draft', $translation->moderation_state->value);
+ $this->assertTrue($node->isPublished());
+ $this->assertFalse($translation->isPublished());
+ }
+
}
diff --git a/web/core/modules/content_translation/src/Controller/ContentTranslationController.php b/web/core/modules/content_translation/src/Controller/ContentTranslationController.php
index 5d48cc05..254a4057 100644
--- a/web/core/modules/content_translation/src/Controller/ContentTranslationController.php
+++ b/web/core/modules/content_translation/src/Controller/ContentTranslationController.php
@@ -99,6 +99,7 @@ class ContentTranslationController extends ControllerBase {
* The route match.
* @param string $entity_type_id
* (optional) The entity type ID.
+ *
* @return array
* Array of page elements to render.
*/
diff --git a/web/core/modules/content_translation/tests/src/Functional/ContentTranslationEntityBundleUITest.php b/web/core/modules/content_translation/tests/src/Functional/ContentTranslationEntityBundleUITest.php
index d9c0ab23..76bada77 100644
--- a/web/core/modules/content_translation/tests/src/Functional/ContentTranslationEntityBundleUITest.php
+++ b/web/core/modules/content_translation/tests/src/Functional/ContentTranslationEntityBundleUITest.php
@@ -26,7 +26,12 @@ class ContentTranslationEntityBundleUITest extends BrowserTestBase {
protected function setUp() {
parent::setUp();
- $user = $this->drupalCreateUser(['access administration pages', 'administer languages', 'administer content translation', 'administer content types']);
+ $user = $this->drupalCreateUser([
+ 'access administration pages',
+ 'administer languages',
+ 'administer content translation',
+ 'administer content types',
+ ]);
$this->drupalLogin($user);
}
diff --git a/web/core/modules/content_translation/tests/src/Functional/ContentTranslationOperationsTest.php b/web/core/modules/content_translation/tests/src/Functional/ContentTranslationOperationsTest.php
index 347d4c9e..60e704ef 100644
--- a/web/core/modules/content_translation/tests/src/Functional/ContentTranslationOperationsTest.php
+++ b/web/core/modules/content_translation/tests/src/Functional/ContentTranslationOperationsTest.php
@@ -64,7 +64,12 @@ class ContentTranslationOperationsTest extends NodeTestBase {
\Drupal::service('router.builder')->rebuild();
$this->baseUser1 = $this->drupalCreateUser(['access content overview']);
- $this->baseUser2 = $this->drupalCreateUser(['access content overview', 'create content translations', 'update content translations', 'delete content translations']);
+ $this->baseUser2 = $this->drupalCreateUser([
+ 'access content overview',
+ 'create content translations',
+ 'update content translations',
+ 'delete content translations',
+ ]);
}
/**
diff --git a/web/core/modules/content_translation/tests/src/Functional/ContentTranslationSettingsTest.php b/web/core/modules/content_translation/tests/src/Functional/ContentTranslationSettingsTest.php
index 2f6455a9..4c99f1b7 100644
--- a/web/core/modules/content_translation/tests/src/Functional/ContentTranslationSettingsTest.php
+++ b/web/core/modules/content_translation/tests/src/Functional/ContentTranslationSettingsTest.php
@@ -49,7 +49,17 @@ class ContentTranslationSettingsTest extends BrowserTestBase {
$this->addDefaultCommentField('node', 'article', 'comment_article', CommentItemInterface::OPEN, 'comment_article');
$this->addDefaultCommentField('node', 'page', 'comment_page');
- $admin_user = $this->drupalCreateUser(['access administration pages', 'administer languages', 'administer content translation', 'administer content types', 'administer node fields', 'administer comment fields', 'administer comments', 'administer comment types', 'administer account settings']);
+ $admin_user = $this->drupalCreateUser([
+ 'access administration pages',
+ 'administer languages',
+ 'administer content translation',
+ 'administer content types',
+ 'administer node fields',
+ 'administer comment fields',
+ 'administer comments',
+ 'administer comment types',
+ 'administer account settings',
+ ]);
$this->drupalLogin($admin_user);
}
@@ -59,7 +69,7 @@ class ContentTranslationSettingsTest extends BrowserTestBase {
public function testSettingsUI() {
// Check for the content_translation_menu_links_discovered_alter() changes.
$this->drupalGet('admin/config');
- $this->assertLink('Content language and translation');
+ $this->assertSession()->linkExists('Content language and translation');
$this->assertText('Configure language and translation support for content.');
// Test that the translation settings are ignored if the bundle is marked
// translatable but the entity type is not.
diff --git a/web/core/modules/content_translation/tests/src/Functional/ContentTranslationWorkflowsTest.php b/web/core/modules/content_translation/tests/src/Functional/ContentTranslationWorkflowsTest.php
index 168b6a59..05655f04 100644
--- a/web/core/modules/content_translation/tests/src/Functional/ContentTranslationWorkflowsTest.php
+++ b/web/core/modules/content_translation/tests/src/Functional/ContentTranslationWorkflowsTest.php
@@ -125,7 +125,11 @@ class ContentTranslationWorkflowsTest extends ContentTranslationTestBase {
$ops = ['create' => t('Add'), 'update' => t('Edit'), 'delete' => t('Delete')];
$translations_url = $this->entity->toUrl('drupal:content-translation-overview');
foreach ($ops as $current_op => $item) {
- $user = $this->drupalCreateUser([$this->getTranslatePermission(), "$current_op content translations", 'view test entity']);
+ $user = $this->drupalCreateUser([
+ $this->getTranslatePermission(),
+ "$current_op content translations",
+ 'view test entity',
+ ]);
$this->drupalLogin($user);
$this->drupalGet($translations_url);
@@ -138,10 +142,10 @@ class ContentTranslationWorkflowsTest extends ContentTranslationTestBase {
foreach ($ops as $op => $label) {
if ($op != $current_op) {
- $this->assertNoLink($label, new FormattableMarkup('No %op link found.', ['%op' => $label]));
+ $this->assertSession()->linkNotExists($label, new FormattableMarkup('No %op link found.', ['%op' => $label]));
}
else {
- $this->assertLink($label, 0, new FormattableMarkup('%op link found.', ['%op' => $label]));
+ $this->assertSession()->linkExists($label, 0, new FormattableMarkup('%op link found.', ['%op' => $label]));
}
}
}
diff --git a/web/core/modules/contextual/tests/src/Functional/ContextualDynamicContextTest.php b/web/core/modules/contextual/tests/src/Functional/ContextualDynamicContextTest.php
index a9e2af5a..10b61e5c 100644
--- a/web/core/modules/contextual/tests/src/Functional/ContextualDynamicContextTest.php
+++ b/web/core/modules/contextual/tests/src/Functional/ContextualDynamicContextTest.php
@@ -66,8 +66,15 @@ class ContextualDynamicContextTest extends BrowserTestBase {
ConfigurableLanguage::createFromLangcode('it')->save();
$this->rebuildContainer();
- $this->editorUser = $this->drupalCreateUser(['access content', 'access contextual links', 'edit any article content']);
- $this->authenticatedUser = $this->drupalCreateUser(['access content', 'access contextual links']);
+ $this->editorUser = $this->drupalCreateUser([
+ 'access content',
+ 'access contextual links',
+ 'edit any article content',
+ ]);
+ $this->authenticatedUser = $this->drupalCreateUser([
+ 'access content',
+ 'access contextual links',
+ ]);
$this->anonymousUser = $this->drupalCreateUser(['access content']);
}
diff --git a/web/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php b/web/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php
index 2c5ed0b3..b0dc9ee1 100644
--- a/web/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php
+++ b/web/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php
@@ -460,23 +460,23 @@ class DateTimeFieldTest extends DateTestBase {
$this->assertFieldByXPath("//*[@id=\"edit-$field_name-0-value-year\"]", NULL, 'Year element found.');
$this->assertOptionSelected("edit-$field_name-0-value-year", '', 'No year selected.');
- $this->assertOptionByText("edit-$field_name-0-value-year", t('Year'));
+ $this->assertSession()->optionExists("edit-$field_name-0-value-year", t('Year'));
$this->assertFieldByXPath("//*[@id=\"edit-$field_name-0-value-month\"]", NULL, 'Month element found.');
$this->assertOptionSelected("edit-$field_name-0-value-month", '', 'No month selected.');
- $this->assertOptionByText("edit-$field_name-0-value-month", t('Month'));
+ $this->assertSession()->optionExists("edit-$field_name-0-value-month", t('Month'));
$this->assertFieldByXPath("//*[@id=\"edit-$field_name-0-value-day\"]", NULL, 'Day element found.');
$this->assertOptionSelected("edit-$field_name-0-value-day", '', 'No day selected.');
- $this->assertOptionByText("edit-$field_name-0-value-day", t('Day'));
+ $this->assertSession()->optionExists("edit-$field_name-0-value-day", t('Day'));
$this->assertFieldByXPath("//*[@id=\"edit-$field_name-0-value-hour\"]", NULL, 'Hour element found.');
$this->assertOptionSelected("edit-$field_name-0-value-hour", '', 'No hour selected.');
- $this->assertOptionByText("edit-$field_name-0-value-hour", t('Hour'));
+ $this->assertSession()->optionExists("edit-$field_name-0-value-hour", t('Hour'));
$this->assertFieldByXPath("//*[@id=\"edit-$field_name-0-value-minute\"]", NULL, 'Minute element found.');
$this->assertOptionSelected("edit-$field_name-0-value-minute", '', 'No minute selected.');
- $this->assertOptionByText("edit-$field_name-0-value-minute", t('Minute'));
+ $this->assertSession()->optionExists("edit-$field_name-0-value-minute", t('Minute'));
$this->assertNoFieldByXPath("//*[@id=\"edit-$field_name-0-value-second\"]", NULL, 'Second element not found.');
$this->assertFieldByXPath("//*[@id=\"edit-$field_name-0-value-ampm\"]", NULL, 'AMPM element found.');
$this->assertOptionSelected("edit-$field_name-0-value-ampm", '', 'No ampm selected.');
- $this->assertOptionByText("edit-$field_name-0-value-ampm", t('AM/PM'));
+ $this->assertSession()->optionExists("edit-$field_name-0-value-ampm", t('AM/PM'));
// Submit a valid date and ensure it is accepted.
$date_value = ['year' => 2012, 'month' => 12, 'day' => 31, 'hour' => 5, 'minute' => 15];
diff --git a/web/core/modules/dblog/tests/src/Functional/DbLogTest.php b/web/core/modules/dblog/tests/src/Functional/DbLogTest.php
index fa54e14f..e83ef261 100644
--- a/web/core/modules/dblog/tests/src/Functional/DbLogTest.php
+++ b/web/core/modules/dblog/tests/src/Functional/DbLogTest.php
@@ -64,7 +64,12 @@ class DbLogTest extends BrowserTestBase {
$this->drupalPlaceBlock('page_title_block');
// Create users with specific permissions.
- $this->adminUser = $this->drupalCreateUser(['administer site configuration', 'access administration pages', 'access site reports', 'administer users']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'administer site configuration',
+ 'access administration pages',
+ 'access site reports',
+ 'administer users',
+ ]);
$this->webUser = $this->drupalCreateUser([]);
}
@@ -228,7 +233,7 @@ class DbLogTest extends BrowserTestBase {
// Verify location is available as plain text.
$this->assertEquals($request_uri, $this->cssSelect('table.dblog-event > tbody > tr:nth-child(4) > td')[0]->getHtml());
- $this->assertNoLink($request_uri);
+ $this->assertSession()->linkNotExists($request_uri);
}
/**
@@ -782,7 +787,7 @@ class DbLogTest extends BrowserTestBase {
*/
protected function assertLogMessage($log_message, $message) {
$message_text = Unicode::truncate(Html::decodeEntities(strip_tags($log_message)), 56, TRUE, TRUE);
- $this->assertLink($message_text, 0, $message);
+ $this->assertSession()->linkExists($message_text, 0, $message);
}
/**
diff --git a/web/core/modules/editor/tests/src/Functional/EditorLoadingTest.php b/web/core/modules/editor/tests/src/Functional/EditorLoadingTest.php
index 795d0dae..99454969 100644
--- a/web/core/modules/editor/tests/src/Functional/EditorLoadingTest.php
+++ b/web/core/modules/editor/tests/src/Functional/EditorLoadingTest.php
@@ -105,9 +105,23 @@ class EditorLoadingTest extends BrowserTestBase {
->save();
// Create 3 users, each with access to different text formats.
- $this->untrustedUser = $this->drupalCreateUser(['create article content', 'edit any article content']);
- $this->normalUser = $this->drupalCreateUser(['create article content', 'edit any article content', 'use text format filtered_html']);
- $this->privilegedUser = $this->drupalCreateUser(['create article content', 'edit any article content', 'create page content', 'edit any page content', 'use text format filtered_html', 'use text format full_html']);
+ $this->untrustedUser = $this->drupalCreateUser([
+ 'create article content',
+ 'edit any article content',
+ ]);
+ $this->normalUser = $this->drupalCreateUser([
+ 'create article content',
+ 'edit any article content',
+ 'use text format filtered_html',
+ ]);
+ $this->privilegedUser = $this->drupalCreateUser([
+ 'create article content',
+ 'edit any article content',
+ 'create page content',
+ 'edit any page content',
+ 'use text format filtered_html',
+ 'use text format full_html',
+ ]);
}
/**
diff --git a/web/core/modules/editor/tests/src/Functional/EditorUploadImageScaleTest.php b/web/core/modules/editor/tests/src/Functional/EditorUploadImageScaleTest.php
index b7a88d80..f917b95e 100644
--- a/web/core/modules/editor/tests/src/Functional/EditorUploadImageScaleTest.php
+++ b/web/core/modules/editor/tests/src/Functional/EditorUploadImageScaleTest.php
@@ -66,7 +66,10 @@ class EditorUploadImageScaleTest extends BrowserTestBase {
])->save();
// Create admin user.
- $this->adminUser = $this->drupalCreateUser(['administer filters', 'use text format basic_html']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'administer filters',
+ 'use text format basic_html',
+ ]);
$this->drupalLogin($this->adminUser);
}
diff --git a/web/core/modules/field/field.api.php b/web/core/modules/field/field.api.php
index 36e5fcef..557ff580 100644
--- a/web/core/modules/field/field.api.php
+++ b/web/core/modules/field/field.api.php
@@ -17,8 +17,8 @@
*
* In the Field API, each field has a type, which determines what kind of data
* (integer, string, date, etc.) the field can hold, which settings it provides,
- * and so on. The data type(s) accepted by a field are defined in
- * hook_field_schema().
+ * and so on. The data type(s) accepted by a field are defined in the class
+ * implementing \Drupal\Core\Field\FieldItemInterface::schema() method.
*
* Field types are plugins annotated with class
* \Drupal\Core\Field\Annotation\FieldType, and implement plugin interface
diff --git a/web/core/modules/field/src/Entity/FieldStorageConfig.php b/web/core/modules/field/src/Entity/FieldStorageConfig.php
index fcfa7caf..1209fffb 100644
--- a/web/core/modules/field/src/Entity/FieldStorageConfig.php
+++ b/web/core/modules/field/src/Entity/FieldStorageConfig.php
@@ -175,12 +175,14 @@ class FieldStorageConfig extends ConfigEntityBase implements FieldStorageConfigI
* The custom storage indexes for the field data storage.
*
* This set of indexes is merged with the "default" indexes specified by the
- * field type in hook_field_schema() to determine the actual set of indexes
- * that get created.
+ * field type in the class implementing
+ * \Drupal\Core\Field\FieldItemInterface::schema() method to determine the
+ * actual set of indexes that get created.
*
* The indexes are defined using the same definition format as Schema API
* index specifications. Only columns that are part of the field schema, as
- * defined by the field type in hook_field_schema(), are allowed.
+ * defined by the field type in the class implementing
+ * \Drupal\Core\Field\FieldItemInterface::schema() method, are allowed.
*
* Some storage backends might not support indexes, and discard that
* information.
diff --git a/web/core/modules/field/src/Tests/FieldTestBase.php b/web/core/modules/field/src/Tests/FieldTestBase.php
index ebd679c9..cf487d49 100644
--- a/web/core/modules/field/src/Tests/FieldTestBase.php
+++ b/web/core/modules/field/src/Tests/FieldTestBase.php
@@ -24,6 +24,7 @@ abstract class FieldTestBase extends WebTestBase {
*
* @param $cardinality
* Number of values to generate.
+ *
* @return
* An array of random values, in the format expected for field values.
*/
diff --git a/web/core/modules/field/tests/modules/field_test/field_test.module b/web/core/modules/field/tests/modules/field_test/field_test.module
index 585fa35c..7804a7ab 100644
--- a/web/core/modules/field/tests/modules/field_test/field_test.module
+++ b/web/core/modules/field/tests/modules/field_test/field_test.module
@@ -58,6 +58,7 @@ require_once __DIR__ . '/field_test.field.inc';
* The key under which to store to $value, or NULL as described above.
* @param $value
* A value to store for $key.
+ *
* @return
* An array mapping each $key to an array of each $value passed in
* for that key.
diff --git a/web/core/modules/field/tests/src/Functional/Boolean/BooleanFormatterSettingsTest.php b/web/core/modules/field/tests/src/Functional/Boolean/BooleanFormatterSettingsTest.php
index 85ed22c8..614ca02b 100644
--- a/web/core/modules/field/tests/src/Functional/Boolean/BooleanFormatterSettingsTest.php
+++ b/web/core/modules/field/tests/src/Functional/Boolean/BooleanFormatterSettingsTest.php
@@ -50,7 +50,14 @@ class BooleanFormatterSettingsTest extends BrowserTestBase {
$type = $this->drupalCreateContentType(['name' => $type_name, 'type' => $type_name]);
$this->bundle = $type->id();
- $admin_user = $this->drupalCreateUser(['access content', 'administer content types', 'administer node fields', 'administer node display', 'bypass node access', 'administer nodes']);
+ $admin_user = $this->drupalCreateUser([
+ 'access content',
+ 'administer content types',
+ 'administer node fields',
+ 'administer node display',
+ 'bypass node access',
+ 'administer nodes',
+ ]);
$this->drupalLogin($admin_user);
$this->fieldName = mb_strtolower($this->randomMachineName(8));
diff --git a/web/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAdminTest.php b/web/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAdminTest.php
index fe09077b..086e2452 100644
--- a/web/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAdminTest.php
+++ b/web/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAdminTest.php
@@ -192,7 +192,7 @@ class EntityReferenceAdminTest extends BrowserTestBase {
'field_test_entity_ref_field[0][target_id]' => $node1->getTitle() . ' (' . $node1->id() . ')',
];
$this->drupalPostForm('node/add/' . $this->type, $edit, t('Save'));
- $this->assertLink($node1->getTitle());
+ $this->assertSession()->linkExists($node1->getTitle());
// Tests adding default values to autocomplete widgets.
Vocabulary::create(['vid' => 'tags', 'name' => 'tags'])->save();
diff --git a/web/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAutoCreateTest.php b/web/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAutoCreateTest.php
index 83177538..21470428 100644
--- a/web/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAutoCreateTest.php
+++ b/web/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAutoCreateTest.php
@@ -92,7 +92,10 @@ class EntityReferenceAutoCreateTest extends BrowserTestBase {
])
->save();
- $account = $this->drupalCreateUser(['access content', "create $this->referencingType content"]);
+ $account = $this->drupalCreateUser([
+ 'access content',
+ "create $this->referencingType content",
+ ]);
$this->drupalLogin($account);
}
diff --git a/web/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldDefaultValueTest.php b/web/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldDefaultValueTest.php
index f4329f47..9be56377 100644
--- a/web/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldDefaultValueTest.php
+++ b/web/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldDefaultValueTest.php
@@ -44,7 +44,13 @@ class EntityReferenceFieldDefaultValueTest extends BrowserTestBase {
$this->drupalCreateContentType(['type' => 'referenced_content']);
// Create admin user.
- $this->adminUser = $this->drupalCreateUser(['access content', 'administer content types', 'administer node fields', 'administer node form display', 'bypass node access']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'access content',
+ 'administer content types',
+ 'administer node fields',
+ 'administer node form display',
+ 'bypass node access',
+ ]);
$this->drupalLogin($this->adminUser);
}
diff --git a/web/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php b/web/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php
index 79ba2717..5e0c7912 100644
--- a/web/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php
+++ b/web/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php
@@ -147,7 +147,9 @@ class EntityReferenceFieldTranslatedReferenceViewTest extends BrowserTestBase {
$this->setUpEntityReferenceField();
$this->createContent();
- $this->webUser = $this->drupalCreateUser(['edit any ' . $this->referrerType->id() . ' content']);
+ $this->webUser = $this->drupalCreateUser([
+ 'edit any ' . $this->referrerType->id() . ' content',
+ ]);
}
/**
diff --git a/web/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFileUploadTest.php b/web/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFileUploadTest.php
index d2012e16..92d69045 100644
--- a/web/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFileUploadTest.php
+++ b/web/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFileUploadTest.php
@@ -121,7 +121,10 @@ class EntityReferenceFileUploadTest extends BrowserTestBase {
* Tests that the autocomplete input element does not cause ajax fatal.
*/
public function testFileUpload() {
- $user1 = $this->drupalCreateUser(['access content', "create $this->referencingType content"]);
+ $user1 = $this->drupalCreateUser([
+ 'access content',
+ "create $this->referencingType content",
+ ]);
$this->drupalLogin($user1);
$test_file = current($this->getTestFiles('text'));
diff --git a/web/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceIntegrationTest.php b/web/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceIntegrationTest.php
index cc131227..36d9358d 100644
--- a/web/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceIntegrationTest.php
+++ b/web/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceIntegrationTest.php
@@ -59,7 +59,11 @@ class EntityReferenceIntegrationTest extends BrowserTestBase {
parent::setUp();
// Create a test user.
- $web_user = $this->drupalCreateUser(['administer entity_test content', 'administer entity_test fields', 'view test entity']);
+ $web_user = $this->drupalCreateUser([
+ 'administer entity_test content',
+ 'administer entity_test fields',
+ 'view test entity',
+ ]);
$this->drupalLogin($web_user);
}
diff --git a/web/core/modules/field/tests/src/Functional/FieldHelpTest.php b/web/core/modules/field/tests/src/Functional/FieldHelpTest.php
index d0c2bb77..54d9d72f 100644
--- a/web/core/modules/field/tests/src/Functional/FieldHelpTest.php
+++ b/web/core/modules/field/tests/src/Functional/FieldHelpTest.php
@@ -35,7 +35,10 @@ class FieldHelpTest extends BrowserTestBase {
parent::setUp();
// Create the admin user.
- $this->adminUser = $this->drupalCreateUser(['access administration pages', 'view the administration theme']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'access administration pages',
+ 'view the administration theme',
+ ]);
}
/**
@@ -55,10 +58,10 @@ class FieldHelpTest extends BrowserTestBase {
\Drupal::service('plugin.manager.field.field_type')->clearCachedDefinitions();
$this->drupalGet('admin/help/field');
- $this->assertLink('Options', 0, 'Options module is listed on the Field help page.');
+ $this->assertSession()->linkExists('Options', 0, 'Options module is listed on the Field help page.');
$this->assertText('Field API Test', 'Modules with field types that do not implement hook_help are listed.');
- $this->assertNoLink('Field API Test', 'Modules with field types that do not implement hook_help are not linked.');
- $this->assertNoLink('Link', 'Modules that have not been installed, are not listed.');
+ $this->assertSession()->linkNotExists('Field API Test', 'Modules with field types that do not implement hook_help are not linked.');
+ $this->assertSession()->linkNotExists('Link', 'Modules that have not been installed, are not listed.');
}
}
diff --git a/web/core/modules/field/tests/src/Functional/FieldTestBase.php b/web/core/modules/field/tests/src/Functional/FieldTestBase.php
index db20aa2f..2de6ac1c 100644
--- a/web/core/modules/field/tests/src/Functional/FieldTestBase.php
+++ b/web/core/modules/field/tests/src/Functional/FieldTestBase.php
@@ -17,6 +17,7 @@ abstract class FieldTestBase extends BrowserTestBase {
*
* @param $cardinality
* Number of values to generate.
+ *
* @return
* An array of random values, in the format expected for field values.
*/
diff --git a/web/core/modules/field/tests/src/Functional/FormTest.php b/web/core/modules/field/tests/src/Functional/FormTest.php
index dd475dbe..48613f13 100644
--- a/web/core/modules/field/tests/src/Functional/FormTest.php
+++ b/web/core/modules/field/tests/src/Functional/FormTest.php
@@ -69,7 +69,10 @@ class FormTest extends FieldTestBase {
protected function setUp() {
parent::setUp();
- $web_user = $this->drupalCreateUser(['view test entity', 'administer entity_test content']);
+ $web_user = $this->drupalCreateUser([
+ 'view test entity',
+ 'administer entity_test content',
+ ]);
$this->drupalLogin($web_user);
$this->fieldStorageSingle = [
diff --git a/web/core/modules/field/tests/src/Functional/NestedFormTest.php b/web/core/modules/field/tests/src/Functional/NestedFormTest.php
index 78be016d..772d2abc 100644
--- a/web/core/modules/field/tests/src/Functional/NestedFormTest.php
+++ b/web/core/modules/field/tests/src/Functional/NestedFormTest.php
@@ -28,7 +28,10 @@ class NestedFormTest extends FieldTestBase {
protected function setUp() {
parent::setUp();
- $web_user = $this->drupalCreateUser(['view test entity', 'administer entity_test content']);
+ $web_user = $this->drupalCreateUser([
+ 'view test entity',
+ 'administer entity_test content',
+ ]);
$this->drupalLogin($web_user);
$this->fieldStorageSingle = [
diff --git a/web/core/modules/field/tests/src/Functional/ReEnableModuleFieldTest.php b/web/core/modules/field/tests/src/Functional/ReEnableModuleFieldTest.php
index ac14ccc2..1b2ad0a7 100644
--- a/web/core/modules/field/tests/src/Functional/ReEnableModuleFieldTest.php
+++ b/web/core/modules/field/tests/src/Functional/ReEnableModuleFieldTest.php
@@ -96,7 +96,10 @@ class ReEnableModuleFieldTest extends BrowserTestBase {
// Test that the module can't be uninstalled from the UI while there is data
// for its fields.
- $admin_user = $this->drupalCreateUser(['access administration pages', 'administer modules']);
+ $admin_user = $this->drupalCreateUser([
+ 'access administration pages',
+ 'administer modules',
+ ]);
$this->drupalLogin($admin_user);
$this->drupalGet('admin/modules/uninstall');
$this->assertText("The Telephone number field type is used in the following field: node.field_telephone");
diff --git a/web/core/modules/field/tests/src/Functional/String/StringFieldTest.php b/web/core/modules/field/tests/src/Functional/String/StringFieldTest.php
index 9be6e01b..2d619488 100644
--- a/web/core/modules/field/tests/src/Functional/String/StringFieldTest.php
+++ b/web/core/modules/field/tests/src/Functional/String/StringFieldTest.php
@@ -37,7 +37,11 @@ class StringFieldTest extends BrowserTestBase {
protected function setUp() {
parent::setUp();
- $this->webUser = $this->drupalCreateUser(['view test entity', 'administer entity_test content', 'access content']);
+ $this->webUser = $this->drupalCreateUser([
+ 'view test entity',
+ 'administer entity_test content',
+ 'access content',
+ ]);
$this->drupalLogin($this->webUser);
}
diff --git a/web/core/modules/field/tests/src/Functional/TranslationWebTest.php b/web/core/modules/field/tests/src/Functional/TranslationWebTest.php
index d15692e1..a65bf440 100644
--- a/web/core/modules/field/tests/src/Functional/TranslationWebTest.php
+++ b/web/core/modules/field/tests/src/Functional/TranslationWebTest.php
@@ -92,7 +92,10 @@ class TranslationWebTest extends FieldTestBase {
* Tests field translations when creating a new revision.
*/
public function testFieldFormTranslationRevisions() {
- $web_user = $this->drupalCreateUser(['view test entity', 'administer entity_test content']);
+ $web_user = $this->drupalCreateUser([
+ 'view test entity',
+ 'administer entity_test content',
+ ]);
$this->drupalLogin($web_user);
// Prepare the field translations.
diff --git a/web/core/modules/field/tests/src/Kernel/FieldKernelTestBase.php b/web/core/modules/field/tests/src/Kernel/FieldKernelTestBase.php
index c20ee818..b42fa3b6 100644
--- a/web/core/modules/field/tests/src/Kernel/FieldKernelTestBase.php
+++ b/web/core/modules/field/tests/src/Kernel/FieldKernelTestBase.php
@@ -163,6 +163,7 @@ abstract class FieldKernelTestBase extends KernelTestBase {
*
* @param $cardinality
* Number of values to generate.
+ *
* @return
* An array of random values, in the format expected for field values.
*/
diff --git a/web/core/modules/field_ui/tests/src/Functional/EntityDisplayModeTest.php b/web/core/modules/field_ui/tests/src/Functional/EntityDisplayModeTest.php
index 72751d3b..9e2ba1dc 100644
--- a/web/core/modules/field_ui/tests/src/Functional/EntityDisplayModeTest.php
+++ b/web/core/modules/field_ui/tests/src/Functional/EntityDisplayModeTest.php
@@ -60,7 +60,7 @@ class EntityDisplayModeTest extends BrowserTestBase {
$this->assertSession()->statusCodeEquals(404);
$this->drupalGet('admin/structure/display-modes/view/add');
- $this->assertNoLink(t('Test entity - revisions and data table'), 'An entity type with no view builder cannot have view modes.');
+ $this->assertSession()->linkNotExists(t('Test entity - revisions and data table'), 'An entity type with no view builder cannot have view modes.');
// Test adding a view mode including dots in machine_name.
$this->clickLink(t('Test entity'));
@@ -114,7 +114,7 @@ class EntityDisplayModeTest extends BrowserTestBase {
$this->assertSession()->statusCodeEquals(404);
$this->drupalGet('admin/structure/display-modes/form/add');
- $this->assertNoLink(t('Entity Test without label'), 'An entity type with no form cannot have form modes.');
+ $this->assertSession()->linkNotExists(t('Entity Test without label'), 'An entity type with no form cannot have form modes.');
// Test adding a view mode including dots in machine_name.
$this->clickLink(t('Test entity'));
diff --git a/web/core/modules/field_ui/tests/src/Functional/FieldUIDeleteTest.php b/web/core/modules/field_ui/tests/src/Functional/FieldUIDeleteTest.php
index 742b2796..62146c73 100644
--- a/web/core/modules/field_ui/tests/src/Functional/FieldUIDeleteTest.php
+++ b/web/core/modules/field_ui/tests/src/Functional/FieldUIDeleteTest.php
@@ -54,7 +54,17 @@ class FieldUIDeleteTest extends BrowserTestBase {
$this->drupalPlaceBlock('page_title_block');
// Create a test user.
- $admin_user = $this->drupalCreateUser(['access content', 'administer content types', 'administer node fields', 'administer node form display', 'administer node display', 'administer users', 'administer account settings', 'administer user display', 'bypass node access']);
+ $admin_user = $this->drupalCreateUser([
+ 'access content',
+ 'administer content types',
+ 'administer node fields',
+ 'administer node form display',
+ 'administer node display',
+ 'administer users',
+ 'administer account settings',
+ 'administer user display',
+ 'bypass node access',
+ ]);
$this->drupalLogin($admin_user);
}
diff --git a/web/core/modules/field_ui/tests/src/Functional/FieldUIIndentationTest.php b/web/core/modules/field_ui/tests/src/Functional/FieldUIIndentationTest.php
index 0eeff4bc..26417e8c 100644
--- a/web/core/modules/field_ui/tests/src/Functional/FieldUIIndentationTest.php
+++ b/web/core/modules/field_ui/tests/src/Functional/FieldUIIndentationTest.php
@@ -30,7 +30,11 @@ class FieldUIIndentationTest extends BrowserTestBase {
parent::setUp();
// Create a test user.
- $admin_user = $this->drupalCreateUser(['access content', 'administer content types', 'administer node display']);
+ $admin_user = $this->drupalCreateUser([
+ 'access content',
+ 'administer content types',
+ 'administer node display',
+ ]);
$this->drupalLogin($admin_user);
// Create Basic page node type.
diff --git a/web/core/modules/field_ui/tests/src/Functional/FieldUIRouteTest.php b/web/core/modules/field_ui/tests/src/Functional/FieldUIRouteTest.php
index ab5a0ba3..ab57c994 100644
--- a/web/core/modules/field_ui/tests/src/Functional/FieldUIRouteTest.php
+++ b/web/core/modules/field_ui/tests/src/Functional/FieldUIRouteTest.php
@@ -87,7 +87,7 @@ class FieldUIRouteTest extends BrowserTestBase {
$edit = ['display_modes_custom[test]' => TRUE];
$this->drupalPostForm('admin/config/people/accounts/display', $edit, t('Save'));
- $this->assertLink('Test');
+ $this->assertSession()->linkExists('Test');
// Create new form mode and verify it's available on the Manage Form
// Display screen after enabling it.
@@ -100,17 +100,17 @@ class FieldUIRouteTest extends BrowserTestBase {
$edit = ['display_modes_custom[test]' => TRUE];
$this->drupalPostForm('admin/config/people/accounts/form-display', $edit, t('Save'));
- $this->assertLink('Test');
+ $this->assertSession()->linkExists('Test');
}
/**
* Asserts that local tasks exists.
*/
public function assertLocalTasks() {
- $this->assertLink('Settings');
- $this->assertLink('Manage fields');
- $this->assertLink('Manage display');
- $this->assertLink('Manage form display');
+ $this->assertSession()->linkExists('Settings');
+ $this->assertSession()->linkExists('Manage fields');
+ $this->assertSession()->linkExists('Manage display');
+ $this->assertSession()->linkExists('Manage form display');
}
/**
diff --git a/web/core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php b/web/core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php
index d1db9a2f..b61ea706 100644
--- a/web/core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php
+++ b/web/core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php
@@ -49,7 +49,20 @@ class ManageDisplayTest extends BrowserTestBase {
$this->drupalPlaceBlock('local_tasks_block');
// Create a test user.
- $admin_user = $this->drupalCreateUser(['access content', 'administer content types', 'administer node fields', 'administer node form display', 'administer node display', 'administer taxonomy', 'administer taxonomy_term fields', 'administer taxonomy_term display', 'administer users', 'administer account settings', 'administer user display', 'bypass node access']);
+ $admin_user = $this->drupalCreateUser([
+ 'access content',
+ 'administer content types',
+ 'administer node fields',
+ 'administer node form display',
+ 'administer node display',
+ 'administer taxonomy',
+ 'administer taxonomy_term fields',
+ 'administer taxonomy_term display',
+ 'administer users',
+ 'administer account settings',
+ 'administer user display',
+ 'bypass node access',
+ ]);
$this->drupalLogin($admin_user);
// Create content type, with underscores.
@@ -149,12 +162,12 @@ class ManageDisplayTest extends BrowserTestBase {
public function testViewModeLocalTasks() {
$manage_display = 'admin/structure/types/manage/' . $this->type . '/display';
$this->drupalGet($manage_display);
- $this->assertNoLink('Full content');
- $this->assertLink('Teaser');
+ $this->assertSession()->linkNotExists('Full content');
+ $this->assertSession()->linkExists('Teaser');
$this->drupalGet($manage_display . '/teaser');
- $this->assertNoLink('Full content');
- $this->assertLink('Default');
+ $this->assertSession()->linkNotExists('Full content');
+ $this->assertSession()->linkExists('Default');
}
/**
@@ -225,6 +238,7 @@ class ManageDisplayTest extends BrowserTestBase {
* Plain text to look for.
* @param $message
* Message to display.
+ *
* @return
* TRUE on pass, FALSE on fail.
*/
diff --git a/web/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php b/web/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php
index db6634dd..de67f752 100644
--- a/web/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php
+++ b/web/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php
@@ -81,7 +81,20 @@ class ManageFieldsFunctionalTest extends BrowserTestBase {
$this->drupalPlaceBlock('page_title_block');
// Create a test user.
- $admin_user = $this->drupalCreateUser(['access content', 'administer content types', 'administer node fields', 'administer node form display', 'administer node display', 'administer taxonomy', 'administer taxonomy_term fields', 'administer taxonomy_term display', 'administer users', 'administer account settings', 'administer user display', 'bypass node access']);
+ $admin_user = $this->drupalCreateUser([
+ 'access content',
+ 'administer content types',
+ 'administer node fields',
+ 'administer node form display',
+ 'administer node display',
+ 'administer taxonomy',
+ 'administer taxonomy_term fields',
+ 'administer taxonomy_term display',
+ 'administer users',
+ 'administer account settings',
+ 'administer user display',
+ 'bypass node access',
+ ]);
$this->drupalLogin($admin_user);
// Create content type, with underscores.
@@ -158,7 +171,7 @@ class ManageFieldsFunctionalTest extends BrowserTestBase {
}
// Test the "Add field" action link.
- $this->assertLink('Add field');
+ $this->assertSession()->linkExists('Add field');
// Assert entity operations for all fields.
$number_of_links = 3;
@@ -278,9 +291,9 @@ class ManageFieldsFunctionalTest extends BrowserTestBase {
$this->assertFieldByXPath("//input[@name='cardinality_number']", 6);
// Check that tabs displayed.
- $this->assertLink(t('Edit'));
+ $this->assertSession()->linkExists(t('Edit'));
$this->assertLinkByHref('admin/structure/types/manage/article/fields/node.article.body');
- $this->assertLink(t('Field settings'));
+ $this->assertSession()->linkExists(t('Field settings'));
$this->assertLinkByHref($field_edit_path);
// Add two entries in the body.
diff --git a/web/core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php b/web/core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php
index a55d993b..56f175de 100644
--- a/web/core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php
+++ b/web/core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php
@@ -51,7 +51,17 @@ class ManageDisplayTest extends WebDriverTestBase {
$this->drupalPlaceBlock('system_breadcrumb_block');
// Create a test user.
- $admin_user = $this->drupalCreateUser(['access content', 'administer content types', 'administer node fields', 'administer node form display', 'administer node display', 'administer users', 'administer account settings', 'administer user display', 'bypass node access']);
+ $admin_user = $this->drupalCreateUser([
+ 'access content',
+ 'administer content types',
+ 'administer node fields',
+ 'administer node form display',
+ 'administer node display',
+ 'administer users',
+ 'administer account settings',
+ 'administer user display',
+ 'bypass node access',
+ ]);
$this->drupalLogin($admin_user);
// Create content type, with underscores.
diff --git a/web/core/modules/field_ui/tests/src/Traits/FieldUiTestTrait.php b/web/core/modules/field_ui/tests/src/Traits/FieldUiTestTrait.php
index de125d18..e5554cbd 100644
--- a/web/core/modules/field_ui/tests/src/Traits/FieldUiTestTrait.php
+++ b/web/core/modules/field_ui/tests/src/Traits/FieldUiTestTrait.php
@@ -47,7 +47,7 @@ trait FieldUiTestTrait {
$this->drupalPostForm($bundle_path, $initial_edit, t('Save and continue'));
$this->assertRaw(t('These settings apply to the %label field everywhere it is used.', ['%label' => $label]), 'Storage settings page was displayed.');
// Test Breadcrumbs.
- $this->assertLink($label, 0, 'Field label is correct in the breadcrumb of the storage settings page.');
+ $this->assertSession()->linkExists($label, 0, 'Field label is correct in the breadcrumb of the storage settings page.');
// Second step: 'Storage settings' form.
$this->drupalPostForm(NULL, $storage_edit, t('Save field settings'));
@@ -115,7 +115,7 @@ trait FieldUiTestTrait {
$this->assertRaw(t('Are you sure you want to delete the field %label', ['%label' => $label]), 'Delete confirmation was found.');
// Test Breadcrumbs.
- $this->assertLink($label, 0, 'Field label is correct in the breadcrumb of the field delete page.');
+ $this->assertSession()->linkExists($label, 0, 'Field label is correct in the breadcrumb of the field delete page.');
// Submit confirmation form.
$this->drupalPostForm(NULL, [], t('Delete'));
diff --git a/web/core/modules/file/file.api.php b/web/core/modules/file/file.api.php
index 1fda717d..7ba8f604 100644
--- a/web/core/modules/file/file.api.php
+++ b/web/core/modules/file/file.api.php
@@ -18,6 +18,7 @@
*
* @param \Drupal\file\FileInterface $file
* The file entity being validated.
+ *
* @return array
* An array of error messages. If there are no problems with the file return
* an empty array.
diff --git a/web/core/modules/file/src/Tests/FileManagedTestBase.php b/web/core/modules/file/src/Tests/FileManagedTestBase.php
index 685877c0..c86c9e7b 100644
--- a/web/core/modules/file/src/Tests/FileManagedTestBase.php
+++ b/web/core/modules/file/src/Tests/FileManagedTestBase.php
@@ -148,6 +148,7 @@ abstract class FileManagedTestBase extends WebTestBase {
* @param string $scheme
* Optional string indicating the stream scheme to use. Drupal core includes
* public, private, and temporary. The public wrapper is the default.
+ *
* @return \Drupal\file\FileInterface
* File entity.
*/
diff --git a/web/core/modules/file/tests/src/Functional/FileFieldRSSContentTest.php b/web/core/modules/file/tests/src/Functional/FileFieldRSSContentTest.php
index 73f94047..0eaf79d5 100644
--- a/web/core/modules/file/tests/src/Functional/FileFieldRSSContentTest.php
+++ b/web/core/modules/file/tests/src/Functional/FileFieldRSSContentTest.php
@@ -63,14 +63,13 @@ class FileFieldRSSContentTest extends FileFieldTestBase {
// Check that the RSS enclosure appears in the RSS feed.
$this->drupalGet('rss.xml');
- $uploaded_filename = str_replace('public://', '', $node_file->getFileUri());
$selector = sprintf(
- 'enclosure[@url="%s"][@length="%s"][@type="%s"]',
- file_create_url("public://$uploaded_filename", ['absolute' => TRUE]),
+ '//enclosure[@url="%s" and @length="%s" and @type="%s"]',
+ file_create_url($node_file->getFileUri()),
$node_file->getSize(),
$node_file->getMimeType()
);
- $this->assertNotNull($this->getSession()->getDriver()->find('xpath', $selector), 'File field RSS enclosure is displayed when viewing the RSS feed.');
+ $this->assertNotEmpty($this->getSession()->getDriver()->find($selector), 'File field RSS enclosure is displayed when viewing the RSS feed.');
}
}
diff --git a/web/core/modules/file/tests/src/Functional/FileFieldTestBase.php b/web/core/modules/file/tests/src/Functional/FileFieldTestBase.php
index 05f084ee..62962902 100644
--- a/web/core/modules/file/tests/src/Functional/FileFieldTestBase.php
+++ b/web/core/modules/file/tests/src/Functional/FileFieldTestBase.php
@@ -46,7 +46,18 @@ abstract class FileFieldTestBase extends BrowserTestBase {
*/
protected function setUp() {
parent::setUp();
- $this->adminUser = $this->drupalCreateUser(['access content', 'access administration pages', 'administer site configuration', 'administer users', 'administer permissions', 'administer content types', 'administer node fields', 'administer node display', 'administer nodes', 'bypass node access']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'access content',
+ 'access administration pages',
+ 'administer site configuration',
+ 'administer users',
+ 'administer permissions',
+ 'administer content types',
+ 'administer node fields',
+ 'administer node display',
+ 'administer nodes',
+ 'bypass node access',
+ ]);
$this->drupalLogin($this->adminUser);
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
}
diff --git a/web/core/modules/file/tests/src/Functional/FileListingTest.php b/web/core/modules/file/tests/src/Functional/FileListingTest.php
index 95ac9aed..44107209 100644
--- a/web/core/modules/file/tests/src/Functional/FileListingTest.php
+++ b/web/core/modules/file/tests/src/Functional/FileListingTest.php
@@ -40,7 +40,10 @@ class FileListingTest extends FileFieldTestBase {
->set('make_unused_managed_files_temporary', TRUE)
->save();
- $this->adminUser = $this->drupalCreateUser(['access files overview', 'bypass node access']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'access files overview',
+ 'bypass node access',
+ ]);
$this->baseUser = $this->drupalCreateUser();
$this->createFileField('file', 'node', 'article', [], ['file_extensions' => 'txt png']);
}
@@ -50,6 +53,7 @@ class FileListingTest extends FileFieldTestBase {
*
* @param $usage array
* Array of file usage information as returned from file_usage subsystem.
+ *
* @return int
* Total usage count.
*/
@@ -201,8 +205,8 @@ class FileListingTest extends FileFieldTestBase {
// Entity name should be displayed, but not linked if Entity::toUrl
// throws an exception
$this->assertText($entity_name, 'Entity name is added to file usage listing.');
- $this->assertNoLink($entity_name, 'Linked entity name not added to file usage listing.');
- $this->assertLink($node->getTitle());
+ $this->assertSession()->linkNotExists($entity_name, 'Linked entity name not added to file usage listing.');
+ $this->assertSession()->linkExists($node->getTitle());
}
/**
diff --git a/web/core/modules/file/tests/src/Functional/FileManagedFileElementTest.php b/web/core/modules/file/tests/src/Functional/FileManagedFileElementTest.php
index 348cee7d..3f67a794 100644
--- a/web/core/modules/file/tests/src/Functional/FileManagedFileElementTest.php
+++ b/web/core/modules/file/tests/src/Functional/FileManagedFileElementTest.php
@@ -50,7 +50,7 @@ class FileManagedFileElementTest extends FileFieldTestBase {
$file_field_name => \Drupal::service('file_system')->realpath($test_file->getFileUri()),
];
$this->drupalPostForm(NULL, $edit, t('Save'));
- $this->assertText('The form has become outdated. Copy any unsaved work in the form below');
+ $this->assertText('The form has become outdated.');
$last_fid = $this->getLastFileId();
$this->assertEqual($last_fid_prior, $last_fid, 'File was not saved when uploaded with an invalid form token.');
diff --git a/web/core/modules/file/tests/src/Functional/FileManagedTestBase.php b/web/core/modules/file/tests/src/Functional/FileManagedTestBase.php
index 2a4465d8..1538e4c5 100644
--- a/web/core/modules/file/tests/src/Functional/FileManagedTestBase.php
+++ b/web/core/modules/file/tests/src/Functional/FileManagedTestBase.php
@@ -143,6 +143,7 @@ abstract class FileManagedTestBase extends BrowserTestBase {
* @param string $scheme
* Optional string indicating the stream scheme to use. Drupal core includes
* public, private, and temporary. The public wrapper is the default.
+ *
* @return \Drupal\file\FileInterface
* File entity.
*/
diff --git a/web/core/modules/file/tests/src/FunctionalJavascript/FileFieldWidgetTest.php b/web/core/modules/file/tests/src/FunctionalJavascript/FileFieldWidgetTest.php
index c563337d..54c44753 100644
--- a/web/core/modules/file/tests/src/FunctionalJavascript/FileFieldWidgetTest.php
+++ b/web/core/modules/file/tests/src/FunctionalJavascript/FileFieldWidgetTest.php
@@ -42,7 +42,18 @@ class FileFieldWidgetTest extends WebDriverTestBase {
*/
protected function setUp() {
parent::setUp();
- $this->adminUser = $this->drupalCreateUser(['access content', 'access administration pages', 'administer site configuration', 'administer users', 'administer permissions', 'administer content types', 'administer node fields', 'administer node display', 'administer nodes', 'bypass node access']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'access content',
+ 'access administration pages',
+ 'administer site configuration',
+ 'administer users',
+ 'administer permissions',
+ 'administer content types',
+ 'administer node fields',
+ 'administer node display',
+ 'administer nodes',
+ 'bypass node access',
+ ]);
$this->drupalLogin($this->adminUser);
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
}
diff --git a/web/core/modules/file/tests/src/FunctionalJavascript/FileManagedFileElementTest.php b/web/core/modules/file/tests/src/FunctionalJavascript/FileManagedFileElementTest.php
index a4f2c0ca..625878ad 100644
--- a/web/core/modules/file/tests/src/FunctionalJavascript/FileManagedFileElementTest.php
+++ b/web/core/modules/file/tests/src/FunctionalJavascript/FileManagedFileElementTest.php
@@ -33,7 +33,18 @@ class FileManagedFileElementTest extends WebDriverTestBase {
*/
protected function setUp() {
parent::setUp();
- $this->adminUser = $this->drupalCreateUser(['access content', 'access administration pages', 'administer site configuration', 'administer users', 'administer permissions', 'administer content types', 'administer node fields', 'administer node display', 'administer nodes', 'bypass node access']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'access content',
+ 'access administration pages',
+ 'administer site configuration',
+ 'administer users',
+ 'administer permissions',
+ 'administer content types',
+ 'administer node fields',
+ 'administer node display',
+ 'administer nodes',
+ 'bypass node access',
+ ]);
$this->drupalLogin($this->adminUser);
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
}
diff --git a/web/core/modules/file/tests/src/Kernel/FileManagedUnitTestBase.php b/web/core/modules/file/tests/src/Kernel/FileManagedUnitTestBase.php
index aa336f1e..715d96b9 100644
--- a/web/core/modules/file/tests/src/Kernel/FileManagedUnitTestBase.php
+++ b/web/core/modules/file/tests/src/Kernel/FileManagedUnitTestBase.php
@@ -156,6 +156,7 @@ abstract class FileManagedUnitTestBase extends KernelTestBase {
* @param string $scheme
* Optional string indicating the stream scheme to use. Drupal core includes
* public, private, and temporary. The public wrapper is the default.
+ *
* @return \Drupal\file\FileInterface
* File entity.
*/
diff --git a/web/core/modules/filter/tests/src/Functional/FilterAdminTest.php b/web/core/modules/filter/tests/src/Functional/FilterAdminTest.php
index ea18cffa..14a3c35c 100644
--- a/web/core/modules/filter/tests/src/Functional/FilterAdminTest.php
+++ b/web/core/modules/filter/tests/src/Functional/FilterAdminTest.php
@@ -111,7 +111,10 @@ class FilterAdminTest extends BrowserTestBase {
'access site reports',
]);
- $this->webUser = $this->drupalCreateUser(['create page content', 'edit own page content']);
+ $this->webUser = $this->drupalCreateUser([
+ 'create page content',
+ 'edit own page content',
+ ]);
user_role_grant_permissions('authenticated', [$basic_html_format->getPermissionName()]);
user_role_grant_permissions('anonymous', [$restricted_html_format->getPermissionName()]);
$this->drupalLogin($this->adminUser);
@@ -320,7 +323,7 @@ class FilterAdminTest extends BrowserTestBase {
$edit['body[0][format]'] = $plain;
$this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
$this->drupalGet('node/' . $node->id());
- $this->assertEscaped($text, 'The "Plain text" text format escapes all HTML tags.');
+ $this->assertEscaped($text);
$this->config('filter.settings')
->set('always_show_fallback_choice', FALSE)
->save();
diff --git a/web/core/modules/filter/tests/src/Functional/FilterDefaultFormatTest.php b/web/core/modules/filter/tests/src/Functional/FilterDefaultFormatTest.php
index d74a14dc..ce127060 100644
--- a/web/core/modules/filter/tests/src/Functional/FilterDefaultFormatTest.php
+++ b/web/core/modules/filter/tests/src/Functional/FilterDefaultFormatTest.php
@@ -44,7 +44,10 @@ class FilterDefaultFormatTest extends BrowserTestBase {
}
list($first_format, $second_format) = $formats;
$second_format_permission = $second_format->getPermissionName();
- $first_user = $this->drupalCreateUser([$first_format->getPermissionName(), $second_format_permission]);
+ $first_user = $this->drupalCreateUser([
+ $first_format->getPermissionName(),
+ $second_format_permission,
+ ]);
$second_user = $this->drupalCreateUser([$second_format_permission]);
// Adjust the weights so that the first and second formats (in that order)
diff --git a/web/core/modules/filter/tests/src/Functional/FilterHooksTest.php b/web/core/modules/filter/tests/src/Functional/FilterHooksTest.php
index a70a95f9..3fd9513c 100644
--- a/web/core/modules/filter/tests/src/Functional/FilterHooksTest.php
+++ b/web/core/modules/filter/tests/src/Functional/FilterHooksTest.php
@@ -36,7 +36,11 @@ class FilterHooksTest extends BrowserTestBase {
$type = $this->drupalCreateContentType(['name' => $type_name, 'type' => $type_name]);
$node_permission = "create $type_name content";
- $admin_user = $this->drupalCreateUser(['administer filters', 'administer nodes', $node_permission]);
+ $admin_user = $this->drupalCreateUser([
+ 'administer filters',
+ 'administer nodes',
+ $node_permission,
+ ]);
$this->drupalLogin($admin_user);
// Add a text format.
diff --git a/web/core/modules/filter/tests/src/Functional/FilterSecurityTest.php b/web/core/modules/filter/tests/src/Functional/FilterSecurityTest.php
index 103c6e3c..1d6c10cc 100644
--- a/web/core/modules/filter/tests/src/Functional/FilterSecurityTest.php
+++ b/web/core/modules/filter/tests/src/Functional/FilterSecurityTest.php
@@ -46,7 +46,11 @@ class FilterSecurityTest extends BrowserTestBase {
$filtered_html_permission = $filtered_html_format->getPermissionName();
user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, [$filtered_html_permission]);
- $this->adminUser = $this->drupalCreateUser(['administer modules', 'administer filters', 'administer site configuration']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'administer modules',
+ 'administer filters',
+ 'administer site configuration',
+ ]);
$this->drupalLogin($this->adminUser);
}
diff --git a/web/core/modules/forum/tests/src/Functional/ForumBlockTest.php b/web/core/modules/forum/tests/src/Functional/ForumBlockTest.php
index a5043fe2..3bd1d43c 100644
--- a/web/core/modules/forum/tests/src/Functional/ForumBlockTest.php
+++ b/web/core/modules/forum/tests/src/Functional/ForumBlockTest.php
@@ -58,12 +58,12 @@ class ForumBlockTest extends BrowserTestBase {
// Create 5 forum topics.
$topics = $this->createForumTopics();
- $this->assertLink(t('More'), 0, 'New forum topics block has a "more"-link.');
+ $this->assertSession()->linkExists(t('More'), 0, 'New forum topics block has a "more"-link.');
$this->assertLinkByHref('forum', 0, 'New forum topics block has a "more"-link.');
// We expect all 5 forum topics to appear in the "New forum topics" block.
foreach ($topics as $topic) {
- $this->assertLink($topic, 0, new FormattableMarkup('Forum topic @topic found in the "New forum topics" block.', ['@topic' => $topic]));
+ $this->assertSession()->linkExists($topic, 0, new FormattableMarkup('Forum topic @topic found in the "New forum topics" block.', ['@topic' => $topic]));
}
// Configure the new forum topics block to only show 2 topics.
@@ -75,7 +75,7 @@ class ForumBlockTest extends BrowserTestBase {
// topics" block.
for ($index = 0; $index < 5; $index++) {
if (in_array($index, [3, 4])) {
- $this->assertLink($topics[$index], 0, new FormattableMarkup('Forum topic @topic found in the "New forum topics" block.', ['@topic' => $topics[$index]]));
+ $this->assertSession()->linkExists($topics[$index], 0, new FormattableMarkup('Forum topic @topic found in the "New forum topics" block.', ['@topic' => $topics[$index]]));
}
else {
$this->assertNoText($topics[$index], new FormattableMarkup('Forum topic @topic not found in the "New forum topics" block.', ['@topic' => $topics[$index]]));
@@ -113,7 +113,7 @@ class ForumBlockTest extends BrowserTestBase {
// Enable the block.
$block = $this->drupalPlaceBlock('forum_active_block');
$this->drupalGet('');
- $this->assertLink(t('More'), 0, 'Active forum topics block has a "more"-link.');
+ $this->assertSession()->linkExists(t('More'), 0, 'Active forum topics block has a "more"-link.');
$this->assertLinkByHref('forum', 0, 'Active forum topics block has a "more"-link.');
// We expect the first 5 forum topics to appear in the "Active forum topics"
@@ -121,7 +121,7 @@ class ForumBlockTest extends BrowserTestBase {
$this->drupalGet('');
for ($index = 0; $index < 10; $index++) {
if ($index < 5) {
- $this->assertLink($topics[$index], 0, new FormattableMarkup('Forum topic @topic found in the "Active forum topics" block.', ['@topic' => $topics[$index]]));
+ $this->assertSession()->linkExists($topics[$index], 0, new FormattableMarkup('Forum topic @topic found in the "Active forum topics" block.', ['@topic' => $topics[$index]]));
}
else {
$this->assertNoText($topics[$index], new FormattableMarkup('Forum topic @topic not found in the "Active forum topics" block.', ['@topic' => $topics[$index]]));
@@ -138,7 +138,7 @@ class ForumBlockTest extends BrowserTestBase {
// the "Active forum topics" block.
for ($index = 0; $index < 10; $index++) {
if (in_array($index, [3, 4])) {
- $this->assertLink($topics[$index], 0, 'Forum topic found in the "Active forum topics" block.');
+ $this->assertSession()->linkExists($topics[$index], 0, 'Forum topic found in the "Active forum topics" block.');
}
else {
$this->assertNoText($topics[$index], 'Forum topic not found in the "Active forum topics" block.');
diff --git a/web/core/modules/forum/tests/src/Functional/ForumIndexTest.php b/web/core/modules/forum/tests/src/Functional/ForumIndexTest.php
index 3bb803a9..de07fd0c 100644
--- a/web/core/modules/forum/tests/src/Functional/ForumIndexTest.php
+++ b/web/core/modules/forum/tests/src/Functional/ForumIndexTest.php
@@ -27,7 +27,13 @@ class ForumIndexTest extends BrowserTestBase {
parent::setUp();
// Create a test user.
- $web_user = $this->drupalCreateUser(['create forum content', 'edit own forum content', 'edit any forum content', 'administer nodes', 'administer forums']);
+ $web_user = $this->drupalCreateUser([
+ 'create forum content',
+ 'edit own forum content',
+ 'edit any forum content',
+ 'administer nodes',
+ 'administer forums',
+ ]);
$this->drupalLogin($web_user);
}
diff --git a/web/core/modules/forum/tests/src/Functional/ForumNodeAccessTest.php b/web/core/modules/forum/tests/src/Functional/ForumNodeAccessTest.php
index e18efd93..acf3f2a7 100644
--- a/web/core/modules/forum/tests/src/Functional/ForumNodeAccessTest.php
+++ b/web/core/modules/forum/tests/src/Functional/ForumNodeAccessTest.php
@@ -49,7 +49,12 @@ class ForumNodeAccessTest extends BrowserTestBase {
// Create some users.
$access_user = $this->drupalCreateUser(['node test view']);
$no_access_user = $this->drupalCreateUser();
- $admin_user = $this->drupalCreateUser(['access administration pages', 'administer modules', 'administer blocks', 'create forum content']);
+ $admin_user = $this->drupalCreateUser([
+ 'access administration pages',
+ 'administer modules',
+ 'administer blocks',
+ 'create forum content',
+ ]);
$this->drupalLogin($admin_user);
diff --git a/web/core/modules/forum/tests/src/Functional/ForumTest.php b/web/core/modules/forum/tests/src/Functional/ForumTest.php
index fd54ff99..0b44b6a1 100644
--- a/web/core/modules/forum/tests/src/Functional/ForumTest.php
+++ b/web/core/modules/forum/tests/src/Functional/ForumTest.php
@@ -189,9 +189,9 @@ class ForumTest extends BrowserTestBase {
// Verify that this user is shown a local task to add new forum content.
$this->drupalGet('forum');
- $this->assertLink(t('Add new Forum topic'));
+ $this->assertSession()->linkExists(t('Add new Forum topic'));
$this->drupalGet('forum/' . $this->forum['tid']);
- $this->assertLink(t('Add new Forum topic'));
+ $this->assertSession()->linkExists(t('Add new Forum topic'));
// Log in a user with permission to edit any forum content.
$this->drupalLogin($this->editAnyTopicsUser);
@@ -224,7 +224,11 @@ class ForumTest extends BrowserTestBase {
$this->assertEquals('6', $elements[0]->getText(), 'Number of posts found.');
// Test loading multiple forum nodes on the front page.
- $this->drupalLogin($this->drupalCreateUser(['administer content types', 'create forum content', 'post comments']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer content types',
+ 'create forum content',
+ 'post comments',
+ ]));
$this->drupalPostForm('admin/structure/types/manage/forum', ['options[promote]' => 'promote'], t('Save content type'));
$this->createForumTopic($this->forum, FALSE);
$this->createForumTopic($this->forum, FALSE);
@@ -256,7 +260,7 @@ class ForumTest extends BrowserTestBase {
// Test anonymous action link.
$this->drupalLogout();
$this->drupalGet('forum/' . $this->forum['tid']);
- $this->assertLink(t('Log in to post new content in the forum.'));
+ $this->assertSession()->linkExists(t('Log in to post new content in the forum.'));
}
/**
@@ -319,8 +323,8 @@ class ForumTest extends BrowserTestBase {
// Verify help text is shown.
$this->assertText(t('Forums contain forum topics. Use containers to group related forums'));
// Verify action links are there.
- $this->assertLink('Add forum');
- $this->assertLink('Add container');
+ $this->assertSession()->linkExists('Add forum');
+ $this->assertSession()->linkExists('Add container');
$this->clickLink('edit container');
$this->assertRaw('Edit container', 'Followed the link to edit the container');
// Create forum inside the forum container.
@@ -365,7 +369,7 @@ class ForumTest extends BrowserTestBase {
// Test tags vocabulary form is not affected.
$this->drupalGet('admin/structure/taxonomy/manage/tags');
$this->assertSession()->buttonExists('Save');
- $this->assertLink(t('Delete'));
+ $this->assertSession()->linkExists(t('Delete'));
// Test tags vocabulary term form is not affected.
$this->drupalGet('admin/structure/taxonomy/manage/tags/add');
$this->assertField('parent[]', 'Parent field found.');
@@ -547,7 +551,7 @@ class ForumTest extends BrowserTestBase {
$this->assertSession()->statusCodeEquals(200);
// Verify there is no unintentional HTML tag escaping.
- $this->assertNoEscaped('<', '');
+ $this->assertNoEscaped('<');
}
/**
diff --git a/web/core/modules/forum/tests/src/Functional/ForumUninstallTest.php b/web/core/modules/forum/tests/src/Functional/ForumUninstallTest.php
index 78e4492f..430c6837 100644
--- a/web/core/modules/forum/tests/src/Functional/ForumUninstallTest.php
+++ b/web/core/modules/forum/tests/src/Functional/ForumUninstallTest.php
@@ -32,7 +32,13 @@ class ForumUninstallTest extends BrowserTestBase {
* Tests if forum module uninstallation properly deletes the field.
*/
public function testForumUninstallWithField() {
- $this->drupalLogin($this->drupalCreateUser(['administer taxonomy', 'administer nodes', 'administer modules', 'delete any forum content', 'administer content types']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer taxonomy',
+ 'administer nodes',
+ 'administer modules',
+ 'delete any forum content',
+ 'administer content types',
+ ]));
// Ensure that the field exists before uninstallation.
$field_storage = FieldStorageConfig::loadByName('node', 'taxonomy_forums');
$this->assertNotNull($field_storage, 'The taxonomy_forums field storage exists.');
@@ -91,7 +97,7 @@ class ForumUninstallTest extends BrowserTestBase {
// Ensure that the forum node type can not be deleted.
$this->drupalGet('admin/structure/types/manage/forum');
- $this->assertNoLink(t('Delete'));
+ $this->assertSession()->linkNotExists(t('Delete'));
// Now attempt to uninstall forum.
$this->drupalGet('admin/modules/uninstall');
diff --git a/web/core/modules/help/tests/src/Functional/HelpTest.php b/web/core/modules/help/tests/src/Functional/HelpTest.php
index 199f6809..a3b9f853 100644
--- a/web/core/modules/help/tests/src/Functional/HelpTest.php
+++ b/web/core/modules/help/tests/src/Functional/HelpTest.php
@@ -49,7 +49,11 @@ class HelpTest extends BrowserTestBase {
parent::setUp();
// Create users.
- $this->adminUser = $this->drupalCreateUser(['access administration pages', 'view the administration theme', 'administer permissions']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'access administration pages',
+ 'view the administration theme',
+ 'administer permissions',
+ ]);
$this->anyUser = $this->drupalCreateUser([]);
}
@@ -82,7 +86,7 @@ class HelpTest extends BrowserTestBase {
// Make sure links are properly added for modules implementing hook_help().
foreach ($this->getModuleList() as $module => $name) {
- $this->assertLink($name, 0, new FormattableMarkup('Link properly added to @name (admin/help/@module)', ['@module' => $module, '@name' => $name]));
+ $this->assertSession()->linkExists($name, 0, new FormattableMarkup('Link properly added to @name (admin/help/@module)', ['@module' => $module, '@name' => $name]));
}
// Ensure that module which does not provide an module overview page is
@@ -99,7 +103,7 @@ class HelpTest extends BrowserTestBase {
$pos = $start;
$list = ['Block', 'Color', 'Custom Block', 'History', 'Text Editor'];
foreach ($list as $name) {
- $this->assertLink($name);
+ $this->assertSession()->linkExists($name);
$new_pos = strpos($page_text, $name, $start);
$this->assertTrue($new_pos > $pos, 'Order of ' . $name . ' is correct on page');
$pos = $new_pos;
@@ -135,12 +139,12 @@ class HelpTest extends BrowserTestBase {
$this->assertText(t('@module administration pages', ['@module' => $name]));
}
foreach ($admin_tasks as $task) {
- $this->assertLink($task['title']);
+ $this->assertSession()->linkExists($task['title']);
// Ensure there are no double escaped '&' or '<' characters.
- $this->assertNoEscaped('&', 'The help text does not have double escaped &.');
- $this->assertNoEscaped('<', 'The help text does not have double escaped <.');
+ $this->assertNoEscaped('&');
+ $this->assertNoEscaped('<');
// Ensure there are no escaped '<' characters.
- $this->assertNoEscaped('<', 'The help text does not have single escaped <.');
+ $this->assertNoEscaped('<');
}
// Ensure there are no double escaped '&' or '<' characters.
$this->assertNoEscaped('&');
diff --git a/web/core/modules/history/tests/src/Functional/HistoryTest.php b/web/core/modules/history/tests/src/Functional/HistoryTest.php
index ab9b3562..5d4e80ec 100644
--- a/web/core/modules/history/tests/src/Functional/HistoryTest.php
+++ b/web/core/modules/history/tests/src/Functional/HistoryTest.php
@@ -47,7 +47,10 @@ class HistoryTest extends BrowserTestBase {
$this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
- $this->user = $this->drupalCreateUser(['create page content', 'access content']);
+ $this->user = $this->drupalCreateUser([
+ 'create page content',
+ 'access content',
+ ]);
$this->drupalLogin($this->user);
$this->testNode = $this->drupalCreateNode(['type' => 'page', 'uid' => $this->user->id()]);
}
diff --git a/web/core/modules/image/image.module b/web/core/modules/image/image.module
index d7bb236c..35db4a8e 100644
--- a/web/core/modules/image/image.module
+++ b/web/core/modules/image/image.module
@@ -248,6 +248,7 @@ function image_path_flush($path) {
*
* @param $include_empty
* If TRUE a '- None -' option will be inserted in the options array.
+ *
* @return
* Array of image styles both key and value are set to style name.
*/
diff --git a/web/core/modules/image/tests/modules/image_module_test/src/Plugin/Field/FieldFormatter/DummyImageFormatter.php b/web/core/modules/image/tests/modules/image_module_test/src/Plugin/Field/FieldFormatter/DummyImageFormatter.php
new file mode 100644
index 00000000..43a6860b
--- /dev/null
+++ b/web/core/modules/image/tests/modules/image_module_test/src/Plugin/Field/FieldFormatter/DummyImageFormatter.php
@@ -0,0 +1,33 @@
+ 'Dummy'],
+ ];
+ }
+
+}
diff --git a/web/core/modules/image/tests/src/Functional/ImageFieldTestBase.php b/web/core/modules/image/tests/src/Functional/ImageFieldTestBase.php
index b736e8f4..3d0421e1 100644
--- a/web/core/modules/image/tests/src/Functional/ImageFieldTestBase.php
+++ b/web/core/modules/image/tests/src/Functional/ImageFieldTestBase.php
@@ -49,7 +49,19 @@ abstract class ImageFieldTestBase extends BrowserTestBase {
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
}
- $this->adminUser = $this->drupalCreateUser(['access content', 'access administration pages', 'administer site configuration', 'administer content types', 'administer node fields', 'administer nodes', 'create article content', 'edit any article content', 'delete any article content', 'administer image styles', 'administer node display']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'access content',
+ 'access administration pages',
+ 'administer site configuration',
+ 'administer content types',
+ 'administer node fields',
+ 'administer nodes',
+ 'create article content',
+ 'edit any article content',
+ 'delete any article content',
+ 'administer image styles',
+ 'administer node display',
+ ]);
$this->drupalLogin($this->adminUser);
}
diff --git a/web/core/modules/jsonapi/src/Controller/EntityResource.php b/web/core/modules/jsonapi/src/Controller/EntityResource.php
index 7f6b5fc9..4bd865bc 100644
--- a/web/core/modules/jsonapi/src/Controller/EntityResource.php
+++ b/web/core/modules/jsonapi/src/Controller/EntityResource.php
@@ -322,7 +322,7 @@ class EntityResource {
));
}
$data += ['attributes' => [], 'relationships' => []];
- $field_names = array_merge(array_keys($data['attributes']), array_keys($data['relationships']));
+ $field_names = array_map([$resource_type, 'getInternalName'], array_merge(array_keys($data['attributes']), array_keys($data['relationships'])));
// User resource objects contain a read-only attribute that is not a real
// field on the user entity type.
diff --git a/web/core/modules/jsonapi/src/Controller/FileUpload.php b/web/core/modules/jsonapi/src/Controller/FileUpload.php
index eb9fd6cd..b4a5800c 100644
--- a/web/core/modules/jsonapi/src/Controller/FileUpload.php
+++ b/web/core/modules/jsonapi/src/Controller/FileUpload.php
@@ -112,6 +112,7 @@ class FileUpload {
* created file entity.
*/
public function handleFileUploadForExistingResource(Request $request, ResourceType $resource_type, $file_field_name, FieldableEntityInterface $entity) {
+ $file_field_name = $resource_type->getInternalName($file_field_name);
$field_definition = $this->validateAndLoadFieldDefinition($resource_type->getEntityTypeId(), $resource_type->getBundle(), $file_field_name);
static::ensureFileUploadAccess($this->currentUser, $field_definition, $entity);
@@ -138,7 +139,7 @@ class FileUpload {
$entity->save();
$route_parameters = ['entity' => $entity->uuid()];
- $route_name = sprintf('jsonapi.%s.%s.related', $resource_type->getTypeName(), $file_field_name);
+ $route_name = sprintf('jsonapi.%s.%s.related', $resource_type->getTypeName(), $resource_type->getPublicName($file_field_name));
$related_url = Url::fromRoute($route_name, $route_parameters)->toString(TRUE);
$request = Request::create($related_url->getGeneratedUrl(), 'GET', [], $request->cookies->all(), [], $request->server->all());
return $this->httpKernel->handle($request, HttpKernelInterface::SUB_REQUEST);
@@ -161,6 +162,7 @@ class FileUpload {
* Thrown when there are validation errors.
*/
public function handleFileUploadForNewResource(Request $request, ResourceType $resource_type, $file_field_name) {
+ $file_field_name = $resource_type->getInternalName($file_field_name);
$field_definition = $this->validateAndLoadFieldDefinition($resource_type->getEntityTypeId(), $resource_type->getBundle(), $file_field_name);
static::ensureFileUploadAccess($this->currentUser, $field_definition);
@@ -182,7 +184,7 @@ class FileUpload {
/* $self_link = new Link(new CacheableMetadata(), $this->entity->toUrl('jsonapi'), ['self']); */
$links = new LinkCollection(['self' => $self_link]);
- $relatable_resource_types = $resource_type->getRelatableResourceTypesByField($file_field_name);
+ $relatable_resource_types = $resource_type->getRelatableResourceTypesByField($resource_type->getPublicName($file_field_name));
$file_resource_type = reset($relatable_resource_types);
$resource_object = ResourceObject::createFromEntity($file_resource_type, $file);
return new ResourceResponse(new JsonApiDocumentTopLevel(new ResourceObjectData([$resource_object], 1), new NullIncludedData(), $links), 201, []);
diff --git a/web/core/modules/jsonapi/tests/src/Functional/JsonApiRegressionTest.php b/web/core/modules/jsonapi/tests/src/Functional/JsonApiRegressionTest.php
index f117de6a..f2da5ad3 100644
--- a/web/core/modules/jsonapi/tests/src/Functional/JsonApiRegressionTest.php
+++ b/web/core/modules/jsonapi/tests/src/Functional/JsonApiRegressionTest.php
@@ -1029,7 +1029,10 @@ class JsonApiRegressionTest extends JsonApiFunctionalTestBase {
$this->assertInstanceOf(TranslatableInterface::class, $entity);
$this->assertFalse($entity->isTranslatable());
// Set up a test user with permission to view and update the test entity.
- $user = $this->drupalCreateUser(['view test entity', 'administer entity_test content']);
+ $user = $this->drupalCreateUser([
+ 'view test entity',
+ 'administer entity_test content',
+ ]);
$request_options[RequestOptions::HEADERS]['Accept'] = 'application/vnd.api+json';
$request_options[RequestOptions::AUTH] = [
$user->getAccountName(),
diff --git a/web/core/modules/language/tests/src/Functional/LanguageBlockSettingsVisibilityTest.php b/web/core/modules/language/tests/src/Functional/LanguageBlockSettingsVisibilityTest.php
index 1511bf1f..afdfaa36 100644
--- a/web/core/modules/language/tests/src/Functional/LanguageBlockSettingsVisibilityTest.php
+++ b/web/core/modules/language/tests/src/Functional/LanguageBlockSettingsVisibilityTest.php
@@ -19,7 +19,11 @@ class LanguageBlockSettingsVisibilityTest extends BrowserTestBase {
protected $defaultTheme = 'stark';
public function testUnnecessaryLanguageSettingsVisibility() {
- $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages', 'administer blocks']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer languages',
+ 'access administration pages',
+ 'administer blocks',
+ ]);
$this->drupalLogin($admin_user);
$this->drupalPostForm('admin/config/regional/language/add', ['predefined_langcode' => 'hu'], t('Add language'));
$this->drupalGet('admin/structure/block/add/system_menu_block:admin/stark');
diff --git a/web/core/modules/language/tests/src/Functional/LanguageBrowserDetectionTest.php b/web/core/modules/language/tests/src/Functional/LanguageBrowserDetectionTest.php
index 6c76a021..36159ead 100644
--- a/web/core/modules/language/tests/src/Functional/LanguageBrowserDetectionTest.php
+++ b/web/core/modules/language/tests/src/Functional/LanguageBrowserDetectionTest.php
@@ -25,7 +25,10 @@ class LanguageBrowserDetectionTest extends BrowserTestBase {
*/
public function testUIBrowserLanguageMappings() {
// User to manage languages.
- $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer languages',
+ 'access administration pages',
+ ]);
$this->drupalLogin($admin_user);
// Check that the configure link exists.
diff --git a/web/core/modules/language/tests/src/Functional/LanguageConfigurationElementTest.php b/web/core/modules/language/tests/src/Functional/LanguageConfigurationElementTest.php
index 8e700329..e9f520db 100644
--- a/web/core/modules/language/tests/src/Functional/LanguageConfigurationElementTest.php
+++ b/web/core/modules/language/tests/src/Functional/LanguageConfigurationElementTest.php
@@ -35,7 +35,11 @@ class LanguageConfigurationElementTest extends BrowserTestBase {
protected function setUp() {
parent::setUp();
- $user = $this->drupalCreateUser(['access administration pages', 'administer languages', 'administer content types']);
+ $user = $this->drupalCreateUser([
+ 'access administration pages',
+ 'administer languages',
+ 'administer content types',
+ ]);
$this->drupalLogin($user);
}
diff --git a/web/core/modules/language/tests/src/Functional/LanguageConfigurationTest.php b/web/core/modules/language/tests/src/Functional/LanguageConfigurationTest.php
index 06f4cee3..fa40a942 100644
--- a/web/core/modules/language/tests/src/Functional/LanguageConfigurationTest.php
+++ b/web/core/modules/language/tests/src/Functional/LanguageConfigurationTest.php
@@ -36,7 +36,10 @@ class LanguageConfigurationTest extends BrowserTestBase {
$this->assertEqual(ConfigurableLanguage::load('en')->getWeight(), 0, 'The English language has a weight of 0.');
// User to add and remove language.
- $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer languages',
+ 'access administration pages',
+ ]);
$this->drupalLogin($admin_user);
// Check if the Default English language has no path prefix.
@@ -157,7 +160,10 @@ class LanguageConfigurationTest extends BrowserTestBase {
*/
public function testLanguageConfigurationWeight() {
// User to add and remove language.
- $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer languages',
+ 'access administration pages',
+ ]);
$this->drupalLogin($admin_user);
$this->checkConfigurableLanguageWeight();
diff --git a/web/core/modules/language/tests/src/Functional/LanguageCustomLanguageConfigurationTest.php b/web/core/modules/language/tests/src/Functional/LanguageCustomLanguageConfigurationTest.php
index 52bbde11..e4bcfc51 100644
--- a/web/core/modules/language/tests/src/Functional/LanguageCustomLanguageConfigurationTest.php
+++ b/web/core/modules/language/tests/src/Functional/LanguageCustomLanguageConfigurationTest.php
@@ -32,7 +32,10 @@ class LanguageCustomLanguageConfigurationTest extends BrowserTestBase {
public function testLanguageConfiguration() {
// Create user with permissions to add and remove languages.
- $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer languages',
+ 'access administration pages',
+ ]);
$this->drupalLogin($admin_user);
// Add custom language.
diff --git a/web/core/modules/language/tests/src/Functional/LanguageListModuleInstallTest.php b/web/core/modules/language/tests/src/Functional/LanguageListModuleInstallTest.php
index e63c3172..f825049c 100644
--- a/web/core/modules/language/tests/src/Functional/LanguageListModuleInstallTest.php
+++ b/web/core/modules/language/tests/src/Functional/LanguageListModuleInstallTest.php
@@ -30,7 +30,10 @@ class LanguageListModuleInstallTest extends BrowserTestBase {
public function testModuleInstallLanguageList() {
// Since LanguageManager::getLanguages() uses static caches we need to do
// this by enabling the module using the UI.
- $admin_user = $this->drupalCreateUser(['access administration pages', 'administer modules']);
+ $admin_user = $this->drupalCreateUser([
+ 'access administration pages',
+ 'administer modules',
+ ]);
$this->drupalLogin($admin_user);
$edit = [];
$edit['modules[language][enable]'] = 'language';
diff --git a/web/core/modules/language/tests/src/Functional/LanguageListTest.php b/web/core/modules/language/tests/src/Functional/LanguageListTest.php
index bdaf6825..ac84fd9e 100644
--- a/web/core/modules/language/tests/src/Functional/LanguageListTest.php
+++ b/web/core/modules/language/tests/src/Functional/LanguageListTest.php
@@ -33,7 +33,10 @@ class LanguageListTest extends BrowserTestBase {
public function testLanguageList() {
// User to add and remove language.
- $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer languages',
+ 'access administration pages',
+ ]);
$this->drupalLogin($admin_user);
// Get the weight of the last language.
diff --git a/web/core/modules/language/tests/src/Functional/LanguageLocaleListTest.php b/web/core/modules/language/tests/src/Functional/LanguageLocaleListTest.php
index 2809d329..6b78d8d2 100644
--- a/web/core/modules/language/tests/src/Functional/LanguageLocaleListTest.php
+++ b/web/core/modules/language/tests/src/Functional/LanguageLocaleListTest.php
@@ -38,7 +38,10 @@ class LanguageLocaleListTest extends BrowserTestBase {
*/
public function testLanguageLocaleList() {
// User to add and remove language.
- $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer languages',
+ 'access administration pages',
+ ]);
$this->drupalLogin($admin_user);
// Add predefined language.
diff --git a/web/core/modules/language/tests/src/Functional/LanguageNegotiationInfoTest.php b/web/core/modules/language/tests/src/Functional/LanguageNegotiationInfoTest.php
index 35974cfd..22cd83e7 100644
--- a/web/core/modules/language/tests/src/Functional/LanguageNegotiationInfoTest.php
+++ b/web/core/modules/language/tests/src/Functional/LanguageNegotiationInfoTest.php
@@ -31,7 +31,12 @@ class LanguageNegotiationInfoTest extends BrowserTestBase {
*/
protected function setUp() {
parent::setUp();
- $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages', 'view the administration theme', 'administer modules']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer languages',
+ 'access administration pages',
+ 'view the administration theme',
+ 'administer modules',
+ ]);
$this->drupalLogin($admin_user);
$this->drupalPostForm('admin/config/regional/language/add', ['predefined_langcode' => 'it'], t('Add language'));
}
diff --git a/web/core/modules/language/tests/src/Functional/LanguagePathMonolingualTest.php b/web/core/modules/language/tests/src/Functional/LanguagePathMonolingualTest.php
index 06affc01..aea3a7f3 100644
--- a/web/core/modules/language/tests/src/Functional/LanguagePathMonolingualTest.php
+++ b/web/core/modules/language/tests/src/Functional/LanguagePathMonolingualTest.php
@@ -27,7 +27,11 @@ class LanguagePathMonolingualTest extends BrowserTestBase {
parent::setUp();
// Create and log in user.
- $web_user = $this->drupalCreateUser(['administer languages', 'access administration pages', 'administer site configuration']);
+ $web_user = $this->drupalCreateUser([
+ 'administer languages',
+ 'access administration pages',
+ 'administer site configuration',
+ ]);
$this->drupalLogin($web_user);
// Enable French language.
diff --git a/web/core/modules/language/tests/src/Functional/LanguageSwitchingTest.php b/web/core/modules/language/tests/src/Functional/LanguageSwitchingTest.php
index 7f20d47d..c636f250 100644
--- a/web/core/modules/language/tests/src/Functional/LanguageSwitchingTest.php
+++ b/web/core/modules/language/tests/src/Functional/LanguageSwitchingTest.php
@@ -38,7 +38,11 @@ class LanguageSwitchingTest extends BrowserTestBase {
parent::setUp();
// Create and log in user.
- $admin_user = $this->drupalCreateUser(['administer blocks', 'administer languages', 'access administration pages']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer blocks',
+ 'administer languages',
+ 'access administration pages',
+ ]);
$this->drupalLogin($admin_user);
}
diff --git a/web/core/modules/language/tests/src/Functional/LanguageTourTest.php b/web/core/modules/language/tests/src/Functional/LanguageTourTest.php
index 9bae5772..804b86ce 100644
--- a/web/core/modules/language/tests/src/Functional/LanguageTourTest.php
+++ b/web/core/modules/language/tests/src/Functional/LanguageTourTest.php
@@ -35,7 +35,10 @@ class LanguageTourTest extends TourTestBase {
*/
protected function setUp() {
parent::setUp();
- $this->adminUser = $this->drupalCreateUser(['administer languages', 'access tour']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'administer languages',
+ 'access tour',
+ ]);
$this->drupalLogin($this->adminUser);
$this->drupalPlaceBlock('local_actions_block');
}
diff --git a/web/core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php b/web/core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php
index 62e0ae5e..78163218 100644
--- a/web/core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php
+++ b/web/core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php
@@ -74,7 +74,12 @@ class LanguageUILanguageNegotiationTest extends BrowserTestBase {
protected function setUp() {
parent::setUp();
- $this->adminUser = $this->drupalCreateUser(['administer languages', 'translate interface', 'access administration pages', 'administer blocks']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'administer languages',
+ 'translate interface',
+ 'access administration pages',
+ 'administer blocks',
+ ]);
$this->drupalLogin($this->adminUser);
}
diff --git a/web/core/modules/language/tests/src/Functional/LanguageUrlRewritingTest.php b/web/core/modules/language/tests/src/Functional/LanguageUrlRewritingTest.php
index 456c5b62..60d5885d 100644
--- a/web/core/modules/language/tests/src/Functional/LanguageUrlRewritingTest.php
+++ b/web/core/modules/language/tests/src/Functional/LanguageUrlRewritingTest.php
@@ -39,7 +39,10 @@ class LanguageUrlRewritingTest extends BrowserTestBase {
parent::setUp();
// Create and log in user.
- $this->webUser = $this->drupalCreateUser(['administer languages', 'access administration pages']);
+ $this->webUser = $this->drupalCreateUser([
+ 'administer languages',
+ 'access administration pages',
+ ]);
$this->drupalLogin($this->webUser);
// Install French language.
diff --git a/web/core/modules/layout_builder/tests/src/Functional/LayoutBuilderAccessTest.php b/web/core/modules/layout_builder/tests/src/Functional/LayoutBuilderAccessTest.php
index 55c69ac1..ecaccd94 100644
--- a/web/core/modules/layout_builder/tests/src/Functional/LayoutBuilderAccessTest.php
+++ b/web/core/modules/layout_builder/tests/src/Functional/LayoutBuilderAccessTest.php
@@ -189,7 +189,12 @@ class LayoutBuilderAccessTest extends BrowserTestBase {
$this->drupalGet('user/' . $non_editable_user->id() . '/layout');
$this->assertExpectedAccess($non_editable_access);
- $non_viewable_user = $this->drupalCreateUser([], 'bad person', FALSE, ['status' => 0]);
+ $non_viewable_user = $this->drupalCreateUser(
+ [],
+ 'bad person',
+ FALSE,
+ ['status' => 0]
+ );
$this->drupalGet($non_viewable_user->toUrl());
$this->assertExpectedAccess(FALSE);
$this->drupalGet($non_viewable_user->toUrl('edit-form'));
diff --git a/web/core/modules/link/tests/src/Functional/LinkFieldUITest.php b/web/core/modules/link/tests/src/Functional/LinkFieldUITest.php
index 65e4125d..dd2318e4 100644
--- a/web/core/modules/link/tests/src/Functional/LinkFieldUITest.php
+++ b/web/core/modules/link/tests/src/Functional/LinkFieldUITest.php
@@ -68,8 +68,14 @@ class LinkFieldUITest extends BrowserTestBase {
$this->firstContentType = $this->drupalCreateContentType();
$this->secondContentType = $this->drupalCreateContentType();
- $this->adminUser = $this->drupalCreateUser(['administer content types', 'administer node fields', 'administer node display']);
- $this->helpTextUser = $this->drupalCreateUser(['create ' . $this->secondContentType->id() . ' content']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'administer content types',
+ 'administer node fields',
+ 'administer node display',
+ ]);
+ $this->helpTextUser = $this->drupalCreateUser([
+ 'create ' . $this->secondContentType->id() . ' content',
+ ]);
$this->drupalPlaceBlock('system_breadcrumb_block');
}
diff --git a/web/core/modules/locale/src/LocaleConfigManager.php b/web/core/modules/locale/src/LocaleConfigManager.php
index 547a1b50..2ebdd735 100644
--- a/web/core/modules/locale/src/LocaleConfigManager.php
+++ b/web/core/modules/locale/src/LocaleConfigManager.php
@@ -621,6 +621,7 @@ class LocaleConfigManager {
* Configuration override data.
* @param array $translatable
* Translatable data array. @see self::getTranslatableData()
+ *
* @return array
* Nested array of any items of $override_data which did not have keys in
* $translatable. May be empty if $override_data only had items which were
diff --git a/web/core/modules/locale/tests/src/Functional/LocaleConfigTranslationImportTest.php b/web/core/modules/locale/tests/src/Functional/LocaleConfigTranslationImportTest.php
index 64dcb705..d51a2d3d 100644
--- a/web/core/modules/locale/tests/src/Functional/LocaleConfigTranslationImportTest.php
+++ b/web/core/modules/locale/tests/src/Functional/LocaleConfigTranslationImportTest.php
@@ -36,7 +36,13 @@ class LocaleConfigTranslationImportTest extends BrowserTestBase {
* Test update changes configuration translations if enabled after language.
*/
public function testConfigTranslationImport() {
- $admin_user = $this->drupalCreateUser(['administer modules', 'administer site configuration', 'administer languages', 'access administration pages', 'administer permissions']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer modules',
+ 'administer site configuration',
+ 'administer languages',
+ 'access administration pages',
+ 'administer permissions',
+ ]);
$this->drupalLogin($admin_user);
// Add a language. The Afrikaans translation file of locale_test_translate
@@ -90,7 +96,14 @@ class LocaleConfigTranslationImportTest extends BrowserTestBase {
// import. Test that this override is in place.
$this->assertFalse($this->config('locale.settings')->get('translation.import_enabled'), 'Translations imports are disabled by default in the Testing profile.');
- $admin_user = $this->drupalCreateUser(['administer modules', 'administer site configuration', 'administer languages', 'access administration pages', 'administer permissions', 'translate configuration']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer modules',
+ 'administer site configuration',
+ 'administer languages',
+ 'access administration pages',
+ 'administer permissions',
+ 'translate configuration',
+ ]);
$this->drupalLogin($admin_user);
// Enable import of translations. By default this is disabled for automated
@@ -149,7 +162,14 @@ class LocaleConfigTranslationImportTest extends BrowserTestBase {
$this->container->get('module_installer')->install(['locale']);
$this->resetAll();
- $admin_user = $this->drupalCreateUser(['administer modules', 'administer site configuration', 'administer languages', 'access administration pages', 'administer permissions', 'translate interface']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer modules',
+ 'administer site configuration',
+ 'administer languages',
+ 'access administration pages',
+ 'administer permissions',
+ 'translate interface',
+ ]);
$this->drupalLogin($admin_user);
// Enable import of translations. By default this is disabled for automated
@@ -187,7 +207,14 @@ class LocaleConfigTranslationImportTest extends BrowserTestBase {
$this->container->get('module_installer')->install(['locale']);
$this->resetAll();
- $admin_user = $this->drupalCreateUser(['administer modules', 'administer site configuration', 'administer languages', 'access administration pages', 'administer permissions', 'translate interface']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer modules',
+ 'administer site configuration',
+ 'administer languages',
+ 'access administration pages',
+ 'administer permissions',
+ 'translate interface',
+ ]);
$this->drupalLogin($admin_user);
// Enable import of translations. By default this is disabled for automated
diff --git a/web/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php b/web/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php
index c555099b..e42f8d39 100644
--- a/web/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php
+++ b/web/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php
@@ -48,7 +48,15 @@ class LocaleConfigTranslationTest extends BrowserTestBase {
// Add custom language.
$this->langcode = 'xx';
- $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages', 'translate interface', 'administer modules', 'access site-wide contact form', 'administer contact forms', 'administer site configuration']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer languages',
+ 'access administration pages',
+ 'translate interface',
+ 'administer modules',
+ 'access site-wide contact form',
+ 'administer contact forms',
+ 'administer site configuration',
+ ]);
$this->drupalLogin($admin_user);
$name = $this->randomMachineName(16);
$edit = [
diff --git a/web/core/modules/locale/tests/src/Functional/LocaleContentTest.php b/web/core/modules/locale/tests/src/Functional/LocaleContentTest.php
index 9ac40754..04c09ff8 100644
--- a/web/core/modules/locale/tests/src/Functional/LocaleContentTest.php
+++ b/web/core/modules/locale/tests/src/Functional/LocaleContentTest.php
@@ -31,7 +31,12 @@ class LocaleContentTest extends BrowserTestBase {
*/
public function testMachineNameLTR() {
// User to add and remove language.
- $admin_user = $this->drupalCreateUser(['administer languages', 'administer content types', 'access administration pages', 'administer site configuration']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer languages',
+ 'administer content types',
+ 'access administration pages',
+ 'administer site configuration',
+ ]);
// Log in as admin.
$this->drupalLogin($admin_user);
@@ -63,9 +68,17 @@ class LocaleContentTest extends BrowserTestBase {
$type2 = $this->drupalCreateContentType();
// User to add and remove language.
- $admin_user = $this->drupalCreateUser(['administer languages', 'administer content types', 'access administration pages']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer languages',
+ 'administer content types',
+ 'access administration pages',
+ ]);
// User to create a node.
- $web_user = $this->drupalCreateUser(["create {$type1->id()} content", "create {$type2->id()} content", "edit any {$type2->id()} content"]);
+ $web_user = $this->drupalCreateUser([
+ "create {$type1->id()} content",
+ "create {$type2->id()} content",
+ "edit any {$type2->id()} content",
+ ]);
// Add custom language.
$this->drupalLogin($admin_user);
@@ -140,9 +153,16 @@ class LocaleContentTest extends BrowserTestBase {
$type = $this->drupalCreateContentType();
// User to add and remove language.
- $admin_user = $this->drupalCreateUser(['administer languages', 'administer content types', 'access administration pages']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer languages',
+ 'administer content types',
+ 'access administration pages',
+ ]);
// User to create a node.
- $web_user = $this->drupalCreateUser(["create {$type->id()} content", "edit own {$type->id()} content"]);
+ $web_user = $this->drupalCreateUser([
+ "create {$type->id()} content",
+ "edit own {$type->id()} content",
+ ]);
// Log in as admin.
$this->drupalLogin($admin_user);
diff --git a/web/core/modules/locale/tests/src/Functional/LocaleExportTest.php b/web/core/modules/locale/tests/src/Functional/LocaleExportTest.php
index 9869fb70..5170a831 100644
--- a/web/core/modules/locale/tests/src/Functional/LocaleExportTest.php
+++ b/web/core/modules/locale/tests/src/Functional/LocaleExportTest.php
@@ -35,7 +35,11 @@ class LocaleExportTest extends BrowserTestBase {
protected function setUp() {
parent::setUp();
- $this->adminUser = $this->drupalCreateUser(['administer languages', 'translate interface', 'access administration pages']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'administer languages',
+ 'translate interface',
+ 'access administration pages',
+ ]);
$this->drupalLogin($this->adminUser);
// Copy test po files to the translations directory.
diff --git a/web/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php b/web/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php
index 9342c6ed..526db97c 100644
--- a/web/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php
+++ b/web/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php
@@ -55,8 +55,17 @@ class LocaleImportFunctionalTest extends BrowserTestBase {
$file_system->copy(__DIR__ . '/../../../tests/test.de.po', 'translations://', FileSystemInterface::EXISTS_REPLACE);
$file_system->copy(__DIR__ . '/../../../tests/test.xx.po', 'translations://', FileSystemInterface::EXISTS_REPLACE);
- $this->adminUser = $this->drupalCreateUser(['administer languages', 'translate interface', 'access administration pages']);
- $this->adminUserAccessSiteReports = $this->drupalCreateUser(['administer languages', 'translate interface', 'access administration pages', 'access site reports']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'administer languages',
+ 'translate interface',
+ 'access administration pages',
+ ]);
+ $this->adminUserAccessSiteReports = $this->drupalCreateUser([
+ 'administer languages',
+ 'translate interface',
+ 'access administration pages',
+ 'access site reports',
+ ]);
$this->drupalLogin($this->adminUser);
// Enable import of translations. By default this is disabled for automated
diff --git a/web/core/modules/locale/tests/src/Functional/LocaleJavascriptTranslationTest.php b/web/core/modules/locale/tests/src/Functional/LocaleJavascriptTranslationTest.php
index 08705297..7b735b7f 100644
--- a/web/core/modules/locale/tests/src/Functional/LocaleJavascriptTranslationTest.php
+++ b/web/core/modules/locale/tests/src/Functional/LocaleJavascriptTranslationTest.php
@@ -116,7 +116,11 @@ class LocaleJavascriptTranslationTest extends BrowserTestBase {
*/
public function testLocaleTranslationJsDependencies() {
// User to add and remove language.
- $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages', 'translate interface']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer languages',
+ 'access administration pages',
+ 'translate interface',
+ ]);
// Add custom language.
$this->drupalLogin($admin_user);
diff --git a/web/core/modules/locale/tests/src/Functional/LocalePathTest.php b/web/core/modules/locale/tests/src/Functional/LocalePathTest.php
index 8ec53c66..9357230a 100644
--- a/web/core/modules/locale/tests/src/Functional/LocalePathTest.php
+++ b/web/core/modules/locale/tests/src/Functional/LocalePathTest.php
@@ -44,7 +44,14 @@ class LocalePathTest extends BrowserTestBase {
*/
public function testPathLanguageConfiguration() {
// User to add and remove language.
- $admin_user = $this->drupalCreateUser(['administer languages', 'create page content', 'administer url aliases', 'create url aliases', 'access administration pages', 'access content overview']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer languages',
+ 'create page content',
+ 'administer url aliases',
+ 'create url aliases',
+ 'access administration pages',
+ 'access content overview',
+ ]);
// Add custom language.
$this->drupalLogin($admin_user);
diff --git a/web/core/modules/locale/tests/src/Functional/LocalePluralFormatTest.php b/web/core/modules/locale/tests/src/Functional/LocalePluralFormatTest.php
index b85e737a..552273cf 100644
--- a/web/core/modules/locale/tests/src/Functional/LocalePluralFormatTest.php
+++ b/web/core/modules/locale/tests/src/Functional/LocalePluralFormatTest.php
@@ -39,7 +39,11 @@ class LocalePluralFormatTest extends BrowserTestBase {
protected function setUp() {
parent::setUp();
- $this->adminUser = $this->drupalCreateUser(['administer languages', 'translate interface', 'access administration pages']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'administer languages',
+ 'translate interface',
+ 'access administration pages',
+ ]);
$this->drupalLogin($this->adminUser);
}
diff --git a/web/core/modules/locale/tests/src/Functional/LocaleTranslateStringTourTest.php b/web/core/modules/locale/tests/src/Functional/LocaleTranslateStringTourTest.php
index 19db1b38..f2307cf9 100644
--- a/web/core/modules/locale/tests/src/Functional/LocaleTranslateStringTourTest.php
+++ b/web/core/modules/locale/tests/src/Functional/LocaleTranslateStringTourTest.php
@@ -35,7 +35,11 @@ class LocaleTranslateStringTourTest extends TourTestBase {
*/
protected function setUp() {
parent::setUp();
- $this->adminUser = $this->drupalCreateUser(['translate interface', 'access tour', 'administer languages']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'translate interface',
+ 'access tour',
+ 'administer languages',
+ ]);
$this->drupalLogin($this->adminUser);
}
diff --git a/web/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php b/web/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php
index 3905116e..aac663b2 100644
--- a/web/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php
+++ b/web/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php
@@ -32,7 +32,10 @@ class LocaleTranslationUiTest extends BrowserTestBase {
* Enable interface translation to English.
*/
public function testEnglishTranslation() {
- $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer languages',
+ 'access administration pages',
+ ]);
$this->drupalLogin($admin_user);
$this->drupalPostForm('admin/config/regional/language/edit/en', ['locale_translate_english' => TRUE], t('Save language'));
@@ -44,9 +47,15 @@ class LocaleTranslationUiTest extends BrowserTestBase {
*/
public function testStringTranslation() {
// User to add and remove language.
- $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer languages',
+ 'access administration pages',
+ ]);
// User to translate and delete string.
- $translate_user = $this->drupalCreateUser(['translate interface', 'access administration pages']);
+ $translate_user = $this->drupalCreateUser([
+ 'translate interface',
+ 'access administration pages',
+ ]);
// Code for the language.
$langcode = 'xx';
// The English name for the language. This will be translated.
@@ -216,7 +225,11 @@ class LocaleTranslationUiTest extends BrowserTestBase {
* properly created and rebuilt on deletion.
*/
public function testJavaScriptTranslation() {
- $user = $this->drupalCreateUser(['translate interface', 'administer languages', 'access administration pages']);
+ $user = $this->drupalCreateUser([
+ 'translate interface',
+ 'administer languages',
+ 'access administration pages',
+ ]);
$this->drupalLogin($user);
$config = $this->config('locale.settings');
@@ -279,7 +292,11 @@ class LocaleTranslationUiTest extends BrowserTestBase {
*/
public function testStringValidation() {
// User to add language and strings.
- $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages', 'translate interface']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer languages',
+ 'access administration pages',
+ 'translate interface',
+ ]);
$this->drupalLogin($admin_user);
$langcode = 'xx';
// The English name for the language. This will be translated.
@@ -333,9 +350,15 @@ class LocaleTranslationUiTest extends BrowserTestBase {
*/
public function testStringSearch() {
// User to add and remove language.
- $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer languages',
+ 'access administration pages',
+ ]);
// User to translate and delete string.
- $translate_user = $this->drupalCreateUser(['translate interface', 'access administration pages']);
+ $translate_user = $this->drupalCreateUser([
+ 'translate interface',
+ 'access administration pages',
+ ]);
// Code for the language.
$langcode = 'xx';
@@ -474,7 +497,11 @@ class LocaleTranslationUiTest extends BrowserTestBase {
* Tests that only changed strings are saved customized when edited.
*/
public function testUICustomizedStrings() {
- $user = $this->drupalCreateUser(['translate interface', 'administer languages', 'access administration pages']);
+ $user = $this->drupalCreateUser([
+ 'translate interface',
+ 'administer languages',
+ 'access administration pages',
+ ]);
$this->drupalLogin($user);
ConfigurableLanguage::createFromLangcode('de')->save();
diff --git a/web/core/modules/locale/tests/src/Functional/LocaleUpdateCronTest.php b/web/core/modules/locale/tests/src/Functional/LocaleUpdateCronTest.php
index 34ee9dc3..d7ebf325 100644
--- a/web/core/modules/locale/tests/src/Functional/LocaleUpdateCronTest.php
+++ b/web/core/modules/locale/tests/src/Functional/LocaleUpdateCronTest.php
@@ -26,7 +26,13 @@ class LocaleUpdateCronTest extends LocaleUpdateBase {
*/
protected function setUp() {
parent::setUp();
- $admin_user = $this->drupalCreateUser(['administer modules', 'administer site configuration', 'administer languages', 'access administration pages', 'translate interface']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer modules',
+ 'administer site configuration',
+ 'administer languages',
+ 'access administration pages',
+ 'translate interface',
+ ]);
$this->drupalLogin($admin_user);
$this->addLanguage('de');
}
diff --git a/web/core/modules/locale/tests/src/Functional/LocaleUpdateDevelopmentReleaseTest.php b/web/core/modules/locale/tests/src/Functional/LocaleUpdateDevelopmentReleaseTest.php
index 59211984..a04eafc1 100644
--- a/web/core/modules/locale/tests/src/Functional/LocaleUpdateDevelopmentReleaseTest.php
+++ b/web/core/modules/locale/tests/src/Functional/LocaleUpdateDevelopmentReleaseTest.php
@@ -21,7 +21,12 @@ class LocaleUpdateDevelopmentReleaseTest extends BrowserTestBase {
protected function setUp() {
parent::setUp();
module_load_include('compare.inc', 'locale');
- $admin_user = $this->drupalCreateUser(['administer modules', 'administer languages', 'access administration pages', 'translate interface']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer modules',
+ 'administer languages',
+ 'access administration pages',
+ 'translate interface',
+ ]);
$this->drupalLogin($admin_user);
$this->drupalPostForm('admin/config/regional/language/add', ['predefined_langcode' => 'hu'], t('Add language'));
}
diff --git a/web/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php b/web/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php
index 516d5b63..02049b66 100644
--- a/web/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php
+++ b/web/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php
@@ -29,7 +29,13 @@ class LocaleUpdateInterfaceTest extends LocaleUpdateBase {
*/
protected function setUp() {
parent::setUp();
- $admin_user = $this->drupalCreateUser(['administer modules', 'administer site configuration', 'administer languages', 'access administration pages', 'translate interface']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer modules',
+ 'administer site configuration',
+ 'administer languages',
+ 'access administration pages',
+ 'translate interface',
+ ]);
$this->drupalLogin($admin_user);
}
diff --git a/web/core/modules/locale/tests/src/Functional/LocaleUpdateTest.php b/web/core/modules/locale/tests/src/Functional/LocaleUpdateTest.php
index d6818a8f..d1b12c17 100644
--- a/web/core/modules/locale/tests/src/Functional/LocaleUpdateTest.php
+++ b/web/core/modules/locale/tests/src/Functional/LocaleUpdateTest.php
@@ -24,7 +24,13 @@ class LocaleUpdateTest extends LocaleUpdateBase {
parent::setUp();
module_load_include('compare.inc', 'locale');
module_load_include('fetch.inc', 'locale');
- $admin_user = $this->drupalCreateUser(['administer modules', 'administer site configuration', 'administer languages', 'access administration pages', 'translate interface']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer modules',
+ 'administer site configuration',
+ 'administer languages',
+ 'access administration pages',
+ 'translate interface',
+ ]);
$this->drupalLogin($admin_user);
// We use German as test language. This language must match the translation
// file that come with the locale_test module (test.de.po) and can therefore
diff --git a/web/core/modules/menu_link_content/menu_link_content.module b/web/core/modules/menu_link_content/menu_link_content.module
index def0ed9d..a593bef4 100644
--- a/web/core/modules/menu_link_content/menu_link_content.module
+++ b/web/core/modules/menu_link_content/menu_link_content.module
@@ -104,6 +104,11 @@ function menu_link_content_entity_predelete(EntityInterface $entity) {
$entity_type_id = $entity->getEntityTypeId();
foreach ($entity->uriRelationships() as $rel) {
$url = $entity->toUrl($rel);
+ // Entities can provide uri relationships that are not routed, in this case
+ // getRouteParameters() will throw an exception.
+ if (!$url->isRouted()) {
+ continue;
+ }
$route_parameters = $url->getRouteParameters();
if (!isset($route_parameters[$entity_type_id])) {
// Do not delete links which do not relate to this exact entity. For
diff --git a/web/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentDeleteFormTest.php b/web/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentDeleteFormTest.php
index 942703ae..bf77e303 100644
--- a/web/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentDeleteFormTest.php
+++ b/web/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentDeleteFormTest.php
@@ -52,7 +52,7 @@ class MenuLinkContentDeleteFormTest extends BrowserTestBase {
$menu_link = MenuLinkContent::load(1);
$this->drupalGet($menu_link->toUrl('delete-form'));
$this->assertRaw(t('Are you sure you want to delete the custom menu link %name?', ['%name' => $menu_link->label()]));
- $this->assertLink(t('Cancel'));
+ $this->assertSession()->linkExists(t('Cancel'));
// Make sure cancel link points to link edit
$this->assertLinkByHref($menu_link->toUrl('edit-form')->toString());
diff --git a/web/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentFormTest.php b/web/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentFormTest.php
index 8b58f4ff..d2c1b750 100644
--- a/web/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentFormTest.php
+++ b/web/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentFormTest.php
@@ -47,7 +47,10 @@ class MenuLinkContentFormTest extends BrowserTestBase {
*/
protected function setUp() {
parent::setUp();
- $this->adminUser = $this->drupalCreateUser(['administer menu', 'link to any page']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'administer menu',
+ 'link to any page',
+ ]);
$this->basicUser = $this->drupalCreateUser(['administer menu']);
$this->drupalLogin($this->adminUser);
}
diff --git a/web/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php b/web/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php
index badeb9cc..334bfcf0 100644
--- a/web/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php
+++ b/web/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php
@@ -73,7 +73,7 @@ class MenuLinkContentTranslationUITest extends ContentTranslationUITestBase {
*/
public function testTranslationLinkOnMenuEditForm() {
$this->drupalGet('admin/structure/menu/manage/tools');
- $this->assertNoLink(t('Translate'));
+ $this->assertSession()->linkNotExists(t('Translate'));
$menu_link_content = MenuLinkContent::create([
'menu_name' => 'tools',
@@ -82,7 +82,7 @@ class MenuLinkContentTranslationUITest extends ContentTranslationUITestBase {
]);
$menu_link_content->save();
$this->drupalGet('admin/structure/menu/manage/tools');
- $this->assertLink(t('Translate'));
+ $this->assertSession()->linkExists(t('Translate'));
}
/**
diff --git a/web/core/modules/menu_link_content/tests/src/Kernel/MenuLinksTest.php b/web/core/modules/menu_link_content/tests/src/Kernel/MenuLinksTest.php
index d7d3812f..6883c76a 100644
--- a/web/core/modules/menu_link_content/tests/src/Kernel/MenuLinksTest.php
+++ b/web/core/modules/menu_link_content/tests/src/Kernel/MenuLinksTest.php
@@ -4,6 +4,7 @@ namespace Drupal\Tests\menu_link_content\Kernel;
use Drupal\Component\Render\FormattableMarkup;
use Drupal\Core\Menu\MenuTreeParameters;
+use Drupal\entity_test\Entity\EntityTestExternal;
use Drupal\KernelTests\KernelTestBase;
use Drupal\menu_link_content\Entity\MenuLinkContent;
use Drupal\system\Entity\Menu;
@@ -17,11 +18,10 @@ use Drupal\user\Entity\User;
class MenuLinksTest extends KernelTestBase {
/**
- * Modules to enable.
- *
- * @var array
+ * {@inheritdoc}
*/
- public static $modules = [
+ protected static $modules = [
+ 'entity_test',
'link',
'menu_link_content',
'router_test',
@@ -46,6 +46,7 @@ class MenuLinksTest extends KernelTestBase {
$this->installSchema('system', ['sequences']);
$this->installSchema('user', ['users_data']);
+ $this->installEntitySchema('entity_test_external');
$this->installEntitySchema('menu_link_content');
$this->installEntitySchema('user');
@@ -163,6 +164,12 @@ class MenuLinksTest extends KernelTestBase {
$user = User::create(['name' => 'username']);
$user->save();
+ // Create External test entity.
+ $external_entity = EntityTestExternal::create();
+ $external_entity->save();
+ // Ensure an external entity can be deleted.
+ $external_entity->delete();
+
// Create "canonical" menu link pointing to the user.
$menu_link_content = MenuLinkContent::create([
'title' => 'username profile',
diff --git a/web/core/modules/menu_ui/tests/src/Functional/MenuLinkReorderTest.php b/web/core/modules/menu_ui/tests/src/Functional/MenuLinkReorderTest.php
index 88e51585..0a94dbd2 100644
--- a/web/core/modules/menu_ui/tests/src/Functional/MenuLinkReorderTest.php
+++ b/web/core/modules/menu_ui/tests/src/Functional/MenuLinkReorderTest.php
@@ -40,7 +40,7 @@ class MenuLinkReorderTest extends BrowserTestBase {
// Assert that the Home link is available.
$this->drupalGet('test-page');
- $this->assertLink('Home');
+ $this->assertSession()->linkExists('Home');
// The administrator user that can re-order menu links.
$this->administrator = $this->drupalCreateUser([
@@ -58,14 +58,14 @@ class MenuLinkReorderTest extends BrowserTestBase {
// The link is still there.
$this->drupalGet('test-page');
- $this->assertLink('Home');
+ $this->assertSession()->linkExists('Home');
// Clear all caches.
$this->drupalPostForm('admin/config/development/performance', [], t('Clear all caches'));
// Clearing all caches should not affect the state of the menu link.
$this->drupalGet('test-page');
- $this->assertLink('Home');
+ $this->assertSession()->linkExists('Home');
}
diff --git a/web/core/modules/menu_ui/tests/src/Functional/MenuUiLanguageTest.php b/web/core/modules/menu_ui/tests/src/Functional/MenuUiLanguageTest.php
index dcdb3277..af69440e 100644
--- a/web/core/modules/menu_ui/tests/src/Functional/MenuUiLanguageTest.php
+++ b/web/core/modules/menu_ui/tests/src/Functional/MenuUiLanguageTest.php
@@ -38,7 +38,10 @@ class MenuUiLanguageTest extends BrowserTestBase {
protected function setUp() {
parent::setUp();
- $this->drupalLogin($this->drupalCreateUser(['access administration pages', 'administer menu']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'access administration pages',
+ 'administer menu',
+ ]));
// Add some custom languages.
foreach (['aa', 'bb', 'cc', 'cs'] as $language_code) {
diff --git a/web/core/modules/menu_ui/tests/src/Functional/MenuUiNodeTest.php b/web/core/modules/menu_ui/tests/src/Functional/MenuUiNodeTest.php
index 5909ee0d..05b2dd91 100644
--- a/web/core/modules/menu_ui/tests/src/Functional/MenuUiNodeTest.php
+++ b/web/core/modules/menu_ui/tests/src/Functional/MenuUiNodeTest.php
@@ -141,7 +141,7 @@ class MenuUiNodeTest extends BrowserTestBase {
$node = $this->drupalGetNodeByTitle($node_title);
// Assert that there is no link for the node.
$this->drupalGet('test-page');
- $this->assertNoLink($node_title);
+ $this->assertSession()->linkNotExists($node_title);
// Edit the node, enable the menu link setting, but skip the link title.
$edit = [
@@ -150,7 +150,7 @@ class MenuUiNodeTest extends BrowserTestBase {
$this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
// Assert that there is no link for the node.
$this->drupalGet('test-page');
- $this->assertNoLink($node_title);
+ $this->assertSession()->linkNotExists($node_title);
// Make sure the menu links only appear when the node is published.
// These buttons just appear for 'administer nodes' users.
@@ -171,12 +171,12 @@ class MenuUiNodeTest extends BrowserTestBase {
];
$this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save');
$this->drupalGet('test-page');
- $this->assertNoLink($node_title, 'Found no menu link with the node unpublished');
+ $this->assertSession()->linkNotExists($node_title, 'Found no menu link with the node unpublished');
// Assert that the link exists if published.
$edit['status[value]'] = TRUE;
$this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save');
$this->drupalGet('test-page');
- $this->assertLink($node_title, 0, 'Found a menu link with the node published');
+ $this->assertSession()->linkExists($node_title, 0, 'Found a menu link with the node published');
// Log back in as normal user.
$this->drupalLogin($this->editor);
@@ -189,7 +189,7 @@ class MenuUiNodeTest extends BrowserTestBase {
$this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
// Assert that the link exists.
$this->drupalGet('test-page');
- $this->assertLink($node_title);
+ $this->assertSession()->linkExists($node_title);
$this->drupalGet('node/' . $node->id() . '/edit');
$this->assertFieldById('edit-menu-weight', 17, 'Menu weight correct in edit form');
@@ -213,7 +213,7 @@ class MenuUiNodeTest extends BrowserTestBase {
$this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
// Assert that there is no link for the node.
$this->drupalGet('test-page');
- $this->assertNoLink($node_title);
+ $this->assertSession()->linkNotExists($node_title);
// Add a menu link to the Administration menu.
$item = MenuLinkContent::create([
@@ -335,11 +335,11 @@ class MenuUiNodeTest extends BrowserTestBase {
// Assert that the original link exists in the frontend.
$this->drupalGet('node/' . $node->id(), ['language' => $languages[$langcodes[0]]]);
- $this->assertLink($node_title);
+ $this->assertSession()->linkExists($node_title);
// Assert that the translated link exists in the frontend.
$this->drupalGet('node/' . $node->id(), ['language' => $languages[$langcodes[1]]]);
- $this->assertLink($translated_node_title);
+ $this->assertSession()->linkExists($translated_node_title);
// Revisit the edit page in original language, check the loaded menu item title and save.
$options = ['language' => $languages[$langcodes[0]]];
diff --git a/web/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php b/web/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php
index 38823057..de15179d 100644
--- a/web/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php
+++ b/web/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php
@@ -88,7 +88,12 @@ class MenuUiTest extends BrowserTestBase {
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
// Create users.
- $this->adminUser = $this->drupalCreateUser(['access administration pages', 'administer blocks', 'administer menu', 'create article content']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'access administration pages',
+ 'administer blocks',
+ 'administer menu',
+ 'create article content',
+ ]);
$this->authenticatedUser = $this->drupalCreateUser([]);
}
@@ -557,7 +562,13 @@ class MenuUiTest extends BrowserTestBase {
* Tests that menu items pointing to unpublished nodes are editable.
*/
public function testUnpublishedNodeMenuItem() {
- $this->drupalLogin($this->drupalCreateUser(['access administration pages', 'administer blocks', 'administer menu', 'create article content', 'bypass node access']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'access administration pages',
+ 'administer blocks',
+ 'administer menu',
+ 'create article content',
+ 'bypass node access',
+ ]));
// Create an unpublished node.
$node = $this->drupalCreateNode([
'type' => 'article',
@@ -704,7 +715,7 @@ class MenuUiTest extends BrowserTestBase {
if (isset($parent)) {
// Verify menu link.
$title = $parent->getTitle();
- $this->assertLink($title, 0, 'Parent menu link was displayed');
+ $this->assertSession()->linkExists($title, 0, 'Parent menu link was displayed');
// Verify menu link link.
$this->clickLink($title);
@@ -714,7 +725,7 @@ class MenuUiTest extends BrowserTestBase {
// Verify menu link.
$title = $item->getTitle();
- $this->assertLink($title, 0, 'Menu link was displayed');
+ $this->assertSession()->linkExists($title, 0, 'Menu link was displayed');
// Verify menu link link.
$this->clickLink($title);
diff --git a/web/core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php b/web/core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php
index 38b4cbe3..f6655903 100644
--- a/web/core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php
+++ b/web/core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php
@@ -160,6 +160,7 @@ abstract class DrupalSqlBase extends SqlBase implements ContainerFactoryPluginIn
* Name of the variable.
* @param $default
* The default value.
+ *
* @return mixed
*/
protected function variableGet($name, $default) {
diff --git a/web/core/modules/node/src/NodeGrantDatabaseStorage.php b/web/core/modules/node/src/NodeGrantDatabaseStorage.php
index 1bea256c..bacd952c 100644
--- a/web/core/modules/node/src/NodeGrantDatabaseStorage.php
+++ b/web/core/modules/node/src/NodeGrantDatabaseStorage.php
@@ -288,6 +288,7 @@ class NodeGrantDatabaseStorage implements NodeGrantDatabaseStorageInterface {
*
* @param array $node_access_grants
* An array of grants, as returned by node_access_grants().
+ *
* @return \Drupal\Core\Database\Query\Condition
* A condition object to be passed to $query->condition().
*
diff --git a/web/core/modules/node/tests/src/Functional/MultiStepNodeFormBasicOptionsTest.php b/web/core/modules/node/tests/src/Functional/MultiStepNodeFormBasicOptionsTest.php
index 837d96ce..5e49d08a 100644
--- a/web/core/modules/node/tests/src/Functional/MultiStepNodeFormBasicOptionsTest.php
+++ b/web/core/modules/node/tests/src/Functional/MultiStepNodeFormBasicOptionsTest.php
@@ -29,7 +29,10 @@ class MultiStepNodeFormBasicOptionsTest extends NodeTestBase {
*/
public function testMultiStepNodeFormBasicOptions() {
// Prepare a user to create the node.
- $web_user = $this->drupalCreateUser(['administer nodes', 'create page content']);
+ $web_user = $this->drupalCreateUser([
+ 'administer nodes',
+ 'create page content',
+ ]);
$this->drupalLogin($web_user);
// Create an unlimited cardinality field.
diff --git a/web/core/modules/node/tests/src/Functional/NodeAccessBaseTableTest.php b/web/core/modules/node/tests/src/Functional/NodeAccessBaseTableTest.php
index c5f376b7..3ed15bc9 100644
--- a/web/core/modules/node/tests/src/Functional/NodeAccessBaseTableTest.php
+++ b/web/core/modules/node/tests/src/Functional/NodeAccessBaseTableTest.php
@@ -100,7 +100,10 @@ class NodeAccessBaseTableTest extends NodeTestBase {
// Array of nids marked private.
$private_nodes = [];
for ($i = 0; $i < $num_simple_users; $i++) {
- $simple_users[$i] = $this->drupalCreateUser(['access content', 'create article content']);
+ $simple_users[$i] = $this->drupalCreateUser([
+ 'access content',
+ 'create article content',
+ ]);
}
foreach ($simple_users as $this->webUser) {
$this->drupalLogin($this->webUser);
@@ -160,7 +163,12 @@ class NodeAccessBaseTableTest extends NodeTestBase {
}
// Now test that a user with 'node test view' permissions can view content.
- $access_user = $this->drupalCreateUser(['access content', 'create article content', 'node test view', 'search content']);
+ $access_user = $this->drupalCreateUser([
+ 'access content',
+ 'create article content',
+ 'node test view',
+ 'search content',
+ ]);
$this->drupalLogin($access_user);
foreach ($this->nodesByUser as $private_status) {
diff --git a/web/core/modules/node/tests/src/Functional/NodeAccessFieldTest.php b/web/core/modules/node/tests/src/Functional/NodeAccessFieldTest.php
index d92b5ef8..8f29c65e 100644
--- a/web/core/modules/node/tests/src/Functional/NodeAccessFieldTest.php
+++ b/web/core/modules/node/tests/src/Functional/NodeAccessFieldTest.php
@@ -51,8 +51,15 @@ class NodeAccessFieldTest extends NodeTestBase {
node_access_rebuild();
// Create some users.
- $this->adminUser = $this->drupalCreateUser(['access content', 'bypass node access']);
- $this->contentAdminUser = $this->drupalCreateUser(['access content', 'administer content types', 'administer node fields']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'access content',
+ 'bypass node access',
+ ]);
+ $this->contentAdminUser = $this->drupalCreateUser([
+ 'access content',
+ 'administer content types',
+ 'administer node fields',
+ ]);
// Add a custom field to the page content type.
$this->fieldName = mb_strtolower($this->randomMachineName() . '_field_name');
diff --git a/web/core/modules/node/tests/src/Functional/NodeAccessGrantsCacheContextTest.php b/web/core/modules/node/tests/src/Functional/NodeAccessGrantsCacheContextTest.php
index ba9f2bb1..4352c6c9 100644
--- a/web/core/modules/node/tests/src/Functional/NodeAccessGrantsCacheContextTest.php
+++ b/web/core/modules/node/tests/src/Functional/NodeAccessGrantsCacheContextTest.php
@@ -50,9 +50,19 @@ class NodeAccessGrantsCacheContextTest extends NodeTestBase {
// Create user with simple node access permission. The 'node test view'
// permission is implemented and granted by the node_access_test module.
- $this->accessUser = $this->drupalCreateUser(['access content overview', 'access content', 'node test view']);
- $this->noAccessUser = $this->drupalCreateUser(['access content overview', 'access content']);
- $this->noAccessUser2 = $this->drupalCreateUser(['access content overview', 'access content']);
+ $this->accessUser = $this->drupalCreateUser([
+ 'access content overview',
+ 'access content',
+ 'node test view',
+ ]);
+ $this->noAccessUser = $this->drupalCreateUser([
+ 'access content overview',
+ 'access content',
+ ]);
+ $this->noAccessUser2 = $this->drupalCreateUser([
+ 'access content overview',
+ 'access content',
+ ]);
$this->userMapping = [
1 => $this->rootUser,
diff --git a/web/core/modules/node/tests/src/Functional/NodeAccessMenuLinkTest.php b/web/core/modules/node/tests/src/Functional/NodeAccessMenuLinkTest.php
index 54c91234..fdd35dd6 100644
--- a/web/core/modules/node/tests/src/Functional/NodeAccessMenuLinkTest.php
+++ b/web/core/modules/node/tests/src/Functional/NodeAccessMenuLinkTest.php
@@ -59,19 +59,19 @@ class NodeAccessMenuLinkTest extends NodeTestBase {
'menu[title]' => $menu_link_title,
];
$this->drupalPostForm('node/add/page', $edit, t('Save'));
- $this->assertLink($menu_link_title);
+ $this->assertSession()->linkExists($menu_link_title);
// Ensure anonymous users without "access content" permission do not see
// this menu link.
$this->drupalLogout();
$this->drupalGet('');
- $this->assertNoLink($menu_link_title);
+ $this->assertSession()->linkNotExists($menu_link_title);
// Ensure anonymous users with "access content" permission see this menu
// link.
$this->config('user.role.' . RoleInterface::ANONYMOUS_ID)->set('permissions', ['access content'])->save();
$this->drupalGet('');
- $this->assertLink($menu_link_title);
+ $this->assertSession()->linkExists($menu_link_title);
}
}
diff --git a/web/core/modules/node/tests/src/Functional/NodeAccessPagerTest.php b/web/core/modules/node/tests/src/Functional/NodeAccessPagerTest.php
index 76acb9f9..11fde433 100644
--- a/web/core/modules/node/tests/src/Functional/NodeAccessPagerTest.php
+++ b/web/core/modules/node/tests/src/Functional/NodeAccessPagerTest.php
@@ -34,7 +34,11 @@ class NodeAccessPagerTest extends BrowserTestBase {
node_access_rebuild();
$this->drupalCreateContentType(['type' => 'page', 'name' => t('Basic page')]);
$this->addDefaultCommentField('node', 'page');
- $this->webUser = $this->drupalCreateUser(['access content', 'access comments', 'node test view']);
+ $this->webUser = $this->drupalCreateUser([
+ 'access content',
+ 'access comments',
+ 'node test view',
+ ]);
}
/**
diff --git a/web/core/modules/node/tests/src/Functional/NodeAccessRebuildNodeGrantsTest.php b/web/core/modules/node/tests/src/Functional/NodeAccessRebuildNodeGrantsTest.php
index 8c61404b..dae30883 100644
--- a/web/core/modules/node/tests/src/Functional/NodeAccessRebuildNodeGrantsTest.php
+++ b/web/core/modules/node/tests/src/Functional/NodeAccessRebuildNodeGrantsTest.php
@@ -37,7 +37,11 @@ class NodeAccessRebuildNodeGrantsTest extends NodeTestBase {
protected function setUp() {
parent::setUp();
- $this->adminUser = $this->drupalCreateUser(['administer site configuration', 'access administration pages', 'access site reports']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'administer site configuration',
+ 'access administration pages',
+ 'access site reports',
+ ]);
$this->drupalLogin($this->adminUser);
$this->webUser = $this->drupalCreateUser();
diff --git a/web/core/modules/node/tests/src/Functional/NodeAdminTest.php b/web/core/modules/node/tests/src/Functional/NodeAdminTest.php
index 707f0b3f..5c4f046f 100644
--- a/web/core/modules/node/tests/src/Functional/NodeAdminTest.php
+++ b/web/core/modules/node/tests/src/Functional/NodeAdminTest.php
@@ -60,10 +60,21 @@ class NodeAdminTest extends NodeTestBase {
// correctly.
user_role_revoke_permissions(RoleInterface::AUTHENTICATED_ID, ['view own unpublished content']);
- $this->adminUser = $this->drupalCreateUser(['access administration pages', 'access content overview', 'administer nodes', 'bypass node access']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'access administration pages',
+ 'access content overview',
+ 'administer nodes',
+ 'bypass node access',
+ ]);
$this->baseUser1 = $this->drupalCreateUser(['access content overview']);
- $this->baseUser2 = $this->drupalCreateUser(['access content overview', 'view own unpublished content']);
- $this->baseUser3 = $this->drupalCreateUser(['access content overview', 'bypass node access']);
+ $this->baseUser2 = $this->drupalCreateUser([
+ 'access content overview',
+ 'view own unpublished content',
+ ]);
+ $this->baseUser3 = $this->drupalCreateUser([
+ 'access content overview',
+ 'bypass node access',
+ ]);
}
/**
diff --git a/web/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php b/web/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php
index b0b0aae1..1ed8f982 100644
--- a/web/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php
+++ b/web/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php
@@ -47,8 +47,16 @@ class NodeBlockFunctionalTest extends NodeTestBase {
parent::setUp();
// Create users and test node.
- $this->adminUser = $this->drupalCreateUser(['administer content types', 'administer nodes', 'administer blocks', 'access content overview']);
- $this->webUser = $this->drupalCreateUser(['access content', 'create article content']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'administer content types',
+ 'administer nodes',
+ 'administer blocks',
+ 'access content overview',
+ ]);
+ $this->webUser = $this->drupalCreateUser([
+ 'access content',
+ 'create article content',
+ ]);
}
/**
diff --git a/web/core/modules/node/tests/src/Functional/NodeCreationTest.php b/web/core/modules/node/tests/src/Functional/NodeCreationTest.php
index 62fb395e..1791bb0a 100644
--- a/web/core/modules/node/tests/src/Functional/NodeCreationTest.php
+++ b/web/core/modules/node/tests/src/Functional/NodeCreationTest.php
@@ -31,7 +31,10 @@ class NodeCreationTest extends NodeTestBase {
protected function setUp() {
parent::setUp();
- $web_user = $this->drupalCreateUser(['create page content', 'edit own page content']);
+ $web_user = $this->drupalCreateUser([
+ 'create page content',
+ 'edit own page content',
+ ]);
$this->drupalLogin($web_user);
}
@@ -79,7 +82,10 @@ class NodeCreationTest extends NodeTestBase {
$this->assertText($this->container->get('date.formatter')->format($node->getCreatedTime()));
// Check if the node revision checkbox is not rendered on node creation form.
- $admin_user = $this->drupalCreateUser(['administer nodes', 'create page content']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer nodes',
+ 'create page content',
+ ]);
$this->drupalLogin($admin_user);
$this->drupalGet('node/add/page');
$this->assertNoFieldById('edit-revision', NULL, 'The revision checkbox is not present.');
@@ -227,7 +233,10 @@ class NodeCreationTest extends NodeTestBase {
* Tests the author autocompletion textfield.
*/
public function testAuthorAutocomplete() {
- $admin_user = $this->drupalCreateUser(['administer nodes', 'create page content']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer nodes',
+ 'create page content',
+ ]);
$this->drupalLogin($admin_user);
$this->drupalGet('node/add/page');
@@ -235,7 +244,11 @@ class NodeCreationTest extends NodeTestBase {
$result = $this->xpath('//input[@id="edit-uid-0-value" and contains(@data-autocomplete-path, "user/autocomplete")]');
$this->assertCount(0, $result, 'No autocompletion without access user profiles.');
- $admin_user = $this->drupalCreateUser(['administer nodes', 'create page content', 'access user profiles']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer nodes',
+ 'create page content',
+ 'access user profiles',
+ ]);
$this->drupalLogin($admin_user);
$this->drupalGet('node/add/page');
@@ -260,7 +273,9 @@ class NodeCreationTest extends NodeTestBase {
$this->drupalGet('node/add');
$this->assertSession()->statusCodeEquals(403);
- $admin_content_types = $this->drupalCreateUser(['administer content types']);
+ $admin_content_types = $this->drupalCreateUser([
+ 'administer content types',
+ ]);
$this->drupalLogin($admin_content_types);
$this->drupalGet('node/add');
diff --git a/web/core/modules/node/tests/src/Functional/NodeDisplayConfigurableTest.php b/web/core/modules/node/tests/src/Functional/NodeDisplayConfigurableTest.php
index 9193b6ef..994c30f1 100644
--- a/web/core/modules/node/tests/src/Functional/NodeDisplayConfigurableTest.php
+++ b/web/core/modules/node/tests/src/Functional/NodeDisplayConfigurableTest.php
@@ -32,7 +32,10 @@ class NodeDisplayConfigurableTest extends NodeTestBase {
$node_type->setDisplaySubmitted(TRUE);
$node_type->save();
- $user = $this->drupalCreateUser(['access in-place editing', 'administer nodes']);
+ $user = $this->drupalCreateUser([
+ 'access in-place editing',
+ 'administer nodes',
+ ]);
$this->drupalLogin($user);
$node = $this->drupalCreateNode(['uid' => $user->id()]);
$assert = $this->assertSession();
diff --git a/web/core/modules/node/tests/src/Functional/NodeEditFormTest.php b/web/core/modules/node/tests/src/Functional/NodeEditFormTest.php
index 62d0a610..8e39d084 100644
--- a/web/core/modules/node/tests/src/Functional/NodeEditFormTest.php
+++ b/web/core/modules/node/tests/src/Functional/NodeEditFormTest.php
@@ -48,8 +48,14 @@ class NodeEditFormTest extends NodeTestBase {
protected function setUp() {
parent::setUp();
- $this->webUser = $this->drupalCreateUser(['edit own page content', 'create page content']);
- $this->adminUser = $this->drupalCreateUser(['bypass node access', 'administer nodes']);
+ $this->webUser = $this->drupalCreateUser([
+ 'edit own page content',
+ 'create page content',
+ ]);
+ $this->adminUser = $this->drupalCreateUser([
+ 'bypass node access',
+ 'administer nodes',
+ ]);
$this->drupalPlaceBlock('local_tasks_block');
$this->nodeStorage = $this->container->get('entity_type.manager')->getStorage('node');
@@ -95,7 +101,10 @@ class NodeEditFormTest extends NodeTestBase {
$this->assertText($edit[$body_key], 'Body displayed.');
// Log in as a second administrator user.
- $second_web_user = $this->drupalCreateUser(['administer nodes', 'edit any page content']);
+ $second_web_user = $this->drupalCreateUser([
+ 'administer nodes',
+ 'edit any page content',
+ ]);
$this->drupalLogin($second_web_user);
// Edit the same node, creating a new revision.
$this->drupalGet("node/" . $node->id() . "/edit");
diff --git a/web/core/modules/node/tests/src/Functional/NodeEntityViewModeAlterTest.php b/web/core/modules/node/tests/src/Functional/NodeEntityViewModeAlterTest.php
index c51af5d4..31f32aba 100644
--- a/web/core/modules/node/tests/src/Functional/NodeEntityViewModeAlterTest.php
+++ b/web/core/modules/node/tests/src/Functional/NodeEntityViewModeAlterTest.php
@@ -28,7 +28,10 @@ class NodeEntityViewModeAlterTest extends NodeTestBase {
* Create a "Basic page" node and verify its consistency in the database.
*/
public function testNodeViewModeChange() {
- $web_user = $this->drupalCreateUser(['create page content', 'edit own page content']);
+ $web_user = $this->drupalCreateUser([
+ 'create page content',
+ 'edit own page content',
+ ]);
$this->drupalLogin($web_user);
// Create a node.
diff --git a/web/core/modules/node/tests/src/Functional/NodeFieldMultilingualTest.php b/web/core/modules/node/tests/src/Functional/NodeFieldMultilingualTest.php
index 2d1f9747..2bf6b30e 100644
--- a/web/core/modules/node/tests/src/Functional/NodeFieldMultilingualTest.php
+++ b/web/core/modules/node/tests/src/Functional/NodeFieldMultilingualTest.php
@@ -34,7 +34,13 @@ class NodeFieldMultilingualTest extends BrowserTestBase {
$this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
// Setup users.
- $admin_user = $this->drupalCreateUser(['administer languages', 'administer content types', 'access administration pages', 'create page content', 'edit own page content']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer languages',
+ 'administer content types',
+ 'access administration pages',
+ 'create page content',
+ 'edit own page content',
+ ]);
$this->drupalLogin($admin_user);
// Add a new language.
diff --git a/web/core/modules/node/tests/src/Functional/NodeFormSaveChangedTimeTest.php b/web/core/modules/node/tests/src/Functional/NodeFormSaveChangedTimeTest.php
index 6dfd5a73..f16453e2 100644
--- a/web/core/modules/node/tests/src/Functional/NodeFormSaveChangedTimeTest.php
+++ b/web/core/modules/node/tests/src/Functional/NodeFormSaveChangedTimeTest.php
@@ -44,7 +44,11 @@ class NodeFormSaveChangedTimeTest extends BrowserTestBase {
'name' => 'Article',
]);
- $this->authorUser = $this->drupalCreateUser(['access content', 'create article content', 'edit any article content'], 'author');
+ $this->authorUser = $this->drupalCreateUser([
+ 'access content',
+ 'create article content',
+ 'edit any article content',
+ ], 'author');
$this->drupalLogin($this->authorUser);
// Create one node of the above node type .
diff --git a/web/core/modules/node/tests/src/Functional/NodeLinksTest.php b/web/core/modules/node/tests/src/Functional/NodeLinksTest.php
index 31b222d5..67500661 100644
--- a/web/core/modules/node/tests/src/Functional/NodeLinksTest.php
+++ b/web/core/modules/node/tests/src/Functional/NodeLinksTest.php
@@ -35,7 +35,7 @@ class NodeLinksTest extends NodeTestBase {
// Links are displayed by default.
$this->drupalGet('node');
$this->assertText($node->getTitle());
- $this->assertLink('Read more');
+ $this->assertSession()->linkExists('Read more');
// Hide links.
\Drupal::service('entity_display.repository')
@@ -45,7 +45,7 @@ class NodeLinksTest extends NodeTestBase {
$this->drupalGet('node');
$this->assertText($node->getTitle());
- $this->assertNoLink('Read more');
+ $this->assertSession()->linkNotExists('Read more');
}
}
diff --git a/web/core/modules/node/tests/src/Functional/NodeLoadMultipleTest.php b/web/core/modules/node/tests/src/Functional/NodeLoadMultipleTest.php
index 5f503e35..effa4f52 100644
--- a/web/core/modules/node/tests/src/Functional/NodeLoadMultipleTest.php
+++ b/web/core/modules/node/tests/src/Functional/NodeLoadMultipleTest.php
@@ -25,7 +25,10 @@ class NodeLoadMultipleTest extends NodeTestBase {
protected function setUp() {
parent::setUp();
- $web_user = $this->drupalCreateUser(['create article content', 'create page content']);
+ $web_user = $this->drupalCreateUser([
+ 'create article content',
+ 'create page content',
+ ]);
$this->drupalLogin($web_user);
}
diff --git a/web/core/modules/node/tests/src/Functional/NodePostSettingsTest.php b/web/core/modules/node/tests/src/Functional/NodePostSettingsTest.php
index 5e788b50..02a6d460 100644
--- a/web/core/modules/node/tests/src/Functional/NodePostSettingsTest.php
+++ b/web/core/modules/node/tests/src/Functional/NodePostSettingsTest.php
@@ -18,7 +18,11 @@ class NodePostSettingsTest extends NodeTestBase {
protected function setUp() {
parent::setUp();
- $web_user = $this->drupalCreateUser(['create page content', 'administer content types', 'access user profiles']);
+ $web_user = $this->drupalCreateUser([
+ 'create page content',
+ 'administer content types',
+ 'access user profiles',
+ ]);
$this->drupalLogin($web_user);
}
diff --git a/web/core/modules/node/tests/src/Functional/NodeQueryAlterTest.php b/web/core/modules/node/tests/src/Functional/NodeQueryAlterTest.php
index 37713230..11ca8549 100644
--- a/web/core/modules/node/tests/src/Functional/NodeQueryAlterTest.php
+++ b/web/core/modules/node/tests/src/Functional/NodeQueryAlterTest.php
@@ -46,9 +46,19 @@ class NodeQueryAlterTest extends NodeTestBase {
// Create user with simple node access permission. The 'node test view'
// permission is implemented and granted by the node_access_test module.
- $this->accessUser = $this->drupalCreateUser(['access content overview', 'access content', 'node test view']);
- $this->noAccessUser = $this->drupalCreateUser(['access content overview', 'access content']);
- $this->noAccessUser2 = $this->drupalCreateUser(['access content overview', 'access content']);
+ $this->accessUser = $this->drupalCreateUser([
+ 'access content overview',
+ 'access content',
+ 'node test view',
+ ]);
+ $this->noAccessUser = $this->drupalCreateUser([
+ 'access content overview',
+ 'access content',
+ ]);
+ $this->noAccessUser2 = $this->drupalCreateUser([
+ 'access content overview',
+ 'access content',
+ ]);
}
/**
diff --git a/web/core/modules/node/tests/src/Functional/NodeRSSContentTest.php b/web/core/modules/node/tests/src/Functional/NodeRSSContentTest.php
index 6dd15922..fa81958d 100644
--- a/web/core/modules/node/tests/src/Functional/NodeRSSContentTest.php
+++ b/web/core/modules/node/tests/src/Functional/NodeRSSContentTest.php
@@ -33,7 +33,11 @@ class NodeRSSContentTest extends NodeTestBase {
// Use bypass node access permission here, because the test class uses
// hook_grants_alter() to deny access to everyone on node_access
// queries.
- $user = $this->drupalCreateUser(['bypass node access', 'access content', 'create article content']);
+ $user = $this->drupalCreateUser([
+ 'bypass node access',
+ 'access content',
+ 'create article content',
+ ]);
$this->drupalLogin($user);
}
diff --git a/web/core/modules/node/tests/src/Functional/NodeRevisionPermissionsTest.php b/web/core/modules/node/tests/src/Functional/NodeRevisionPermissionsTest.php
index 3418bcb2..12625c79 100644
--- a/web/core/modules/node/tests/src/Functional/NodeRevisionPermissionsTest.php
+++ b/web/core/modules/node/tests/src/Functional/NodeRevisionPermissionsTest.php
@@ -87,7 +87,10 @@ class NodeRevisionPermissionsTest extends NodeTestBase {
}
// Create an admin account (returns TRUE for all revision permissions).
- $admin_account = $this->drupalCreateUser(['access content', 'administer nodes']);
+ $admin_account = $this->drupalCreateUser([
+ 'access content',
+ 'administer nodes',
+ ]);
$admin_account->is_admin = TRUE;
$this->accounts['admin'] = $admin_account;
$accounts['admin'] = $admin_account;
diff --git a/web/core/modules/node/tests/src/Functional/NodeRevisionsUiBypassAccessTest.php b/web/core/modules/node/tests/src/Functional/NodeRevisionsUiBypassAccessTest.php
index d63bb7dc..c4062b07 100644
--- a/web/core/modules/node/tests/src/Functional/NodeRevisionsUiBypassAccessTest.php
+++ b/web/core/modules/node/tests/src/Functional/NodeRevisionsUiBypassAccessTest.php
@@ -76,7 +76,7 @@ class NodeRevisionsUiBypassAccessTest extends NodeTestBase {
$this->assertUrl($node->toUrl());
// Verify revisions exist since the content type has revisions enabled.
- $this->assertLink(t('Revisions'));
+ $this->assertSession()->linkExists(t('Revisions'));
// Verify the checkbox is checked on the node edit form.
$this->drupalGet('node/' . $node->id() . '/edit');
@@ -87,7 +87,7 @@ class NodeRevisionsUiBypassAccessTest extends NodeTestBase {
$this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save');
$this->assertUrl($node->toUrl());
- $this->assertLink(t('Revisions'));
+ $this->assertSession()->linkExists(t('Revisions'));
// Unset page revision setting 'create new revision'. This will mean new
// revisions are not created by default when the node is edited.
@@ -108,7 +108,7 @@ class NodeRevisionsUiBypassAccessTest extends NodeTestBase {
$this->assertUrl($node->toUrl());
// Verify that no link to revisions is displayed since the type
// has the 'create new revision' setting unset.
- $this->assertNoLink(t('Revisions'));
+ $this->assertSession()->linkNotExists(t('Revisions'));
// Verify the checkbox is unchecked on the node edit form.
$this->drupalGet('node/' . $node->id() . '/edit');
@@ -121,7 +121,7 @@ class NodeRevisionsUiBypassAccessTest extends NodeTestBase {
$this->assertUrl($node->toUrl());
// Verify that the link is displayed since a new revision is created and
// the 'create new revision' checkbox on the node is checked.
- $this->assertLink(t('Revisions'));
+ $this->assertSession()->linkExists(t('Revisions'));
}
}
diff --git a/web/core/modules/node/tests/src/Functional/NodeTitleTest.php b/web/core/modules/node/tests/src/Functional/NodeTitleTest.php
index ff6c432e..152aed37 100644
--- a/web/core/modules/node/tests/src/Functional/NodeTitleTest.php
+++ b/web/core/modules/node/tests/src/Functional/NodeTitleTest.php
@@ -41,7 +41,12 @@ class NodeTitleTest extends NodeTestBase {
$this->drupalPlaceBlock('system_breadcrumb_block');
$this->drupalPlaceBlock('page_title_block');
- $this->adminUser = $this->drupalCreateUser(['administer nodes', 'create article content', 'create page content', 'post comments']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'administer nodes',
+ 'create article content',
+ 'create page content',
+ 'post comments',
+ ]);
$this->drupalLogin($this->adminUser);
$this->addDefaultCommentField('node', 'page');
}
diff --git a/web/core/modules/node/tests/src/Functional/NodeTitleXSSTest.php b/web/core/modules/node/tests/src/Functional/NodeTitleXSSTest.php
index a5302e70..6207a0bb 100644
--- a/web/core/modules/node/tests/src/Functional/NodeTitleXSSTest.php
+++ b/web/core/modules/node/tests/src/Functional/NodeTitleXSSTest.php
@@ -22,7 +22,10 @@ class NodeTitleXSSTest extends NodeTestBase {
*/
public function testNodeTitleXSS() {
// Prepare a user to do the stuff.
- $web_user = $this->drupalCreateUser(['create page content', 'edit any page content']);
+ $web_user = $this->drupalCreateUser([
+ 'create page content',
+ 'edit any page content',
+ ]);
$this->drupalLogin($web_user);
$xss = '';
diff --git a/web/core/modules/node/tests/src/Functional/NodeTypeInitialLanguageTest.php b/web/core/modules/node/tests/src/Functional/NodeTypeInitialLanguageTest.php
index 8d970e7d..ee875d1b 100644
--- a/web/core/modules/node/tests/src/Functional/NodeTypeInitialLanguageTest.php
+++ b/web/core/modules/node/tests/src/Functional/NodeTypeInitialLanguageTest.php
@@ -26,7 +26,14 @@ class NodeTypeInitialLanguageTest extends NodeTestBase {
protected function setUp() {
parent::setUp();
- $web_user = $this->drupalCreateUser(['bypass node access', 'administer content types', 'administer node fields', 'administer node form display', 'administer node display', 'administer languages']);
+ $web_user = $this->drupalCreateUser([
+ 'bypass node access',
+ 'administer content types',
+ 'administer node fields',
+ 'administer node form display',
+ 'administer node display',
+ 'administer languages',
+ ]);
$this->drupalLogin($web_user);
}
diff --git a/web/core/modules/node/tests/src/Functional/NodeTypeTest.php b/web/core/modules/node/tests/src/Functional/NodeTypeTest.php
index 7e949825..b19b3d72 100644
--- a/web/core/modules/node/tests/src/Functional/NodeTypeTest.php
+++ b/web/core/modules/node/tests/src/Functional/NodeTypeTest.php
@@ -60,14 +60,19 @@ class NodeTypeTest extends NodeTestBase {
$this->assertTrue($type_exists, 'The new content type has been created in the database.');
// Log in a test user.
- $web_user = $this->drupalCreateUser(['create ' . $type->label() . ' content']);
+ $web_user = $this->drupalCreateUser([
+ 'create ' . $type->label() . ' content',
+ ]);
$this->drupalLogin($web_user);
$this->drupalGet('node/add/' . $type->id());
$this->assertSession()->statusCodeEquals(200);
// Create a content type via the user interface.
- $web_user = $this->drupalCreateUser(['bypass node access', 'administer content types']);
+ $web_user = $this->drupalCreateUser([
+ 'bypass node access',
+ 'administer content types',
+ ]);
$this->drupalLogin($web_user);
$this->drupalGet('node/add');
@@ -96,7 +101,11 @@ class NodeTypeTest extends NodeTestBase {
public function testNodeTypeEditing() {
$assert = $this->assertSession();
$this->drupalPlaceBlock('system_breadcrumb_block');
- $web_user = $this->drupalCreateUser(['bypass node access', 'administer content types', 'administer node fields']);
+ $web_user = $this->drupalCreateUser([
+ 'bypass node access',
+ 'administer content types',
+ 'administer node fields',
+ ]);
$this->drupalLogin($web_user);
$field = FieldConfig::loadByName('node', 'page', 'body');
@@ -202,7 +211,7 @@ class NodeTypeTest extends NodeTestBase {
// way installing a module through the UI does.
$this->resetAll();
$this->drupalGet('admin/structure/types/manage/default');
- $this->assertNoLink(t('Delete'));
+ $this->assertSession()->linkNotExists(t('Delete'));
$this->drupalGet('admin/structure/types/manage/default/delete');
$this->assertSession()->statusCodeEquals(403);
$this->container->get('module_installer')->uninstall(['node_test_config']);
@@ -221,7 +230,10 @@ class NodeTypeTest extends NodeTestBase {
*/
public function testNodeTypeFieldUiPermissions() {
// Create an admin user who can only manage node fields.
- $admin_user_1 = $this->drupalCreateUser(['administer content types', 'administer node fields']);
+ $admin_user_1 = $this->drupalCreateUser([
+ 'administer content types',
+ 'administer node fields',
+ ]);
$this->drupalLogin($admin_user_1);
// Test that the user only sees the actions available to them.
@@ -230,7 +242,10 @@ class NodeTypeTest extends NodeTestBase {
$this->assertNoLinkByHref('admin/structure/types/manage/article/display');
// Create another admin user who can manage node fields display.
- $admin_user_2 = $this->drupalCreateUser(['administer content types', 'administer node display']);
+ $admin_user_2 = $this->drupalCreateUser([
+ 'administer content types',
+ 'administer node display',
+ ]);
$this->drupalLogin($admin_user_2);
// Test that the user only sees the actions available to them.
diff --git a/web/core/modules/node/tests/src/Functional/PagePreviewTest.php b/web/core/modules/node/tests/src/Functional/PagePreviewTest.php
index aa9c6477..0b9bb2d7 100644
--- a/web/core/modules/node/tests/src/Functional/PagePreviewTest.php
+++ b/web/core/modules/node/tests/src/Functional/PagePreviewTest.php
@@ -59,7 +59,11 @@ class PagePreviewTest extends NodeTestBase {
parent::setUp();
$this->addDefaultCommentField('node', 'page');
- $web_user = $this->drupalCreateUser(['edit own page content', 'create page content', 'administer menu']);
+ $web_user = $this->drupalCreateUser([
+ 'edit own page content',
+ 'create page content',
+ 'administer menu',
+ ]);
$this->drupalLogin($web_user);
// Add a vocabulary so we can test different view modes.
@@ -200,10 +204,10 @@ class PagePreviewTest extends NodeTestBase {
// Check that the preview is displaying the title, body and term.
$expected_title = $edit[$title_key] . ' | Drupal';
$this->assertSession()->titleEquals($expected_title);
- $this->assertEscaped($edit[$title_key], 'Title displayed and escaped.');
+ $this->assertEscaped($edit[$title_key]);
$this->assertText($edit[$body_key], 'Body displayed.');
$this->assertText($edit[$term_key], 'Term displayed.');
- $this->assertLink(t('Back to content editing'));
+ $this->assertSession()->linkExists(t('Back to content editing'));
// Check that we see the class of the node type on the body element.
$body_class_element = $this->xpath("//body[contains(@class, 'page-node-type-page')]");
@@ -240,10 +244,10 @@ class PagePreviewTest extends NodeTestBase {
// Return to page preview to check everything is as expected.
$this->drupalPostForm(NULL, [], t('Preview'));
$this->assertSession()->titleEquals($expected_title);
- $this->assertEscaped($edit[$title_key], 'Title displayed and escaped.');
+ $this->assertEscaped($edit[$title_key]);
$this->assertText($edit[$body_key], 'Body displayed.');
$this->assertText($edit[$term_key], 'Term displayed.');
- $this->assertLink(t('Back to content editing'));
+ $this->assertSession()->linkExists(t('Back to content editing'));
// Assert the content is kept when reloading the page.
$this->drupalGet('node/add/page', ['query' => ['uuid' => $uuid]]);
@@ -274,9 +278,9 @@ class PagePreviewTest extends NodeTestBase {
$this->assertRaw('>' . $newterm1 . '<', 'First new term displayed.');
$this->assertRaw('>' . $newterm2 . '<', 'Second new term displayed.');
// The first term should be displayed as link, the others not.
- $this->assertLink($this->term->getName());
- $this->assertNoLink($newterm1);
- $this->assertNoLink($newterm2);
+ $this->assertSession()->linkExists($this->term->getName());
+ $this->assertSession()->linkNotExists($newterm1);
+ $this->assertSession()->linkNotExists($newterm2);
$this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
@@ -290,9 +294,9 @@ class PagePreviewTest extends NodeTestBase {
$this->assertRaw('>' . $newterm2 . '<', 'Second existing term displayed.');
$this->assertRaw('>' . $newterm3 . '<', 'Third new term displayed.');
$this->assertNoText($this->term->getName());
- $this->assertLink($newterm1);
- $this->assertLink($newterm2);
- $this->assertNoLink($newterm3);
+ $this->assertSession()->linkExists($newterm1);
+ $this->assertSession()->linkExists($newterm2);
+ $this->assertSession()->linkNotExists($newterm3);
// Check that editing an existing node after it has been previewed and not
// saved doesn't remember the previous changes.
diff --git a/web/core/modules/node/tests/src/Functional/Views/BulkFormAccessTest.php b/web/core/modules/node/tests/src/Functional/Views/BulkFormAccessTest.php
index 0de0ed12..79231fcf 100644
--- a/web/core/modules/node/tests/src/Functional/Views/BulkFormAccessTest.php
+++ b/web/core/modules/node/tests/src/Functional/Views/BulkFormAccessTest.php
@@ -161,7 +161,12 @@ class BulkFormAccessTest extends NodeTestBase {
'uid' => $author->id(),
]);
// Create an account that may view the private node, but not delete it.
- $account = $this->drupalCreateUser(['access content', 'administer nodes', 'delete own article content', 'node test view']);
+ $account = $this->drupalCreateUser([
+ 'access content',
+ 'administer nodes',
+ 'delete own article content',
+ 'node test view',
+ ]);
// Create a node that may be deleted too, to ensure the delete confirmation
// page is shown later. In node_access_test.module, nodes may only be
// deleted by the author.
diff --git a/web/core/modules/node/tests/src/Functional/Views/BulkFormTest.php b/web/core/modules/node/tests/src/Functional/Views/BulkFormTest.php
index 99a9534c..2e57f5e7 100644
--- a/web/core/modules/node/tests/src/Functional/Views/BulkFormTest.php
+++ b/web/core/modules/node/tests/src/Functional/Views/BulkFormTest.php
@@ -91,7 +91,11 @@ class BulkFormTest extends NodeTestBase {
$this->assertCount(10, $view->result, 'All created translations are selected.');
// Check the operations are accessible to the logged in user.
- $this->drupalLogin($this->drupalCreateUser(['administer nodes', 'access content overview', 'bypass node access']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer nodes',
+ 'access content overview',
+ 'bypass node access',
+ ]));
$this->drupalGet('test-node-bulk-form');
$elements = $this->xpath('//select[@id="edit-action"]//option');
$this->assertCount(8, $elements, 'All node operations are found.');
diff --git a/web/core/modules/node/tests/src/Functional/Views/FilterNodeAccessTest.php b/web/core/modules/node/tests/src/Functional/Views/FilterNodeAccessTest.php
index e5597d07..6040a673 100644
--- a/web/core/modules/node/tests/src/Functional/Views/FilterNodeAccessTest.php
+++ b/web/core/modules/node/tests/src/Functional/Views/FilterNodeAccessTest.php
@@ -53,7 +53,10 @@ class FilterNodeAccessTest extends NodeTestBase {
$this->users = [];
for ($i = 0; $i < $num_simple_users; $i++) {
- $this->users[$i] = $this->drupalCreateUser(['access content', 'create article content']);
+ $this->users[$i] = $this->drupalCreateUser([
+ 'access content',
+ 'create article content',
+ ]);
}
foreach ($this->users as $web_user) {
$this->drupalLogin($web_user);
@@ -100,7 +103,10 @@ class FilterNodeAccessTest extends NodeTestBase {
$this->assertNoText('Private Article created by ' . $this->users[0]->getAccountName());
// Test that a user with administer nodes permission can't see all nodes.
- $administer_nodes_user = $this->drupalCreateUser(['access content', 'administer nodes']);
+ $administer_nodes_user = $this->drupalCreateUser([
+ 'access content',
+ 'administer nodes',
+ ]);
$this->drupalLogin($administer_nodes_user);
$this->drupalGet('test_filter_node_access');
$this->assertNoText('Private Article created by ' . $this->users[0]->getAccountName());
@@ -109,7 +115,10 @@ class FilterNodeAccessTest extends NodeTestBase {
$this->assertText('Public Article created by ' . $this->users[1]->getAccountName());
// Test that a user with bypass node access can see all nodes.
- $bypass_access_user = $this->drupalCreateUser(['access content', 'bypass node access']);
+ $bypass_access_user = $this->drupalCreateUser([
+ 'access content',
+ 'bypass node access',
+ ]);
$this->drupalLogin($bypass_access_user);
$this->drupalGet('test_filter_node_access');
$this->assertText('Private Article created by ' . $this->users[0]->getAccountName());
diff --git a/web/core/modules/node/tests/src/Functional/Views/NodeLanguageTest.php b/web/core/modules/node/tests/src/Functional/Views/NodeLanguageTest.php
index 012f6dd5..d506f694 100644
--- a/web/core/modules/node/tests/src/Functional/Views/NodeLanguageTest.php
+++ b/web/core/modules/node/tests/src/Functional/Views/NodeLanguageTest.php
@@ -103,7 +103,10 @@ class NodeLanguageTest extends NodeTestBase {
$this->container->get('router.builder')->rebuild();
- $user = $this->drupalCreateUser(['access content overview', 'access content']);
+ $user = $this->drupalCreateUser([
+ 'access content overview',
+ 'access content',
+ ]);
$this->drupalLogin($user);
}
diff --git a/web/core/modules/node/tests/src/Functional/Views/RevisionLinkTest.php b/web/core/modules/node/tests/src/Functional/Views/RevisionLinkTest.php
index 55c4d008..64b930bb 100644
--- a/web/core/modules/node/tests/src/Functional/Views/RevisionLinkTest.php
+++ b/web/core/modules/node/tests/src/Functional/Views/RevisionLinkTest.php
@@ -32,7 +32,13 @@ class RevisionLinkTest extends NodeTestBase {
// Create one user which can view/revert and delete and one which can only
// do one of them.
$this->drupalCreateContentType(['name' => 'page', 'type' => 'page']);
- $account = $this->drupalCreateUser(['revert all revisions', 'view all revisions', 'delete all revisions', 'edit any page content', 'delete any page content']);
+ $account = $this->drupalCreateUser([
+ 'revert all revisions',
+ 'view all revisions',
+ 'delete all revisions',
+ 'edit any page content',
+ 'delete any page content',
+ ]);
$this->drupalLogin($account);
// Create two nodes, one without an additional revision and one with a
// revision.
@@ -70,8 +76,14 @@ class RevisionLinkTest extends NodeTestBase {
$accounts = [
'view' => $this->drupalCreateUser(['view all revisions']),
- 'revert' => $this->drupalCreateUser(['revert all revisions', 'edit any page content']),
- 'delete' => $this->drupalCreateUser(['delete all revisions', 'delete any page content']),
+ 'revert' => $this->drupalCreateUser([
+ 'revert all revisions',
+ 'edit any page content',
+ ]),
+ 'delete' => $this->drupalCreateUser([
+ 'delete all revisions',
+ 'delete any page content',
+ ]),
];
$url = $nodes[1]->toUrl()->toString();
diff --git a/web/core/modules/node/tests/src/Kernel/NodeAccessLanguageTest.php b/web/core/modules/node/tests/src/Kernel/NodeAccessLanguageTest.php
index c6314385..da96fc10 100644
--- a/web/core/modules/node/tests/src/Kernel/NodeAccessLanguageTest.php
+++ b/web/core/modules/node/tests/src/Kernel/NodeAccessLanguageTest.php
@@ -150,7 +150,10 @@ class NodeAccessLanguageTest extends NodeAccessTestBase {
// Creating a private node with langcode Catalan to test that the
// node_access_test_secret_catalan flag works.
- $private_ca_user = $this->drupalCreateUser(['access content', 'node test view']);
+ $private_ca_user = $this->drupalCreateUser([
+ 'access content',
+ 'node test view',
+ ]);
$node_private_ca = $this->drupalCreateNode(['body' => [[]], 'langcode' => 'ca', 'private' => TRUE]);
$this->assertTrue($node_private_ca->language()->getId() == 'ca', 'Node created as Catalan.');
diff --git a/web/core/modules/options/tests/src/Functional/OptionsFieldUITest.php b/web/core/modules/options/tests/src/Functional/OptionsFieldUITest.php
index f4e1683b..607260e8 100644
--- a/web/core/modules/options/tests/src/Functional/OptionsFieldUITest.php
+++ b/web/core/modules/options/tests/src/Functional/OptionsFieldUITest.php
@@ -64,7 +64,17 @@ class OptionsFieldUITest extends FieldTestBase {
parent::setUp();
// Create test user.
- $admin_user = $this->drupalCreateUser(['access content', 'administer taxonomy', 'access administration pages', 'administer site configuration', 'administer content types', 'administer nodes', 'bypass node access', 'administer node fields', 'administer node display']);
+ $admin_user = $this->drupalCreateUser([
+ 'access content',
+ 'administer taxonomy',
+ 'access administration pages',
+ 'administer site configuration',
+ 'administer content types',
+ 'administer nodes',
+ 'bypass node access',
+ 'administer node fields',
+ 'administer node display',
+ ]);
$this->drupalLogin($admin_user);
// Create content type, with underscores.
diff --git a/web/core/modules/options/tests/src/Functional/OptionsFloatFieldImportTest.php b/web/core/modules/options/tests/src/Functional/OptionsFloatFieldImportTest.php
index 8b3ef782..00fa57e5 100644
--- a/web/core/modules/options/tests/src/Functional/OptionsFloatFieldImportTest.php
+++ b/web/core/modules/options/tests/src/Functional/OptionsFloatFieldImportTest.php
@@ -35,7 +35,17 @@ class OptionsFloatFieldImportTest extends FieldTestBase {
parent::setUp();
// Create test user.
- $admin_user = $this->drupalCreateUser(['synchronize configuration', 'access content', 'access administration pages', 'administer site configuration', 'administer content types', 'administer nodes', 'bypass node access', 'administer node fields', 'administer node display']);
+ $admin_user = $this->drupalCreateUser([
+ 'synchronize configuration',
+ 'access content',
+ 'access administration pages',
+ 'administer site configuration',
+ 'administer content types',
+ 'administer nodes',
+ 'bypass node access',
+ 'administer node fields',
+ 'administer node display',
+ ]);
$this->drupalLogin($admin_user);
}
diff --git a/web/core/modules/options/tests/src/Functional/OptionsSelectDynamicValuesTest.php b/web/core/modules/options/tests/src/Functional/OptionsSelectDynamicValuesTest.php
index 6738dbf6..a0f88aa5 100644
--- a/web/core/modules/options/tests/src/Functional/OptionsSelectDynamicValuesTest.php
+++ b/web/core/modules/options/tests/src/Functional/OptionsSelectDynamicValuesTest.php
@@ -22,7 +22,10 @@ class OptionsSelectDynamicValuesTest extends OptionsDynamicValuesTestBase {
$this->entity->save();
// Create a web user.
- $web_user = $this->drupalCreateUser(['view test entity', 'administer entity_test content']);
+ $web_user = $this->drupalCreateUser([
+ 'view test entity',
+ 'administer entity_test content',
+ ]);
$this->drupalLogin($web_user);
// Display form.
diff --git a/web/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php b/web/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php
index 7b3ac433..306121a0 100644
--- a/web/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php
+++ b/web/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php
@@ -112,7 +112,10 @@ class OptionsWidgetsTest extends FieldTestBase {
$this->float->save();
// Create a web user.
- $this->drupalLogin($this->drupalCreateUser(['view test entity', 'administer entity_test content']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'view test entity',
+ 'administer entity_test content',
+ ]));
}
/**
diff --git a/web/core/modules/path/tests/src/Functional/PathAdminTest.php b/web/core/modules/path/tests/src/Functional/PathAdminTest.php
index 2ac11efa..dbf4154d 100644
--- a/web/core/modules/path/tests/src/Functional/PathAdminTest.php
+++ b/web/core/modules/path/tests/src/Functional/PathAdminTest.php
@@ -25,7 +25,12 @@ class PathAdminTest extends PathTestBase {
parent::setUp();
// Create test user and log in.
- $web_user = $this->drupalCreateUser(['create page content', 'edit own page content', 'administer url aliases', 'create url aliases']);
+ $web_user = $this->drupalCreateUser([
+ 'create page content',
+ 'edit own page content',
+ 'administer url aliases',
+ 'create url aliases',
+ ]);
$this->drupalLogin($web_user);
}
diff --git a/web/core/modules/path/tests/src/Functional/PathAliasTest.php b/web/core/modules/path/tests/src/Functional/PathAliasTest.php
index b3250695..92165357 100644
--- a/web/core/modules/path/tests/src/Functional/PathAliasTest.php
+++ b/web/core/modules/path/tests/src/Functional/PathAliasTest.php
@@ -30,7 +30,13 @@ class PathAliasTest extends PathTestBase {
parent::setUp();
// Create test user and log in.
- $web_user = $this->drupalCreateUser(['create page content', 'edit own page content', 'administer url aliases', 'create url aliases', 'access content overview']);
+ $web_user = $this->drupalCreateUser([
+ 'create page content',
+ 'edit own page content',
+ 'administer url aliases',
+ 'create url aliases',
+ 'access content overview',
+ ]);
$this->drupalLogin($web_user);
}
diff --git a/web/core/modules/path/tests/src/Functional/PathLanguageUiTest.php b/web/core/modules/path/tests/src/Functional/PathLanguageUiTest.php
index 6ab6e2c2..34268d41 100644
--- a/web/core/modules/path/tests/src/Functional/PathLanguageUiTest.php
+++ b/web/core/modules/path/tests/src/Functional/PathLanguageUiTest.php
@@ -27,7 +27,14 @@ class PathLanguageUiTest extends PathTestBase {
parent::setUp();
// Create and log in user.
- $web_user = $this->drupalCreateUser(['edit any page content', 'create page content', 'administer url aliases', 'create url aliases', 'administer languages', 'access administration pages']);
+ $web_user = $this->drupalCreateUser([
+ 'edit any page content',
+ 'create page content',
+ 'administer url aliases',
+ 'create url aliases',
+ 'administer languages',
+ 'access administration pages',
+ ]);
$this->drupalLogin($web_user);
// Enable French language.
diff --git a/web/core/modules/path/tests/src/Functional/PathNodeFormTest.php b/web/core/modules/path/tests/src/Functional/PathNodeFormTest.php
index 66c6198c..cf009193 100644
--- a/web/core/modules/path/tests/src/Functional/PathNodeFormTest.php
+++ b/web/core/modules/path/tests/src/Functional/PathNodeFormTest.php
@@ -25,7 +25,10 @@ class PathNodeFormTest extends PathTestBase {
parent::setUp();
// Create test user and log in.
- $web_user = $this->drupalCreateUser(['create page content', 'create url aliases']);
+ $web_user = $this->drupalCreateUser([
+ 'create page content',
+ 'create url aliases',
+ ]);
$this->drupalLogin($web_user);
}
diff --git a/web/core/modules/path/tests/src/Functional/PathTaxonomyTermTest.php b/web/core/modules/path/tests/src/Functional/PathTaxonomyTermTest.php
index 5bb92e2e..586fae10 100644
--- a/web/core/modules/path/tests/src/Functional/PathTaxonomyTermTest.php
+++ b/web/core/modules/path/tests/src/Functional/PathTaxonomyTermTest.php
@@ -35,7 +35,11 @@ class PathTaxonomyTermTest extends PathTestBase {
$vocabulary->save();
// Create and log in user.
- $web_user = $this->drupalCreateUser(['administer url aliases', 'administer taxonomy', 'access administration pages']);
+ $web_user = $this->drupalCreateUser([
+ 'administer url aliases',
+ 'administer taxonomy',
+ 'access administration pages',
+ ]);
$this->drupalLogin($web_user);
}
diff --git a/web/core/modules/quickedit/src/MetadataGeneratorInterface.php b/web/core/modules/quickedit/src/MetadataGeneratorInterface.php
index a319ae43..a739fb2b 100644
--- a/web/core/modules/quickedit/src/MetadataGeneratorInterface.php
+++ b/web/core/modules/quickedit/src/MetadataGeneratorInterface.php
@@ -15,6 +15,7 @@ interface MetadataGeneratorInterface {
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity, in the language in which one of its fields is being edited.
+ *
* @return array
* An array containing metadata with the following keys:
* - label: the user-visible label for the entity in the given language.
@@ -28,6 +29,7 @@ interface MetadataGeneratorInterface {
* The field values to be in-place edited.
* @param string $view_mode
* The view mode the field should be rerendered in.
+ *
* @return array
* An array containing metadata with the following keys:
* - label: the user-visible label for the field.
diff --git a/web/core/modules/rdf/tests/src/Functional/CommentAttributesTest.php b/web/core/modules/rdf/tests/src/Functional/CommentAttributesTest.php
index 5c80dc18..129e348a 100644
--- a/web/core/modules/rdf/tests/src/Functional/CommentAttributesTest.php
+++ b/web/core/modules/rdf/tests/src/Functional/CommentAttributesTest.php
@@ -158,7 +158,7 @@ class CommentAttributesTest extends CommentTestBase {
// Ensure that the author link still works properly after the author output
// is modified by the RDF module.
$this->drupalGet('node/' . $this->node->id());
- $this->assertLink($this->webUser->getAccountName());
+ $this->assertSession()->linkExists($this->webUser->getAccountName());
$this->assertLinkByHref('user/' . $this->webUser->id());
}
diff --git a/web/core/modules/rdf/tests/src/Functional/EntityReferenceFieldAttributesTest.php b/web/core/modules/rdf/tests/src/Functional/EntityReferenceFieldAttributesTest.php
index ce76ba31..d662a3fc 100644
--- a/web/core/modules/rdf/tests/src/Functional/EntityReferenceFieldAttributesTest.php
+++ b/web/core/modules/rdf/tests/src/Functional/EntityReferenceFieldAttributesTest.php
@@ -52,7 +52,10 @@ class EntityReferenceFieldAttributesTest extends TaxonomyTestBase {
protected function setUp() {
parent::setUp();
- $web_user = $this->drupalCreateUser(['bypass node access', 'administer taxonomy']);
+ $web_user = $this->drupalCreateUser([
+ 'bypass node access',
+ 'administer taxonomy',
+ ]);
$this->drupalLogin($web_user);
$this->vocabulary = $this->createVocabulary();
diff --git a/web/core/modules/rest/src/Routing/ResourceRoutes.php b/web/core/modules/rest/src/Routing/ResourceRoutes.php
index 0588a012..9809ee07 100644
--- a/web/core/modules/rest/src/Routing/ResourceRoutes.php
+++ b/web/core/modules/rest/src/Routing/ResourceRoutes.php
@@ -58,6 +58,7 @@ class ResourceRoutes implements EventSubscriberInterface {
*
* @param \Drupal\Core\Routing\RouteBuildEvent $event
* The route build event.
+ *
* @return array
*/
public function onDynamicRouteEvent(RouteBuildEvent $event) {
diff --git a/web/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php b/web/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php
index 40165c81..7bbfb27a 100644
--- a/web/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php
+++ b/web/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php
@@ -77,7 +77,12 @@ class StyleSerializerTest extends ViewTestBase {
ViewTestData::createTestViews(get_class($this), ['rest_test_views']);
- $this->adminUser = $this->drupalCreateUser(['administer views', 'administer entity_test content', 'access user profiles', 'view test entity']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'administer views',
+ 'administer entity_test content',
+ 'access user profiles',
+ 'view test entity',
+ ]);
// Save some entity_test entities.
for ($i = 1; $i <= 10; $i++) {
diff --git a/web/core/modules/search/tests/src/Functional/SearchAdvancedSearchFormTest.php b/web/core/modules/search/tests/src/Functional/SearchAdvancedSearchFormTest.php
index 099663ed..9907445d 100644
--- a/web/core/modules/search/tests/src/Functional/SearchAdvancedSearchFormTest.php
+++ b/web/core/modules/search/tests/src/Functional/SearchAdvancedSearchFormTest.php
@@ -35,7 +35,12 @@ class SearchAdvancedSearchFormTest extends BrowserTestBase {
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
// Create and log in user.
- $test_user = $this->drupalCreateUser(['access content', 'search content', 'use advanced search', 'administer nodes']);
+ $test_user = $this->drupalCreateUser([
+ 'access content',
+ 'search content',
+ 'use advanced search',
+ 'administer nodes',
+ ]);
$this->drupalLogin($test_user);
// Create initial node.
diff --git a/web/core/modules/search/tests/src/Functional/SearchBlockTest.php b/web/core/modules/search/tests/src/Functional/SearchBlockTest.php
index bef16435..261f8d14 100644
--- a/web/core/modules/search/tests/src/Functional/SearchBlockTest.php
+++ b/web/core/modules/search/tests/src/Functional/SearchBlockTest.php
@@ -134,7 +134,7 @@ class SearchBlockTest extends BrowserTestBase {
$name = $this->adminUser->getAccountName();
$email = $this->adminUser->getEmail();
$this->drupalPostForm('node', ['keys' => $name], t('Search'));
- $this->assertLink($name);
+ $this->assertSession()->linkExists($name);
}
}
diff --git a/web/core/modules/search/tests/src/Functional/SearchCommentCountToggleTest.php b/web/core/modules/search/tests/src/Functional/SearchCommentCountToggleTest.php
index 03520359..a6fcd2b2 100644
--- a/web/core/modules/search/tests/src/Functional/SearchCommentCountToggleTest.php
+++ b/web/core/modules/search/tests/src/Functional/SearchCommentCountToggleTest.php
@@ -52,7 +52,13 @@ class SearchCommentCountToggleTest extends BrowserTestBase {
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
// Create searching user.
- $this->searchingUser = $this->drupalCreateUser(['search content', 'access content', 'access comments', 'post comments', 'skip comment approval']);
+ $this->searchingUser = $this->drupalCreateUser([
+ 'search content',
+ 'access content',
+ 'access comments',
+ 'post comments',
+ 'skip comment approval',
+ ]);
// Log in with sufficient privileges.
$this->drupalLogin($this->searchingUser);
diff --git a/web/core/modules/search/tests/src/Functional/SearchCommentTest.php b/web/core/modules/search/tests/src/Functional/SearchCommentTest.php
index c513be8d..9d280d4d 100644
--- a/web/core/modules/search/tests/src/Functional/SearchCommentTest.php
+++ b/web/core/modules/search/tests/src/Functional/SearchCommentTest.php
@@ -173,7 +173,7 @@ class SearchCommentTest extends BrowserTestBase {
// Verify that comment is rendered using proper format.
$this->assertText($comment_body, 'Comment body text found in search results.');
$this->assertNoRaw(t('n/a'), 'HTML in comment body is not hidden.');
- $this->assertNoEscaped($edit_comment['comment_body[0][value]'], 'HTML in comment body is not escaped.');
+ $this->assertNoEscaped($edit_comment['comment_body[0][value]']);
// Search for the evil script comment subject.
$edit = [
diff --git a/web/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php b/web/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php
index b1d119ac..9d0c1f5f 100644
--- a/web/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php
+++ b/web/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php
@@ -52,7 +52,16 @@ class SearchConfigSettingsFormTest extends BrowserTestBase {
$this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
// Log in as a user that can create and search content.
- $this->searchUser = $this->drupalCreateUser(['search content', 'administer search', 'administer nodes', 'bypass node access', 'access user profiles', 'administer users', 'administer blocks', 'access site reports']);
+ $this->searchUser = $this->drupalCreateUser([
+ 'search content',
+ 'administer search',
+ 'administer nodes',
+ 'bypass node access',
+ 'access user profiles',
+ 'administer users',
+ 'administer blocks',
+ 'access site reports',
+ ]);
$this->drupalLogin($this->searchUser);
// Add a single piece of content and index it.
@@ -104,7 +113,7 @@ class SearchConfigSettingsFormTest extends BrowserTestBase {
$text = $this->randomMachineName(5);
$this->drupalPostForm('search/node', ['keys' => $text], t('Search'));
$this->drupalGet('admin/reports/dblog');
- $this->assertNoLink('Searched Content for ' . $text . '.', 'Search was not logged');
+ $this->assertSession()->linkNotExists('Searched Content for ' . $text . '.', 'Search was not logged');
// Turn on logging.
$edit = ['logging' => TRUE];
@@ -112,7 +121,7 @@ class SearchConfigSettingsFormTest extends BrowserTestBase {
$text = $this->randomMachineName(5);
$this->drupalPostForm('search/node', ['keys' => $text], t('Search'));
$this->drupalGet('admin/reports/dblog');
- $this->assertLink('Searched Content for ' . $text . '.', 0, 'Search was logged');
+ $this->assertSession()->linkExists('Searched Content for ' . $text . '.', 0, 'Search was logged');
}
@@ -314,7 +323,7 @@ class SearchConfigSettingsFormTest extends BrowserTestBase {
// Disable the first search page.
$this->clickLink(t('Disable'));
$this->assertSession()->statusCodeEquals(200);
- $this->assertNoLink(t('Disable'));
+ $this->assertSession()->linkNotExists(t('Disable'));
$this->verifySearchPageOperations($first_id, TRUE, TRUE, FALSE, TRUE);
$this->verifySearchPageOperations($second_id, TRUE, FALSE, FALSE, FALSE);
diff --git a/web/core/modules/search/tests/src/Functional/SearchDateIntervalTest.php b/web/core/modules/search/tests/src/Functional/SearchDateIntervalTest.php
index f2b05c76..e8d5b81c 100644
--- a/web/core/modules/search/tests/src/Functional/SearchDateIntervalTest.php
+++ b/web/core/modules/search/tests/src/Functional/SearchDateIntervalTest.php
@@ -33,7 +33,15 @@ class SearchDateIntervalTest extends BrowserTestBase {
$this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
// Create and log in user.
- $test_user = $this->drupalCreateUser(['access content', 'search content', 'use advanced search', 'administer nodes', 'administer languages', 'access administration pages', 'administer site configuration']);
+ $test_user = $this->drupalCreateUser([
+ 'access content',
+ 'search content',
+ 'use advanced search',
+ 'administer nodes',
+ 'administer languages',
+ 'access administration pages',
+ 'administer site configuration',
+ ]);
$this->drupalLogin($test_user);
// Add a new language.
@@ -78,8 +86,8 @@ class SearchDateIntervalTest extends BrowserTestBase {
// The nodes must have the same node ID but the created date is different.
// So only the Spanish translation must appear.
- $this->assertLink('Node ES', 0, 'Spanish translation found in search results');
- $this->assertNoLink('Node EN', 'Search results do not contain English node');
+ $this->assertSession()->linkExists('Node ES', 0, 'Spanish translation found in search results');
+ $this->assertSession()->linkNotExists('Node EN', 'Search results do not contain English node');
}
}
diff --git a/web/core/modules/search/tests/src/Functional/SearchEmbedFormTest.php b/web/core/modules/search/tests/src/Functional/SearchEmbedFormTest.php
index 80033b4d..ad2d3850 100644
--- a/web/core/modules/search/tests/src/Functional/SearchEmbedFormTest.php
+++ b/web/core/modules/search/tests/src/Functional/SearchEmbedFormTest.php
@@ -41,7 +41,11 @@ class SearchEmbedFormTest extends BrowserTestBase {
$this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
// Create a user and a node, and update the search index.
- $test_user = $this->drupalCreateUser(['access content', 'search content', 'administer nodes']);
+ $test_user = $this->drupalCreateUser([
+ 'access content',
+ 'search content',
+ 'administer nodes',
+ ]);
$this->drupalLogin($test_user);
$this->node = $this->drupalCreateNode();
diff --git a/web/core/modules/search/tests/src/Functional/SearchKeywordsConditionsTest.php b/web/core/modules/search/tests/src/Functional/SearchKeywordsConditionsTest.php
index 58e97f1c..35a4428e 100644
--- a/web/core/modules/search/tests/src/Functional/SearchKeywordsConditionsTest.php
+++ b/web/core/modules/search/tests/src/Functional/SearchKeywordsConditionsTest.php
@@ -42,7 +42,12 @@ class SearchKeywordsConditionsTest extends BrowserTestBase {
parent::setUp();
// Create searching user.
- $this->searchingUser = $this->drupalCreateUser(['search content', 'access content', 'access comments', 'skip comment approval']);
+ $this->searchingUser = $this->drupalCreateUser([
+ 'search content',
+ 'access content',
+ 'access comments',
+ 'skip comment approval',
+ ]);
// Log in with sufficient privileges.
$this->drupalLogin($this->searchingUser);
}
diff --git a/web/core/modules/search/tests/src/Functional/SearchLanguageTest.php b/web/core/modules/search/tests/src/Functional/SearchLanguageTest.php
index f30787ca..63b04481 100644
--- a/web/core/modules/search/tests/src/Functional/SearchLanguageTest.php
+++ b/web/core/modules/search/tests/src/Functional/SearchLanguageTest.php
@@ -37,7 +37,15 @@ class SearchLanguageTest extends BrowserTestBase {
$this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
// Create and log in user.
- $test_user = $this->drupalCreateUser(['access content', 'search content', 'use advanced search', 'administer nodes', 'administer languages', 'access administration pages', 'administer site configuration']);
+ $test_user = $this->drupalCreateUser([
+ 'access content',
+ 'search content',
+ 'use advanced search',
+ 'administer nodes',
+ 'administer languages',
+ 'access administration pages',
+ 'administer site configuration',
+ ]);
$this->drupalLogin($test_user);
// Add a new language.
@@ -121,12 +129,12 @@ class SearchLanguageTest extends BrowserTestBase {
$edit = ['keys' => 'node', 'language[es]' => TRUE];
$this->drupalPostForm('search/node', $edit, 'edit-submit--2');
// Check for Spanish results.
- $this->assertLink('Second node this is the Spanish title', 0, 'Second node Spanish title found in search results');
- $this->assertLink('Third node es', 0, 'Third node Spanish found in search results');
+ $this->assertSession()->linkExists('Second node this is the Spanish title', 0, 'Second node Spanish title found in search results');
+ $this->assertSession()->linkExists('Third node es', 0, 'Third node Spanish found in search results');
// Ensure that results don't contain other language nodes.
- $this->assertNoLink('First node en', 'Search results do not contain first English node');
- $this->assertNoLink('Second node en', 'Search results do not contain second English node');
- $this->assertNoLink('Third node en', 'Search results do not contain third English node');
+ $this->assertSession()->linkNotExists('First node en', 'Search results do not contain first English node');
+ $this->assertSession()->linkNotExists('Second node en', 'Search results do not contain second English node');
+ $this->assertSession()->linkNotExists('Third node en', 'Search results do not contain third English node');
// Change the default language and delete English.
$path = 'admin/config/regional/language';
diff --git a/web/core/modules/search/tests/src/Functional/SearchMultilingualEntityTest.php b/web/core/modules/search/tests/src/Functional/SearchMultilingualEntityTest.php
index e3197150..ed9d9443 100644
--- a/web/core/modules/search/tests/src/Functional/SearchMultilingualEntityTest.php
+++ b/web/core/modules/search/tests/src/Functional/SearchMultilingualEntityTest.php
@@ -52,7 +52,14 @@ class SearchMultilingualEntityTest extends BrowserTestBase {
// Create a user who can administer search, do searches, see the status
// report, and administer cron. Log in.
- $user = $this->drupalCreateUser(['administer search', 'search content', 'use advanced search', 'access content', 'access site reports', 'administer site configuration']);
+ $user = $this->drupalCreateUser([
+ 'administer search',
+ 'search content',
+ 'use advanced search',
+ 'access content',
+ 'access site reports',
+ 'administer site configuration',
+ ]);
$this->drupalLogin($user);
// Set up the search plugin.
diff --git a/web/core/modules/search/tests/src/Functional/SearchNodeDiacriticsTest.php b/web/core/modules/search/tests/src/Functional/SearchNodeDiacriticsTest.php
index 2e7150d8..e9751cb0 100644
--- a/web/core/modules/search/tests/src/Functional/SearchNodeDiacriticsTest.php
+++ b/web/core/modules/search/tests/src/Functional/SearchNodeDiacriticsTest.php
@@ -36,7 +36,12 @@ class SearchNodeDiacriticsTest extends BrowserTestBase {
node_access_rebuild();
// Create a test user and log in.
- $this->testUser = $this->drupalCreateUser(['access content', 'search content', 'use advanced search', 'access user profiles']);
+ $this->testUser = $this->drupalCreateUser([
+ 'access content',
+ 'search content',
+ 'use advanced search',
+ 'access user profiles',
+ ]);
$this->drupalLogin($this->testUser);
}
diff --git a/web/core/modules/search/tests/src/Functional/SearchNodePunctuationTest.php b/web/core/modules/search/tests/src/Functional/SearchNodePunctuationTest.php
index 02945562..9fb4cda5 100644
--- a/web/core/modules/search/tests/src/Functional/SearchNodePunctuationTest.php
+++ b/web/core/modules/search/tests/src/Functional/SearchNodePunctuationTest.php
@@ -35,7 +35,12 @@ class SearchNodePunctuationTest extends BrowserTestBase {
node_access_rebuild();
// Create a test user and log in.
- $this->testUser = $this->drupalCreateUser(['access content', 'search content', 'use advanced search', 'access user profiles']);
+ $this->testUser = $this->drupalCreateUser([
+ 'access content',
+ 'search content',
+ 'use advanced search',
+ 'access user profiles',
+ ]);
$this->drupalLogin($this->testUser);
}
@@ -59,7 +64,7 @@ class SearchNodePunctuationTest extends BrowserTestBase {
// Check if the author is linked correctly to the user profile page.
$username = $node->getOwner()->getAccountName();
- $this->assertLink($username);
+ $this->assertSession()->linkExists($username);
// Search for "&" and verify entities are not broken up in the output.
$edit = ['keys' => '&'];
diff --git a/web/core/modules/search/tests/src/Functional/SearchNodeUpdateAndDeletionTest.php b/web/core/modules/search/tests/src/Functional/SearchNodeUpdateAndDeletionTest.php
index 6f2a4941..4e984037 100644
--- a/web/core/modules/search/tests/src/Functional/SearchNodeUpdateAndDeletionTest.php
+++ b/web/core/modules/search/tests/src/Functional/SearchNodeUpdateAndDeletionTest.php
@@ -36,7 +36,10 @@ class SearchNodeUpdateAndDeletionTest extends BrowserTestBase {
$this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
// Create a test user and log in.
- $this->testUser = $this->drupalCreateUser(['access content', 'search content']);
+ $this->testUser = $this->drupalCreateUser([
+ 'access content',
+ 'search content',
+ ]);
$this->drupalLogin($this->testUser);
}
diff --git a/web/core/modules/search/tests/src/Functional/SearchNumberMatchingTest.php b/web/core/modules/search/tests/src/Functional/SearchNumberMatchingTest.php
index 8888b4dd..f25afa3d 100644
--- a/web/core/modules/search/tests/src/Functional/SearchNumberMatchingTest.php
+++ b/web/core/modules/search/tests/src/Functional/SearchNumberMatchingTest.php
@@ -65,7 +65,12 @@ class SearchNumberMatchingTest extends BrowserTestBase {
$this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
- $this->testUser = $this->drupalCreateUser(['search content', 'access content', 'administer nodes', 'access site reports']);
+ $this->testUser = $this->drupalCreateUser([
+ 'search content',
+ 'access content',
+ 'administer nodes',
+ 'access site reports',
+ ]);
$this->drupalLogin($this->testUser);
foreach ($this->numbers as $num) {
diff --git a/web/core/modules/search/tests/src/Functional/SearchNumbersTest.php b/web/core/modules/search/tests/src/Functional/SearchNumbersTest.php
index 43dd788d..f65e12e0 100644
--- a/web/core/modules/search/tests/src/Functional/SearchNumbersTest.php
+++ b/web/core/modules/search/tests/src/Functional/SearchNumbersTest.php
@@ -71,7 +71,12 @@ class SearchNumbersTest extends BrowserTestBase {
$this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
- $this->testUser = $this->drupalCreateUser(['search content', 'access content', 'administer nodes', 'access site reports']);
+ $this->testUser = $this->drupalCreateUser([
+ 'search content',
+ 'access content',
+ 'administer nodes',
+ 'access site reports',
+ ]);
$this->drupalLogin($this->testUser);
foreach ($this->numbers as $doc => $num) {
diff --git a/web/core/modules/search/tests/src/Functional/SearchPageCacheTagsTest.php b/web/core/modules/search/tests/src/Functional/SearchPageCacheTagsTest.php
index daa55efa..1e6ff784 100644
--- a/web/core/modules/search/tests/src/Functional/SearchPageCacheTagsTest.php
+++ b/web/core/modules/search/tests/src/Functional/SearchPageCacheTagsTest.php
@@ -53,7 +53,10 @@ class SearchPageCacheTagsTest extends BrowserTestBase {
$this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
// Create user.
- $this->searchingUser = $this->drupalCreateUser(['search content', 'access user profiles']);
+ $this->searchingUser = $this->drupalCreateUser([
+ 'search content',
+ 'access user profiles',
+ ]);
// Create a node and update the search index.
$this->node = $this->drupalCreateNode(['title' => 'bike shed shop']);
diff --git a/web/core/modules/search/tests/src/Functional/SearchPageOverrideTest.php b/web/core/modules/search/tests/src/Functional/SearchPageOverrideTest.php
index 2faac41a..d7cf74de 100644
--- a/web/core/modules/search/tests/src/Functional/SearchPageOverrideTest.php
+++ b/web/core/modules/search/tests/src/Functional/SearchPageOverrideTest.php
@@ -35,7 +35,10 @@ class SearchPageOverrideTest extends BrowserTestBase {
parent::setUp();
// Log in as a user that can create and search content.
- $this->searchUser = $this->drupalCreateUser(['search content', 'administer search']);
+ $this->searchUser = $this->drupalCreateUser([
+ 'search content',
+ 'administer search',
+ ]);
$this->drupalLogin($this->searchUser);
}
diff --git a/web/core/modules/search/tests/src/Functional/SearchPageTextTest.php b/web/core/modules/search/tests/src/Functional/SearchPageTextTest.php
index f9c8891f..62999854 100644
--- a/web/core/modules/search/tests/src/Functional/SearchPageTextTest.php
+++ b/web/core/modules/search/tests/src/Functional/SearchPageTextTest.php
@@ -39,7 +39,11 @@ class SearchPageTextTest extends BrowserTestBase {
$this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
// Create user.
- $this->searchingUser = $this->drupalCreateUser(['search content', 'access user profiles', 'use advanced search']);
+ $this->searchingUser = $this->drupalCreateUser([
+ 'search content',
+ 'access user profiles',
+ 'use advanced search',
+ ]);
$this->drupalPlaceBlock('local_tasks_block');
$this->drupalPlaceBlock('page_title_block');
}
diff --git a/web/core/modules/search/tests/src/Functional/SearchQueryAlterTest.php b/web/core/modules/search/tests/src/Functional/SearchQueryAlterTest.php
index bcfd7e26..fa705b28 100644
--- a/web/core/modules/search/tests/src/Functional/SearchQueryAlterTest.php
+++ b/web/core/modules/search/tests/src/Functional/SearchQueryAlterTest.php
@@ -29,7 +29,10 @@ class SearchQueryAlterTest extends BrowserTestBase {
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
// Log in with sufficient privileges.
- $this->drupalLogin($this->drupalCreateUser(['create page content', 'search content']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'create page content',
+ 'search content',
+ ]));
// Create a node and an article with the same keyword. The query alter
// test module will alter the query so only articles should be returned.
diff --git a/web/core/modules/search/tests/src/Functional/SearchRankingTest.php b/web/core/modules/search/tests/src/Functional/SearchRankingTest.php
index 8b29beda..189ffce4 100644
--- a/web/core/modules/search/tests/src/Functional/SearchRankingTest.php
+++ b/web/core/modules/search/tests/src/Functional/SearchRankingTest.php
@@ -49,7 +49,12 @@ class SearchRankingTest extends BrowserTestBase {
$this->nodeSearch = SearchPage::load('node_search');
// Log in with sufficient privileges.
- $this->drupalLogin($this->drupalCreateUser(['post comments', 'skip comment approval', 'create page content', 'administer search']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'post comments',
+ 'skip comment approval',
+ 'create page content',
+ 'administer search',
+ ]));
}
public function testRankings() {
diff --git a/web/core/modules/serialization/src/Normalizer/TimeStampItemNormalizerTrait.php b/web/core/modules/serialization/src/Normalizer/TimeStampItemNormalizerTrait.php
index 50296711..365e30a4 100644
--- a/web/core/modules/serialization/src/Normalizer/TimeStampItemNormalizerTrait.php
+++ b/web/core/modules/serialization/src/Normalizer/TimeStampItemNormalizerTrait.php
@@ -37,6 +37,7 @@ trait TimeStampItemNormalizerTrait {
*
* @param array $normalized
* The normalized field data to process.
+ *
* @return array
* The processed data.
*/
diff --git a/web/core/modules/shortcut/shortcut.api.php b/web/core/modules/shortcut/shortcut.api.php
index c5c609c3..ff40a30d 100644
--- a/web/core/modules/shortcut/shortcut.api.php
+++ b/web/core/modules/shortcut/shortcut.api.php
@@ -26,6 +26,7 @@
*
* @param $account
* The user account whose default shortcut set is being requested.
+ *
* @return string
* The name of the shortcut set that this module recommends for that user, if
* there is one.
diff --git a/web/core/modules/shortcut/tests/src/Functional/ShortcutCacheTagsTest.php b/web/core/modules/shortcut/tests/src/Functional/ShortcutCacheTagsTest.php
index 52876a4e..4d0367c7 100644
--- a/web/core/modules/shortcut/tests/src/Functional/ShortcutCacheTagsTest.php
+++ b/web/core/modules/shortcut/tests/src/Functional/ShortcutCacheTagsTest.php
@@ -117,7 +117,7 @@ class ShortcutCacheTagsTest extends EntityCacheTagsTestBase {
// Verify that users without the 'access shortcuts' permission can't see the
// shortcuts.
$this->drupalLogin($this->drupalCreateUser(['access toolbar']));
- $this->assertNoLink('Shortcuts');
+ $this->assertSession()->linkNotExists('Shortcuts');
$this->verifyDynamicPageCache($test_page_url, 'MISS');
$this->verifyDynamicPageCache($test_page_url, 'HIT');
@@ -129,8 +129,8 @@ class ShortcutCacheTagsTest extends EntityCacheTagsTestBase {
]));
$this->verifyDynamicPageCache($test_page_url, 'MISS');
$this->verifyDynamicPageCache($test_page_url, 'HIT');
- $this->assertLink('Shortcuts');
- $this->assertNoLink('Cron');
+ $this->assertSession()->linkExists('Shortcuts');
+ $this->assertSession()->linkNotExists('Cron');
// Create a role with access to shortcuts as well as the necessary
// permissions to see specific shortcuts.
@@ -155,14 +155,14 @@ class ShortcutCacheTagsTest extends EntityCacheTagsTestBase {
$this->verifyDynamicPageCache($test_page_url, 'MISS');
$this->verifyDynamicPageCache($test_page_url, 'HIT');
$this->assertCacheContexts(['user', 'url.query_args:_wrapper_format']);
- $this->assertLink('Shortcuts');
- $this->assertLink('Cron');
+ $this->assertSession()->linkExists('Shortcuts');
+ $this->assertSession()->linkExists('Cron');
$this->drupalLogin($site_configuration_user2);
$this->verifyDynamicPageCache($test_page_url, 'HIT');
$this->assertCacheContexts(['user', 'url.query_args:_wrapper_format']);
- $this->assertLink('Shortcuts');
- $this->assertLink('Cron');
+ $this->assertSession()->linkExists('Shortcuts');
+ $this->assertSession()->linkExists('Cron');
// Add another shortcut.
$shortcut = Shortcut::create([
@@ -176,21 +176,21 @@ class ShortcutCacheTagsTest extends EntityCacheTagsTestBase {
// The shortcuts are displayed in a lazy builder, so the page is still a
// cache HIT but shows the new shortcut immediately.
$this->verifyDynamicPageCache($test_page_url, 'HIT');
- $this->assertLink('Cron');
- $this->assertLink('Llama');
+ $this->assertSession()->linkExists('Cron');
+ $this->assertSession()->linkExists('Llama');
// Update the shortcut title and assert that it is updated.
$shortcut->set('title', 'Alpaca');
$shortcut->save();
$this->verifyDynamicPageCache($test_page_url, 'HIT');
- $this->assertLink('Cron');
- $this->assertLink('Alpaca');
+ $this->assertSession()->linkExists('Cron');
+ $this->assertSession()->linkExists('Alpaca');
// Delete the shortcut and assert that the link is gone.
$shortcut->delete();
$this->verifyDynamicPageCache($test_page_url, 'HIT');
- $this->assertLink('Cron');
- $this->assertNoLink('Alpaca');
+ $this->assertSession()->linkExists('Cron');
+ $this->assertSession()->linkNotExists('Alpaca');
}
}
diff --git a/web/core/modules/shortcut/tests/src/Functional/ShortcutLinksTest.php b/web/core/modules/shortcut/tests/src/Functional/ShortcutLinksTest.php
index 512fd2b7..f06baa85 100644
--- a/web/core/modules/shortcut/tests/src/Functional/ShortcutLinksTest.php
+++ b/web/core/modules/shortcut/tests/src/Functional/ShortcutLinksTest.php
@@ -87,10 +87,10 @@ class ShortcutLinksTest extends ShortcutTestBase {
$this->assertContains('internal:' . $test_path, $paths, 'Shortcut created: ' . $test_path);
if (in_array($test_path, $test_cases_non_access)) {
- $this->assertNoLink($title, new FormattableMarkup('Shortcut link %url not accessible on the page.', ['%url' => $test_path]));
+ $this->assertSession()->linkNotExists($title, new FormattableMarkup('Shortcut link %url not accessible on the page.', ['%url' => $test_path]));
}
else {
- $this->assertLink($title, 0, new FormattableMarkup('Shortcut link %url found on the page.', ['%url' => $test_path]));
+ $this->assertSession()->linkExists($title, 0, new FormattableMarkup('Shortcut link %url found on the page.', ['%url' => $test_path]));
}
}
$saved_set = ShortcutSet::load($set->id());
@@ -121,7 +121,7 @@ class ShortcutLinksTest extends ShortcutTestBase {
'link[0][uri]' => '/node',
];
$this->drupalPostForm('admin/config/user-interface/shortcut/manage/' . $set->id() . '/add-link', $form_data, t('Save'));
- $this->assertLink($title, 0, 'Shortcut link found on the page.');
+ $this->assertSession()->linkExists($title, 0, 'Shortcut link found on the page.');
// Create a new shortcut set and add a link to it.
$this->drupalLogin($this->adminUser);
@@ -154,19 +154,19 @@ class ShortcutLinksTest extends ShortcutTestBase {
// Test the "Add to shortcuts" link.
$this->clickLink('Add to Default shortcuts');
$this->assertText('Added a shortcut for Cron.');
- $this->assertLink('Cron', 0, 'Shortcut link found on page');
+ $this->assertSession()->linkExists('Cron', 0, 'Shortcut link found on page');
$this->drupalGet('admin/structure');
- $this->assertLink('Cron', 0, 'Shortcut link found on different page');
+ $this->assertSession()->linkExists('Cron', 0, 'Shortcut link found on different page');
// Test the "Remove from shortcuts" link.
$this->clickLink('Cron');
$this->clickLink('Remove from Default shortcuts');
$this->assertText('The shortcut Cron has been deleted.');
- $this->assertNoLink('Cron', 'Shortcut link removed from page');
+ $this->assertSession()->linkNotExists('Cron', 'Shortcut link removed from page');
$this->drupalGet('admin/structure');
- $this->assertNoLink('Cron', 'Shortcut link removed from different page');
+ $this->assertSession()->linkNotExists('Cron', 'Shortcut link removed from different page');
$this->drupalGet('admin/people');
@@ -240,7 +240,7 @@ class ShortcutLinksTest extends ShortcutTestBase {
$saved_set = ShortcutSet::load($set->id());
$titles = $this->getShortcutInformation($saved_set, 'title');
$this->assertContains($new_link_name, $titles, 'Shortcut renamed: ' . $new_link_name);
- $this->assertLink($new_link_name, 0, 'Renamed shortcut link appears on the page.');
+ $this->assertSession()->linkExists($new_link_name, 0, 'Renamed shortcut link appears on the page.');
$this->assertText(t('The shortcut @link has been updated.', ['@link' => $new_link_name]));
}
@@ -352,13 +352,16 @@ class ShortcutLinksTest extends ShortcutTestBase {
// Verify that users without the 'access shortcuts' permission can't see the
// shortcuts.
$this->drupalLogin($this->drupalCreateUser(['access toolbar']));
- $this->assertNoLink('Shortcuts', 'Shortcut link not found on page.');
+ $this->assertSession()->linkNotExists('Shortcuts', 'Shortcut link not found on page.');
// Verify that users without the 'administer site configuration' permission
// can't see the cron shortcuts but can see shortcuts.
- $this->drupalLogin($this->drupalCreateUser(['access toolbar', 'access shortcuts']));
- $this->assertLink('Shortcuts');
- $this->assertNoLink('Cron', 'Cron shortcut link not found on page.');
+ $this->drupalLogin($this->drupalCreateUser([
+ 'access toolbar',
+ 'access shortcuts',
+ ]));
+ $this->assertSession()->linkExists('Shortcuts');
+ $this->assertSession()->linkNotExists('Cron', 'Cron shortcut link not found on page.');
// Verify that users with the 'access shortcuts' permission can see the
// shortcuts.
@@ -366,7 +369,7 @@ class ShortcutLinksTest extends ShortcutTestBase {
'access toolbar', 'access shortcuts', 'administer site configuration',
]));
$this->clickLink('Shortcuts', 0, 'Shortcut link found on page.');
- $this->assertLink('Cron', 0, 'Cron shortcut link found on page.');
+ $this->assertSession()->linkExists('Cron', 0, 'Cron shortcut link found on page.');
$this->verifyAccessShortcutsPermissionForEditPages();
}
@@ -376,7 +379,12 @@ class ShortcutLinksTest extends ShortcutTestBase {
*/
public function testShortcutLinkOrder() {
// Ensure to give permissions to access the shortcuts.
- $this->drupalLogin($this->drupalCreateUser(['access toolbar', 'access shortcuts', 'access content overview', 'administer content types']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'access toolbar',
+ 'access shortcuts',
+ 'access content overview',
+ 'administer content types',
+ ]));
$this->drupalGet(Url::fromRoute(''));
$shortcuts = $this->cssSelect('#toolbar-item-shortcuts-tray .toolbar-menu a');
$this->assertEqual($shortcuts[0]->getText(), 'Add content');
diff --git a/web/core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php b/web/core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php
index 4372aeae..aeedc8bf 100644
--- a/web/core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php
+++ b/web/core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php
@@ -83,7 +83,7 @@ class ShortcutSetsTest extends ShortcutTestBase {
$title = $shortcut->getTitle();
// Confirm that a link to the shortcut is found within the table.
- $this->assertLink($title);
+ $this->assertSession()->linkExists($title);
// Look for a test shortcut weight select form element.
$this->assertFieldByName('shortcuts[links][' . $shortcut->id() . '][weight]');
diff --git a/web/core/modules/shortcut/tests/src/Functional/ShortcutTestBase.php b/web/core/modules/shortcut/tests/src/Functional/ShortcutTestBase.php
index c11c418a..9c7aecd1 100644
--- a/web/core/modules/shortcut/tests/src/Functional/ShortcutTestBase.php
+++ b/web/core/modules/shortcut/tests/src/Functional/ShortcutTestBase.php
@@ -78,8 +78,23 @@ abstract class ShortcutTestBase extends BrowserTestBase {
}
// Create users.
- $this->adminUser = $this->drupalCreateUser(['access toolbar', 'administer shortcuts', 'view the administration theme', 'create article content', 'create page content', 'access content overview', 'administer users', 'link to any page', 'edit any article content']);
- $this->shortcutUser = $this->drupalCreateUser(['customize shortcut links', 'switch shortcut sets', 'access shortcuts', 'access content']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'access toolbar',
+ 'administer shortcuts',
+ 'view the administration theme',
+ 'create article content',
+ 'create page content',
+ 'access content overview',
+ 'administer users',
+ 'link to any page',
+ 'edit any article content',
+ ]);
+ $this->shortcutUser = $this->drupalCreateUser([
+ 'customize shortcut links',
+ 'switch shortcut sets',
+ 'access shortcuts',
+ 'access content',
+ ]);
// Create a node.
$this->node = $this->drupalCreateNode(['type' => 'article']);
diff --git a/web/core/modules/simpletest/simpletest.module b/web/core/modules/simpletest/simpletest.module
index a5385755..31749c7e 100644
--- a/web/core/modules/simpletest/simpletest.module
+++ b/web/core/modules/simpletest/simpletest.module
@@ -422,6 +422,7 @@ function _simpletest_batch_finished($success, $results, $operations, $elapsed) {
*
* @param $test_id
* The test ID to get the last test from.
+ *
* @return array
* Array containing the last database prefix used and the last test class
* that ran.
diff --git a/web/core/modules/simpletest/src/KernelTestBase.php b/web/core/modules/simpletest/src/KernelTestBase.php
index 952896a2..bd6a89e3 100644
--- a/web/core/modules/simpletest/src/KernelTestBase.php
+++ b/web/core/modules/simpletest/src/KernelTestBase.php
@@ -151,7 +151,7 @@ abstract class KernelTestBase extends TestBase {
$this->configDirectories = [];
// Assign the relative path to the global variable.
$path = $this->siteDirectory . '/config_' . CONFIG_SYNC_DIRECTORY;
- // Ensure the directory can be created and is writeable.
+ // Ensure the directory can be created and is writable.
if (!\Drupal::service('file_system')->prepareDirectory($path, FileSystemInterface::CREATE_DIRECTORY | FileSystemInterface::MODIFY_PERMISSIONS)) {
throw new \RuntimeException("Failed to create '" . CONFIG_SYNC_DIRECTORY . "' config directory $path");
}
diff --git a/web/core/modules/statistics/tests/src/Functional/StatisticsAdminTest.php b/web/core/modules/statistics/tests/src/Functional/StatisticsAdminTest.php
index b0f63344..fc7ea25f 100644
--- a/web/core/modules/statistics/tests/src/Functional/StatisticsAdminTest.php
+++ b/web/core/modules/statistics/tests/src/Functional/StatisticsAdminTest.php
@@ -58,7 +58,11 @@ class StatisticsAdminTest extends BrowserTestBase {
if ($this->profile != 'standard') {
$this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
}
- $this->privilegedUser = $this->drupalCreateUser(['administer statistics', 'view post access counter', 'create page content']);
+ $this->privilegedUser = $this->drupalCreateUser([
+ 'administer statistics',
+ 'view post access counter',
+ 'create page content',
+ ]);
$this->drupalLogin($this->privilegedUser);
$this->testNode = $this->drupalCreateNode(['type' => 'page', 'uid' => $this->privilegedUser->id()]);
$this->client = \Drupal::httpClient();
diff --git a/web/core/modules/statistics/tests/src/Functional/Views/IntegrationTest.php b/web/core/modules/statistics/tests/src/Functional/Views/IntegrationTest.php
index a03535f1..1fa68a80 100644
--- a/web/core/modules/statistics/tests/src/Functional/Views/IntegrationTest.php
+++ b/web/core/modules/statistics/tests/src/Functional/Views/IntegrationTest.php
@@ -53,7 +53,10 @@ class IntegrationTest extends ViewTestBase {
ViewTestData::createTestViews(get_class($this), ['statistics_test_views']);
// Create a new user for viewing nodes and statistics.
- $this->webUser = $this->drupalCreateUser(['access content', 'view post access counter']);
+ $this->webUser = $this->drupalCreateUser([
+ 'access content',
+ 'view post access counter',
+ ]);
// Create a new user for viewing nodes only.
$this->deniedUser = $this->drupalCreateUser(['access content']);
diff --git a/web/core/modules/system/src/Form/FileSystemForm.php b/web/core/modules/system/src/Form/FileSystemForm.php
index d81488b4..cad3342d 100644
--- a/web/core/modules/system/src/Form/FileSystemForm.php
+++ b/web/core/modules/system/src/Form/FileSystemForm.php
@@ -122,7 +122,7 @@ class FileSystemForm extends ConfigFormBase {
'#markup' => $this->fileSystem->getTempDirectory(),
'#description' => t('A local file system path where temporary files will be stored. This directory should not be accessible over the web. This must be changed in settings.php.'),
];
- // Any visible, writeable wrapper can potentially be used for the files
+ // Any visible, writable wrapper can potentially be used for the files
// directory, including a remote file system that integrates with a CDN.
$options = $this->streamWrapperManager->getDescriptions(StreamWrapperInterface::WRITE_VISIBLE);
diff --git a/web/core/modules/system/src/Form/ThemeSettingsForm.php b/web/core/modules/system/src/Form/ThemeSettingsForm.php
index 2a65c6b5..e1f13a79 100644
--- a/web/core/modules/system/src/Form/ThemeSettingsForm.php
+++ b/web/core/modules/system/src/Form/ThemeSettingsForm.php
@@ -514,6 +514,7 @@ class ThemeSettingsForm extends ConfigFormBase {
* @param string $path
* A path relative to the Drupal root or to the public files directory, or
* a stream wrapper URI.
+ *
* @return mixed
* A valid path that can be displayed through the theme system, or FALSE if
* the path could not be validated.
diff --git a/web/core/modules/system/src/PathBasedBreadcrumbBuilder.php b/web/core/modules/system/src/PathBasedBreadcrumbBuilder.php
index 261ae32a..609ffd51 100644
--- a/web/core/modules/system/src/PathBasedBreadcrumbBuilder.php
+++ b/web/core/modules/system/src/PathBasedBreadcrumbBuilder.php
@@ -207,8 +207,6 @@ class PathBasedBreadcrumbBuilder implements BreadcrumbBuilderInterface {
if (!empty($exclude[$path])) {
return NULL;
}
- // @todo Use the RequestHelper once https://www.drupal.org/node/2090293 is
- // fixed.
$request = Request::create($path);
// Performance optimization: set a short accept header to reduce overhead in
// AcceptHeaderMatcher when matching the request.
diff --git a/web/core/modules/system/src/Tests/Cache/CacheTestBase.php b/web/core/modules/system/src/Tests/Cache/CacheTestBase.php
index dc2f601c..431e72b9 100644
--- a/web/core/modules/system/src/Tests/Cache/CacheTestBase.php
+++ b/web/core/modules/system/src/Tests/Cache/CacheTestBase.php
@@ -29,6 +29,7 @@ abstract class CacheTestBase extends WebTestBase {
* The variable the cache should contain.
* @param $bin
* The bin the cache item was stored in.
+ *
* @return
* TRUE on pass, FALSE on fail.
*/
diff --git a/web/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php b/web/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php
index 625baa5a..042f287a 100644
--- a/web/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php
+++ b/web/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php
@@ -171,6 +171,7 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity to be tested, as created by createEntity().
+ *
* @return array
* An array of the additional cache tags.
*
diff --git a/web/core/modules/system/src/Tests/Routing/MockAliasManager.php b/web/core/modules/system/src/Tests/Routing/MockAliasManager.php
index dcbfbe71..b52b0b44 100644
--- a/web/core/modules/system/src/Tests/Routing/MockAliasManager.php
+++ b/web/core/modules/system/src/Tests/Routing/MockAliasManager.php
@@ -73,6 +73,7 @@ class MockAliasManager implements AliasManagerInterface {
* {@inheritdoc}
* @param $path
* @param null $langcode
+ *
* @return
*/
public function getAliasByPath($path, $langcode = NULL) {
diff --git a/web/core/modules/system/system.module b/web/core/modules/system/system.module
index 208372cc..ba714a4a 100644
--- a/web/core/modules/system/system.module
+++ b/web/core/modules/system/system.module
@@ -473,6 +473,7 @@ function template_preprocess_entity_add_list(&$variables) {
* object created by authorize.php when the user authorizes the operation.
* @param $page_title
* Optional string to use as the page title once redirected to authorize.php.
+ *
* @return
* Nothing, this function just initializes variables in the user's session.
*/
@@ -500,6 +501,7 @@ function system_authorized_init($callback, $file, $arguments = [], $page_title =
*
* @param array $options
* Optional array of options to set on the \Drupal\Core\Url object.
+ *
* @return \Drupal\Core\Url
* The full URL to authorize.php, using HTTPS if available.
*
@@ -1031,6 +1033,7 @@ function system_rebuild_module_data() {
* @param $show
* Possible values: REGIONS_ALL or REGIONS_VISIBLE. Visible excludes hidden
* regions.
+ *
* @return
* An array of regions in the form $region['name'] = 'description'.
*/
@@ -1096,6 +1099,7 @@ function system_system_info_alter(&$info, Extension $file, $type) {
*
* @param $theme
* The name of a theme.
+ *
* @return
* A string that is the region name.
*/
diff --git a/web/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestExternal.php b/web/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestExternal.php
new file mode 100644
index 00000000..b6587a9a
--- /dev/null
+++ b/web/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestExternal.php
@@ -0,0 +1,36 @@
+currentRouteMatch->getRouteName();
- $entity_autcomplete_route = [
+ $entity_autocomplete_route = [
'system.entity_autocomplete',
];
- if (in_array($current_route, $entity_autcomplete_route)) {
+ if (in_array($current_route, $entity_autocomplete_route)) {
if ($this->container->initialized('theme.registry')) {
throw new \Exception('registry initialized');
}
diff --git a/web/core/modules/system/tests/modules/token_test/token_test.routing.yml b/web/core/modules/system/tests/modules/token_test/token_test.routing.yml
index 5fc239ad..0de9339c 100644
--- a/web/core/modules/system/tests/modules/token_test/token_test.routing.yml
+++ b/web/core/modules/system/tests/modules/token_test/token_test.routing.yml
@@ -5,7 +5,7 @@ token_test.test:
requirements:
_access: 'TRUE'
token_test.test_without_bubbleable_metadata:
- path: token-test-without-bubleable-metadata/{node}
+ path: token-test-without-bubbleable-metadata/{node}
defaults:
_controller: Drupal\token_test\Controller\TestController::tokenReplaceWithoutPassedBubbleableMetadata
requirements:
diff --git a/web/core/modules/system/tests/src/Functional/Batch/ProcessingTest.php b/web/core/modules/system/tests/src/Functional/Batch/ProcessingTest.php
index 37fd7eb1..634c8859 100644
--- a/web/core/modules/system/tests/src/Functional/Batch/ProcessingTest.php
+++ b/web/core/modules/system/tests/src/Functional/Batch/ProcessingTest.php
@@ -54,14 +54,17 @@ class ProcessingTest extends BrowserTestBase {
// Batch 0: no operation.
$edit = ['batch' => 'batch_0'];
$this->drupalPostForm('batch-test', $edit, 'Submit');
- $this->assertNoEscaped('<', 'No escaped markup is present.');
+ // If there is any escaped markup it will include at least an escaped '<'
+ // character, so assert on each page that there is no escaped '<' as a way
+ // of verifying that no markup is incorrectly escaped.
+ $this->assertNoEscaped('<');
$this->assertBatchMessages($this->_resultMessages('batch_0'), 'Batch with no operation performed successfully.');
$this->assertText('Redirection successful.', 'Redirection after batch execution is correct.');
// Batch 1: several simple operations.
$edit = ['batch' => 'batch_1'];
$this->drupalPostForm('batch-test', $edit, 'Submit');
- $this->assertNoEscaped('<', 'No escaped markup is present.');
+ $this->assertNoEscaped('<');
$this->assertBatchMessages($this->_resultMessages('batch_1'), 'Batch with simple operations performed successfully.');
$this->assertEqual(batch_test_stack(), $this->_resultStack('batch_1'), 'Execution order was correct.');
$this->assertText('Redirection successful.', 'Redirection after batch execution is correct.');
@@ -69,7 +72,7 @@ class ProcessingTest extends BrowserTestBase {
// Batch 2: one multistep operation.
$edit = ['batch' => 'batch_2'];
$this->drupalPostForm('batch-test', $edit, 'Submit');
- $this->assertNoEscaped('<', 'No escaped markup is present.');
+ $this->assertNoEscaped('<');
$this->assertBatchMessages($this->_resultMessages('batch_2'), 'Batch with multistep operation performed successfully.');
$this->assertEqual(batch_test_stack(), $this->_resultStack('batch_2'), 'Execution order was correct.');
$this->assertText('Redirection successful.', 'Redirection after batch execution is correct.');
@@ -77,7 +80,7 @@ class ProcessingTest extends BrowserTestBase {
// Batch 3: simple + multistep combined.
$edit = ['batch' => 'batch_3'];
$this->drupalPostForm('batch-test', $edit, 'Submit');
- $this->assertNoEscaped('<', 'No escaped markup is present.');
+ $this->assertNoEscaped('<');
$this->assertBatchMessages($this->_resultMessages('batch_3'), 'Batch with simple and multistep operations performed successfully.');
$this->assertEqual(batch_test_stack(), $this->_resultStack('batch_3'), 'Execution order was correct.');
$this->assertText('Redirection successful.', 'Redirection after batch execution is correct.');
@@ -85,7 +88,7 @@ class ProcessingTest extends BrowserTestBase {
// Batch 4: nested batch.
$edit = ['batch' => 'batch_4'];
$this->drupalPostForm('batch-test', $edit, 'Submit');
- $this->assertNoEscaped('<', 'No escaped markup is present.');
+ $this->assertNoEscaped('<');
$this->assertBatchMessages($this->_resultMessages('batch_4'), 'Nested batch performed successfully.');
$this->assertEqual(batch_test_stack(), $this->_resultStack('batch_4'), 'Execution order was correct.');
$this->assertText('Redirection successful.', 'Redirection after batch execution is correct.');
@@ -121,7 +124,7 @@ class ProcessingTest extends BrowserTestBase {
*/
public function testBatchFormMultistep() {
$this->drupalGet('batch-test/multistep');
- $this->assertNoEscaped('<', 'No escaped markup is present.');
+ $this->assertNoEscaped('<');
$this->assertText('step 1', 'Form is displayed in step 1.');
// First step triggers batch 1.
@@ -129,14 +132,14 @@ class ProcessingTest extends BrowserTestBase {
$this->assertBatchMessages($this->_resultMessages('batch_1'), 'Batch for step 1 performed successfully.');
$this->assertEqual(batch_test_stack(), $this->_resultStack('batch_1'), 'Execution order was correct.');
$this->assertText('step 2', 'Form is displayed in step 2.');
- $this->assertNoEscaped('<', 'No escaped markup is present.');
+ $this->assertNoEscaped('<');
// Second step triggers batch 2.
$this->drupalPostForm(NULL, [], 'Submit');
$this->assertBatchMessages($this->_resultMessages('batch_2'), 'Batch for step 2 performed successfully.');
$this->assertEqual(batch_test_stack(), $this->_resultStack('batch_2'), 'Execution order was correct.');
$this->assertText('Redirection successful.', 'Redirection after batch execution is correct.');
- $this->assertNoEscaped('<', 'No escaped markup is present.');
+ $this->assertNoEscaped('<');
// Extra query arguments will trigger logic that will add them to the
// redirect URL. Make sure they are persisted.
diff --git a/web/core/modules/system/tests/src/Functional/Cache/CacheTestBase.php b/web/core/modules/system/tests/src/Functional/Cache/CacheTestBase.php
index f1439eae..08c4db5e 100644
--- a/web/core/modules/system/tests/src/Functional/Cache/CacheTestBase.php
+++ b/web/core/modules/system/tests/src/Functional/Cache/CacheTestBase.php
@@ -22,6 +22,7 @@ abstract class CacheTestBase extends BrowserTestBase {
* The variable the cache should contain.
* @param $bin
* The bin the cache item was stored in.
+ *
* @return
* TRUE on pass, FALSE on fail.
*/
diff --git a/web/core/modules/system/tests/src/Functional/Common/FormatDateTest.php b/web/core/modules/system/tests/src/Functional/Common/FormatDateTest.php
index b2ff7b1a..b0aae40e 100644
--- a/web/core/modules/system/tests/src/Functional/Common/FormatDateTest.php
+++ b/web/core/modules/system/tests/src/Functional/Common/FormatDateTest.php
@@ -21,7 +21,9 @@ class FormatDateTest extends BrowserTestBase {
*/
public function testAdminDefinedFormatDate() {
// Create and log in an admin user.
- $this->drupalLogin($this->drupalCreateUser(['administer site configuration']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer site configuration',
+ ]));
// Add new date format.
$edit = [
diff --git a/web/core/modules/system/tests/src/Functional/Common/UrlTest.php b/web/core/modules/system/tests/src/Functional/Common/UrlTest.php
index cc9e4fbe..693dc016 100644
--- a/web/core/modules/system/tests/src/Functional/Common/UrlTest.php
+++ b/web/core/modules/system/tests/src/Functional/Common/UrlTest.php
@@ -313,6 +313,11 @@ class UrlTest extends BrowserTestBase {
$result = Url::fromUri($url)->toString();
$this->assertEqual($url, $result);
+ // Verify external URL can contain a query string with an integer key.
+ $url = $test_url . '?120=1';
+ $result = Url::fromUri($url)->toString();
+ $this->assertEqual($url, $result);
+
// Verify external URL can be extended with a query string.
$url = $test_url;
$query = ['awesome' => 'drupal'];
diff --git a/web/core/modules/system/tests/src/Functional/Entity/EntityAddUITest.php b/web/core/modules/system/tests/src/Functional/Entity/EntityAddUITest.php
index 747cfb63..f8157ca5 100644
--- a/web/core/modules/system/tests/src/Functional/Entity/EntityAddUITest.php
+++ b/web/core/modules/system/tests/src/Functional/Entity/EntityAddUITest.php
@@ -48,7 +48,7 @@ class EntityAddUITest extends BrowserTestBase {
// has the necessary permissions.
$this->drupalGet('/entity_test_with_bundle/add');
$this->assertText('There is no test entity bundle yet.');
- $this->assertLink('Add a new test entity bundle.');
+ $this->assertSession()->linkExists('Add a new test entity bundle.');
// One bundle exists, confirm redirection to the add-form.
EntityTestBundle::create([
@@ -67,8 +67,8 @@ class EntityAddUITest extends BrowserTestBase {
])->save();
$this->drupalGet('/entity_test_with_bundle/add');
- $this->assertLink('Test label');
- $this->assertLink('Test2 label');
+ $this->assertSession()->linkExists('Test label');
+ $this->assertSession()->linkExists('Test2 label');
$this->assertText('My test description');
$this->assertText('My test2 description');
@@ -93,9 +93,9 @@ class EntityAddUITest extends BrowserTestBase {
'description' => 'My test3 description',
])->save();
$this->drupalGet('/entity_test_with_bundle/add');
- $this->assertLink('Test label');
- $this->assertLink('Test2 label');
- $this->assertNoLink('Test3 label');
+ $this->assertSession()->linkExists('Test label');
+ $this->assertSession()->linkExists('Test2 label');
+ $this->assertSession()->linkNotExists('Test3 label');
$this->clickLink(t('Test label'));
$this->assertSession()->statusCodeEquals(200);
@@ -114,10 +114,10 @@ class EntityAddUITest extends BrowserTestBase {
// does not have bundle specific permissions. The add bundle message is
// present as the user has bundle create permissions.
$this->drupalGet('/entity_test_with_bundle/add');
- $this->assertNoLink('Test label');
- $this->assertNoLink('Test2 label');
- $this->assertNoLink('Test3 label');
- $this->assertLink('Add a new test entity bundle.');
+ $this->assertSession()->linkNotExists('Test label');
+ $this->assertSession()->linkNotExists('Test2 label');
+ $this->assertSession()->linkNotExists('Test3 label');
+ $this->assertSession()->linkExists('Add a new test entity bundle.');
}
/**
@@ -141,8 +141,8 @@ class EntityAddUITest extends BrowserTestBase {
entity_test_create_bundle('test2', 'Test2 label', 'entity_test_mul');
$this->drupalGet('/entity_test_mul/add');
- $this->assertLink('Test label');
- $this->assertLink('Test2 label');
+ $this->assertSession()->linkExists('Test label');
+ $this->assertSession()->linkExists('Test2 label');
$this->clickLink('Test2 label');
$this->drupalGet('/entity_test_mul/add/test2');
diff --git a/web/core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php b/web/core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php
index 5ec1384a..31544aed 100644
--- a/web/core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php
+++ b/web/core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php
@@ -164,6 +164,7 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity to be tested, as created by createEntity().
+ *
* @return array
* An array of the additional cache tags.
*
diff --git a/web/core/modules/system/tests/src/Functional/Entity/EntityFormTest.php b/web/core/modules/system/tests/src/Functional/Entity/EntityFormTest.php
index 02b8929a..628e351c 100644
--- a/web/core/modules/system/tests/src/Functional/Entity/EntityFormTest.php
+++ b/web/core/modules/system/tests/src/Functional/Entity/EntityFormTest.php
@@ -27,7 +27,10 @@ class EntityFormTest extends BrowserTestBase {
protected function setUp() {
parent::setUp();
- $web_user = $this->drupalCreateUser(['administer entity_test content', 'view test entity']);
+ $web_user = $this->drupalCreateUser([
+ 'administer entity_test content',
+ 'view test entity',
+ ]);
$this->drupalLogin($web_user);
// Add a language.
diff --git a/web/core/modules/system/tests/src/Functional/Entity/EntityOperationsTest.php b/web/core/modules/system/tests/src/Functional/Entity/EntityOperationsTest.php
index 07d58b65..d88d7687 100644
--- a/web/core/modules/system/tests/src/Functional/Entity/EntityOperationsTest.php
+++ b/web/core/modules/system/tests/src/Functional/Entity/EntityOperationsTest.php
@@ -42,7 +42,7 @@ class EntityOperationsTest extends BrowserTestBase {
$roles = user_roles();
foreach ($roles as $role) {
$this->assertLinkByHref($role->toUrl()->toString() . '/test_operation');
- $this->assertLink(new FormattableMarkup('Test Operation: @label', ['@label' => $role->label()]));
+ $this->assertSession()->linkExists(new FormattableMarkup('Test Operation: @label', ['@label' => $role->label()]));
}
}
diff --git a/web/core/modules/system/tests/src/Functional/Entity/EntityTranslationFormTest.php b/web/core/modules/system/tests/src/Functional/Entity/EntityTranslationFormTest.php
index 7e206f7a..ac358984 100644
--- a/web/core/modules/system/tests/src/Functional/Entity/EntityTranslationFormTest.php
+++ b/web/core/modules/system/tests/src/Functional/Entity/EntityTranslationFormTest.php
@@ -52,7 +52,11 @@ class EntityTranslationFormTest extends BrowserTestBase {
public function testEntityFormLanguage() {
$this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
- $web_user = $this->drupalCreateUser(['create page content', 'edit own page content', 'administer content types']);
+ $web_user = $this->drupalCreateUser([
+ 'create page content',
+ 'edit own page content',
+ 'administer content types',
+ ]);
$this->drupalLogin($web_user);
// Create a node with language LanguageInterface::LANGCODE_NOT_SPECIFIED.
diff --git a/web/core/modules/system/tests/src/Functional/File/ConfigTest.php b/web/core/modules/system/tests/src/Functional/File/ConfigTest.php
index f44e8a92..cac94da5 100644
--- a/web/core/modules/system/tests/src/Functional/File/ConfigTest.php
+++ b/web/core/modules/system/tests/src/Functional/File/ConfigTest.php
@@ -18,7 +18,9 @@ class ConfigTest extends BrowserTestBase {
protected function setUp() {
parent::setUp();
- $this->drupalLogin($this->drupalCreateUser(['administer site configuration']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer site configuration',
+ ]));
}
/**
diff --git a/web/core/modules/system/tests/src/Functional/Form/ElementsVerticalTabsTest.php b/web/core/modules/system/tests/src/Functional/Form/ElementsVerticalTabsTest.php
index e90c4dfe..27f18e80 100644
--- a/web/core/modules/system/tests/src/Functional/Form/ElementsVerticalTabsTest.php
+++ b/web/core/modules/system/tests/src/Functional/Form/ElementsVerticalTabsTest.php
@@ -42,7 +42,9 @@ class ElementsVerticalTabsTest extends BrowserTestBase {
protected function setUp() {
parent::setUp();
- $this->adminUser = $this->drupalCreateUser(['access vertical_tab_test tabs']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'access vertical_tab_test tabs',
+ ]);
$this->webUser = $this->drupalCreateUser();
$this->drupalLogin($this->adminUser);
}
diff --git a/web/core/modules/system/tests/src/Functional/Form/FormTest.php b/web/core/modules/system/tests/src/Functional/Form/FormTest.php
index 08d556dc..31b16d0d 100644
--- a/web/core/modules/system/tests/src/Functional/Form/FormTest.php
+++ b/web/core/modules/system/tests/src/Functional/Form/FormTest.php
@@ -251,21 +251,27 @@ class FormTest extends BrowserTestBase {
$this->assertSession()
->elementExists('css', 'input[name="form_token"]')
->setValue('invalid token');
+ $random_string = $this->randomString();
$edit = [
- 'textfield' => $this->randomString(),
+ 'textfield' => $random_string,
'checkboxes[bar]' => TRUE,
'select' => 'bar',
'radios' => 'foo',
];
$this->drupalPostForm(NULL, $edit, 'Submit');
$this->assertFieldByXpath('//div[contains(@class, "error")]', NULL, 'Error message is displayed with invalid token even when required fields are filled.');
- $this->assertText('The form has become outdated. Copy any unsaved work in the form below');
- // Verify that input elements retained the posted values.
- $this->assertFieldByName('textfield', $edit['textfield']);
+
+ $assert = $this->assertSession();
+ $element = $assert->fieldExists('textfield');
+ $this->assertEmpty($element->getValue());
+ $assert->responseNotContains($random_string);
+ $this->assertText('The form has become outdated.');
+ // Ensure that we don't use the posted values.
+ $this->assertFieldByName('textfield', '');
$this->assertNoFieldChecked('edit-checkboxes-foo');
- $this->assertFieldChecked('edit-checkboxes-bar');
- $this->assertOptionSelected('edit-select', 'bar');
- $this->assertFieldChecked('edit-radios-foo');
+ $this->assertNoFieldChecked('edit-checkboxes-bar');
+ $this->assertOptionSelected('edit-select', '');
+ $this->assertNoFieldChecked('edit-radios-foo');
// Check another form that has a textarea input.
$this->drupalGet(Url::fromRoute('form_test.required'));
@@ -278,9 +284,9 @@ class FormTest extends BrowserTestBase {
];
$this->drupalPostForm(NULL, $edit, 'Submit');
$this->assertFieldByXpath('//div[contains(@class, "error")]', NULL, 'Error message is displayed with invalid token even when required fields are filled.');
- $this->assertText('The form has become outdated. Copy any unsaved work in the form below');
- $this->assertFieldByName('textfield', $edit['textfield']);
- $this->assertFieldByName('textarea', $edit['textarea']);
+ $this->assertText('The form has become outdated.');
+ $this->assertFieldByName('textfield', '');
+ $this->assertFieldByName('textarea', '');
// Check another form that has a number input.
$this->drupalGet(Url::fromRoute('form_test.number'));
@@ -288,12 +294,14 @@ class FormTest extends BrowserTestBase {
->elementExists('css', 'input[name="form_token"]')
->setValue('invalid token');
$edit = [
- 'integer_step' => mt_rand(1, 100),
+ // We choose a random value which is higher than the default value,
+ // so we don't accidentally generate the default value.
+ 'integer_step' => mt_rand(6, 100),
];
$this->drupalPostForm(NULL, $edit, 'Submit');
$this->assertFieldByXpath('//div[contains(@class, "error")]', NULL, 'Error message is displayed with invalid token even when required fields are filled.');
- $this->assertText('The form has become outdated. Copy any unsaved work in the form below');
- $this->assertFieldByName('integer_step', $edit['integer_step']);
+ $this->assertText('The form has become outdated.');
+ $this->assertFieldByName('integer_step', 5);
// Check a form with a Url field
$this->drupalGet(Url::fromRoute('form_test.url'));
@@ -305,8 +313,8 @@ class FormTest extends BrowserTestBase {
];
$this->drupalPostForm(NULL, $edit, 'Submit');
$this->assertFieldByXpath('//div[contains(@class, "error")]', NULL, 'Error message is displayed with invalid token even when required fields are filled.');
- $this->assertText('The form has become outdated. Copy any unsaved work in the form below');
- $this->assertFieldByName('url', $edit['url']);
+ $this->assertText('The form has become outdated.');
+ $this->assertFieldByName('url', '');
}
/**
diff --git a/web/core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php b/web/core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php
index 70af4808..f1eeee74 100644
--- a/web/core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php
+++ b/web/core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php
@@ -27,7 +27,10 @@ class ModulesListFormWebTest extends BrowserTestBase {
protected function setUp() {
parent::setUp();
\Drupal::state()->set('system_test.module_hidden', FALSE);
- $this->drupalLogin($this->drupalCreateUser(['administer modules', 'administer permissions']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer modules',
+ 'administer permissions',
+ ]));
}
/**
diff --git a/web/core/modules/system/tests/src/Functional/Form/ValidationTest.php b/web/core/modules/system/tests/src/Functional/Form/ValidationTest.php
index cadf4275..4633aabb 100644
--- a/web/core/modules/system/tests/src/Functional/Form/ValidationTest.php
+++ b/web/core/modules/system/tests/src/Functional/Form/ValidationTest.php
@@ -74,7 +74,7 @@ class ValidationTest extends BrowserTestBase {
$this->drupalPostForm(NULL, ['name' => 'validate'], 'Save');
$this->assertNoFieldByName('name', '#value changed by #validate', 'Form element #value was not altered.');
$this->assertNoText('Name value: value changed by setValueForElement() in #validate', 'Form element value in $form_state was not altered.');
- $this->assertText('The form has become outdated. Copy any unsaved work in the form below');
+ $this->assertText('The form has become outdated.');
}
/**
diff --git a/web/core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php b/web/core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php
index b1b4fc13..fc4431d5 100644
--- a/web/core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php
+++ b/web/core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php
@@ -154,9 +154,9 @@ class BreadcrumbTest extends BrowserTestBase {
$trail = $home;
$this->assertBreadcrumb("node/$nid1", $trail);
// Also verify that the node does not appear elsewhere (e.g., menu trees).
- $this->assertNoLink($node1->getTitle());
+ $this->assertSession()->linkNotExists($node1->getTitle());
// Also verify that the node does not appear elsewhere (e.g., menu trees).
- $this->assertNoLink($node1->getTitle());
+ $this->assertSession()->linkNotExists($node1->getTitle());
$trail += [
"node/$nid1" => $node1->getTitle(),
@@ -286,7 +286,8 @@ class BreadcrumbTest extends BrowserTestBase {
$link_path => $link->getTitle(),
];
$this->assertBreadcrumb($link_path, $trail, $term->getName(), $tree);
- $this->assertEscaped($parent->getTitle(), 'Tagged node found.');
+ // Ensure that the tagged node is found.
+ $this->assertEscaped($parent->getTitle());
// Additionally make sure that this link appears only once; i.e., the
// untranslated menu links automatically generated from menu router items
diff --git a/web/core/modules/system/tests/src/Functional/Menu/LocalTasksTest.php b/web/core/modules/system/tests/src/Functional/Menu/LocalTasksTest.php
index 3ca2fe91..e0fd44ab 100644
--- a/web/core/modules/system/tests/src/Functional/Menu/LocalTasksTest.php
+++ b/web/core/modules/system/tests/src/Functional/Menu/LocalTasksTest.php
@@ -79,7 +79,7 @@ class LocalTasksTest extends BrowserTestBase {
* @return bool
* TRUE if the local task exists on the page.
*/
- protected function assertLocalTaskAppers($title) {
+ protected function assertLocalTaskAppears($title) {
// SimpleXML gives us the unescaped text, not the actual escaped markup,
// so use a pattern instead to check the raw content.
// This behavior is a bug in libxml, see
@@ -116,9 +116,9 @@ class LocalTasksTest extends BrowserTestBase {
// Verify that script tags are escaped on output.
$title = Html::escape("Task 1 ");
- $this->assertLocalTaskAppers($title);
+ $this->assertLocalTaskAppears($title);
$title = Html::escape("");
- $this->assertLocalTaskAppers($title);
+ $this->assertLocalTaskAppears($title);
// Verify that local tasks appear as defined in the router.
$this->drupalGet(Url::fromRoute('menu_test.local_task_test_tasks_view'));
@@ -130,7 +130,7 @@ class LocalTasksTest extends BrowserTestBase {
]);
$title = Html::escape("");
- $this->assertLocalTaskAppers($title);
+ $this->assertLocalTaskAppears($title);
// Ensure the view tab is active.
$result = $this->xpath('//ul[contains(@class, "tabs")]//li[contains(@class, "active")]/a');
diff --git a/web/core/modules/system/tests/src/Functional/Menu/MenuAccessTest.php b/web/core/modules/system/tests/src/Functional/Menu/MenuAccessTest.php
index 36eb4242..dadfae0d 100644
--- a/web/core/modules/system/tests/src/Functional/Menu/MenuAccessTest.php
+++ b/web/core/modules/system/tests/src/Functional/Menu/MenuAccessTest.php
@@ -42,11 +42,11 @@ class MenuAccessTest extends BrowserTestBase {
$this->drupalPlaceBlock('system_menu_block:account');
// Test that there's link rendered on the route.
$this->drupalGet('menu_test_access_check_session');
- $this->assertLink('Test custom route access check');
+ $this->assertSession()->linkExists('Test custom route access check');
// Page is still accessible but there should be no menu link.
$this->drupalGet('menu_test_access_check_session');
$this->assertSession()->statusCodeEquals(200);
- $this->assertNoLink('Test custom route access check');
+ $this->assertSession()->linkNotExists('Test custom route access check');
// Test that page is no more accessible.
$this->drupalGet('menu_test_access_check_session');
$this->assertSession()->statusCodeEquals(403);
diff --git a/web/core/modules/system/tests/src/Functional/Menu/MenuRouterTest.php b/web/core/modules/system/tests/src/Functional/Menu/MenuRouterTest.php
index 1da42f13..8c435c85 100644
--- a/web/core/modules/system/tests/src/Functional/Menu/MenuRouterTest.php
+++ b/web/core/modules/system/tests/src/Functional/Menu/MenuRouterTest.php
@@ -65,10 +65,10 @@ class MenuRouterTest extends BrowserTestBase {
// Confirm correct controller activated.
$this->assertText('test1');
// Confirm local task links are displayed.
- $this->assertLink('Local task A');
- $this->assertLink('Local task B');
- $this->assertNoLink('Local task C');
- $this->assertEscaped("", ENT_QUOTES, 'UTF-8');
+ $this->assertSession()->linkExists('Local task A');
+ $this->assertSession()->linkExists('Local task B');
+ $this->assertSession()->linkNotExists('Local task C');
+ $this->assertEscaped("");
// Confirm correct local task href.
$this->assertLinkByHref(Url::fromRoute('menu_test.router_test1', ['bar' => $machine_name])->toString());
$this->assertLinkByHref(Url::fromRoute('menu_test.router_test2', ['bar' => $machine_name])->toString());
diff --git a/web/core/modules/system/tests/src/Functional/Module/ClassLoaderTest.php b/web/core/modules/system/tests/src/Functional/Module/ClassLoaderTest.php
index cb855e34..c22247b6 100644
--- a/web/core/modules/system/tests/src/Functional/Module/ClassLoaderTest.php
+++ b/web/core/modules/system/tests/src/Functional/Module/ClassLoaderTest.php
@@ -2,6 +2,7 @@
namespace Drupal\Tests\system\Functional\Module;
+use Drupal\module_autoload_test\SomeClass;
use Drupal\Tests\BrowserTestBase;
/**
@@ -96,4 +97,19 @@ class ClassLoaderTest extends BrowserTestBase {
$this->assertTrue(\Drupal::moduleHandler()->moduleExists('module_install_class_loader_test2'), 'The module_install_class_loader_test2 module has been installed.');
}
+ /**
+ * Tests that .module files can use class constants in main section.
+ */
+ public function testAutoloadFromModuleFile() {
+ $this->assertFalse(defined('MODULE_AUTOLOAD_TEST_CONSTANT'));
+ $this->drupalLogin($this->rootUser);
+ $edit = [
+ "modules[module_autoload_test][enable]" => TRUE,
+ ];
+ $this->drupalPostForm('admin/modules', $edit, t('Install'));
+ $this->assertSession()->statusCodeEquals(200);
+ $this->resetAll();
+ $this->assertSame(SomeClass::TEST, MODULE_AUTOLOAD_TEST_CONSTANT);
+ }
+
}
diff --git a/web/core/modules/system/tests/src/Functional/Module/ExperimentalModuleTest.php b/web/core/modules/system/tests/src/Functional/Module/ExperimentalModuleTest.php
index eba632f0..9608ca06 100644
--- a/web/core/modules/system/tests/src/Functional/Module/ExperimentalModuleTest.php
+++ b/web/core/modules/system/tests/src/Functional/Module/ExperimentalModuleTest.php
@@ -29,7 +29,10 @@ class ExperimentalModuleTest extends BrowserTestBase {
*/
protected function setUp() {
parent::setUp();
- $this->adminUser = $this->drupalCreateUser(['access administration pages', 'administer modules']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'access administration pages',
+ 'administer modules',
+ ]);
$this->drupalLogin($this->adminUser);
}
diff --git a/web/core/modules/system/tests/src/Functional/Module/InstallUninstallTest.php b/web/core/modules/system/tests/src/Functional/Module/InstallUninstallTest.php
index 5e69fccc..ce0ea8ad 100644
--- a/web/core/modules/system/tests/src/Functional/Module/InstallUninstallTest.php
+++ b/web/core/modules/system/tests/src/Functional/Module/InstallUninstallTest.php
@@ -358,7 +358,7 @@ class InstallUninstallTest extends ModuleTestBase {
$this->drupalGet('admin/help/' . $module);
$this->assertSession()->statusCodeEquals(200);
$this->assertText($name . ' module', "'$name module' is on the help page for $module");
- $this->assertLink('online documentation for the ' . $name . ' module', 0, "Correct online documentation link is in the help page for $module");
+ $this->assertSession()->linkExists('online documentation for the ' . $name . ' module', 0, "Correct online documentation link is in the help page for $module");
}
/**
diff --git a/web/core/modules/system/tests/src/Functional/Module/ModuleTestBase.php b/web/core/modules/system/tests/src/Functional/Module/ModuleTestBase.php
index 1e681859..88c8d4c8 100644
--- a/web/core/modules/system/tests/src/Functional/Module/ModuleTestBase.php
+++ b/web/core/modules/system/tests/src/Functional/Module/ModuleTestBase.php
@@ -26,7 +26,10 @@ abstract class ModuleTestBase extends BrowserTestBase {
protected function setUp() {
parent::setUp();
- $this->adminUser = $this->drupalCreateUser(['access administration pages', 'administer modules']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'access administration pages',
+ 'administer modules',
+ ]);
$this->drupalLogin($this->adminUser);
}
diff --git a/web/core/modules/system/tests/src/Functional/System/AccessDeniedTest.php b/web/core/modules/system/tests/src/Functional/System/AccessDeniedTest.php
index 10c48ef8..c61d789c 100644
--- a/web/core/modules/system/tests/src/Functional/System/AccessDeniedTest.php
+++ b/web/core/modules/system/tests/src/Functional/System/AccessDeniedTest.php
@@ -36,7 +36,12 @@ class AccessDeniedTest extends BrowserTestBase {
$this->drupalPlaceBlock('page_title_block');
// Create an administrative user.
- $this->adminUser = $this->drupalCreateUser(['access administration pages', 'administer site configuration', 'link to any page', 'administer blocks']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'access administration pages',
+ 'administer site configuration',
+ 'link to any page',
+ 'administer blocks',
+ ]);
$this->adminUser->roles[] = 'administrator';
$this->adminUser->save();
diff --git a/web/core/modules/system/tests/src/Functional/System/AdminTest.php b/web/core/modules/system/tests/src/Functional/System/AdminTest.php
index 1d11616b..546cc222 100644
--- a/web/core/modules/system/tests/src/Functional/System/AdminTest.php
+++ b/web/core/modules/system/tests/src/Functional/System/AdminTest.php
@@ -63,7 +63,7 @@ class AdminTest extends BrowserTestBase {
// Verify that all visible, top-level administration links are listed on
// the main administration page.
foreach ($this->getTopLevelMenuLinks() as $item) {
- $this->assertLink($item->getTitle());
+ $this->assertSession()->linkExists($item->getTitle());
$this->assertLinkByHref($item->getUrlObject()->toString());
// The description should appear below the link.
$this->assertText($item->getDescription());
diff --git a/web/core/modules/system/tests/src/Functional/System/DateTimeTest.php b/web/core/modules/system/tests/src/Functional/System/DateTimeTest.php
index 10a3bd98..8ae1d705 100644
--- a/web/core/modules/system/tests/src/Functional/System/DateTimeTest.php
+++ b/web/core/modules/system/tests/src/Functional/System/DateTimeTest.php
@@ -159,7 +159,8 @@ class DateTimeTest extends BrowserTestBase {
$date_format->save();
$this->drupalGet(Url::fromRoute('entity.date_format.collection'));
- $this->assertEscaped("", 'The date format was properly escaped');
+ // Ensure that the date format is properly escaped.
+ $this->assertEscaped("");
// Add a new date format with HTML in it.
$date_format_id = strtolower($this->randomMachineName(8));
@@ -216,7 +217,9 @@ class DateTimeTest extends BrowserTestBase {
$this->drupalLogout();
// Now log in as a regular editor.
- $this->drupalLogin($this->drupalCreateUser(['create page_with_date content']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'create page_with_date content',
+ ]));
$this->drupalGet('node/add/page_with_date');
$edit = [
diff --git a/web/core/modules/system/tests/src/Functional/System/PageNotFoundTest.php b/web/core/modules/system/tests/src/Functional/System/PageNotFoundTest.php
index cea41586..f869b50a 100644
--- a/web/core/modules/system/tests/src/Functional/System/PageNotFoundTest.php
+++ b/web/core/modules/system/tests/src/Functional/System/PageNotFoundTest.php
@@ -34,7 +34,10 @@ class PageNotFoundTest extends BrowserTestBase {
parent::setUp();
// Create an administrative user.
- $this->adminUser = $this->drupalCreateUser(['administer site configuration', 'link to any page']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'administer site configuration',
+ 'link to any page',
+ ]);
$this->adminUser->roles[] = 'administrator';
$this->adminUser->save();
diff --git a/web/core/modules/system/tests/src/Functional/System/PageTitleTest.php b/web/core/modules/system/tests/src/Functional/System/PageTitleTest.php
index bc2ed201..21c66ad2 100644
--- a/web/core/modules/system/tests/src/Functional/System/PageTitleTest.php
+++ b/web/core/modules/system/tests/src/Functional/System/PageTitleTest.php
@@ -39,7 +39,13 @@ class PageTitleTest extends BrowserTestBase {
$this->drupalPlaceBlock('page_title_block');
- $this->contentUser = $this->drupalCreateUser(['create page content', 'access content', 'administer themes', 'administer site configuration', 'link to any page']);
+ $this->contentUser = $this->drupalCreateUser([
+ 'create page content',
+ 'access content',
+ 'administer themes',
+ 'administer site configuration',
+ 'link to any page',
+ ]);
$this->drupalLogin($this->contentUser);
}
diff --git a/web/core/modules/system/tests/src/Functional/System/SiteMaintenanceTest.php b/web/core/modules/system/tests/src/Functional/System/SiteMaintenanceTest.php
index b61390a7..d7d2474b 100644
--- a/web/core/modules/system/tests/src/Functional/System/SiteMaintenanceTest.php
+++ b/web/core/modules/system/tests/src/Functional/System/SiteMaintenanceTest.php
@@ -41,7 +41,10 @@ class SiteMaintenanceTest extends BrowserTestBase {
// Create a user allowed to access site in maintenance mode.
$this->user = $this->drupalCreateUser(['access site in maintenance mode']);
// Create an administrative user.
- $this->adminUser = $this->drupalCreateUser(['administer site configuration', 'access site in maintenance mode']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'administer site configuration',
+ 'access site in maintenance mode',
+ ]);
$this->drupalLogin($this->adminUser);
}
diff --git a/web/core/modules/system/tests/src/Functional/System/SystemAuthorizeTest.php b/web/core/modules/system/tests/src/Functional/System/SystemAuthorizeTest.php
index a8db1d76..32024ade 100644
--- a/web/core/modules/system/tests/src/Functional/System/SystemAuthorizeTest.php
+++ b/web/core/modules/system/tests/src/Functional/System/SystemAuthorizeTest.php
@@ -27,7 +27,9 @@ class SystemAuthorizeTest extends BrowserTestBase {
parent::setUp();
// Create an administrator user.
- $this->drupalLogin($this->drupalCreateUser(['administer software updates']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer software updates',
+ ]));
}
/**
diff --git a/web/core/modules/system/tests/src/Functional/System/ThemeTest.php b/web/core/modules/system/tests/src/Functional/System/ThemeTest.php
index eff90ee1..89e1d7a8 100644
--- a/web/core/modules/system/tests/src/Functional/System/ThemeTest.php
+++ b/web/core/modules/system/tests/src/Functional/System/ThemeTest.php
@@ -43,7 +43,13 @@ class ThemeTest extends BrowserTestBase {
$this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
- $this->adminUser = $this->drupalCreateUser(['access administration pages', 'view the administration theme', 'administer themes', 'bypass node access', 'administer blocks']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'access administration pages',
+ 'view the administration theme',
+ 'administer themes',
+ 'bypass node access',
+ 'administer blocks',
+ ]);
$this->drupalLogin($this->adminUser);
$this->node = $this->drupalCreateNode();
$this->drupalPlaceBlock('local_tasks_block');
@@ -202,16 +208,16 @@ class ThemeTest extends BrowserTestBase {
$this->drupalPlaceBlock('local_tasks_block', ['region' => 'header']);
$this->drupalGet('admin/appearance/settings');
$theme_handler = \Drupal::service('theme_handler');
- $this->assertLink($theme_handler->getName('classy'));
- $this->assertLink($theme_handler->getName('bartik'));
- $this->assertNoLink($theme_handler->getName('stable'));
+ $this->assertSession()->linkExists($theme_handler->getName('classy'));
+ $this->assertSession()->linkExists($theme_handler->getName('bartik'));
+ $this->assertSession()->linkNotExists($theme_handler->getName('stable'));
// If a hidden theme is an admin theme it should be viewable.
\Drupal::configFactory()->getEditable('system.theme')->set('admin', 'stable')->save();
\Drupal::service('router.builder')->rebuildIfNeeded();
$this->drupalPlaceBlock('local_tasks_block', ['region' => 'header', 'theme' => 'stable']);
$this->drupalGet('admin/appearance/settings');
- $this->assertLink($theme_handler->getName('stable'));
+ $this->assertSession()->linkExists($theme_handler->getName('stable'));
$this->drupalGet('admin/appearance/settings/stable');
$this->assertSession()->statusCodeEquals(200);
diff --git a/web/core/modules/system/tests/src/Functional/System/TokenReplaceWebTest.php b/web/core/modules/system/tests/src/Functional/System/TokenReplaceWebTest.php
index de6edc66..2e2664a2 100644
--- a/web/core/modules/system/tests/src/Functional/System/TokenReplaceWebTest.php
+++ b/web/core/modules/system/tests/src/Functional/System/TokenReplaceWebTest.php
@@ -38,7 +38,7 @@ class TokenReplaceWebTest extends BrowserTestBase {
$this->assertCacheTags(['node:1', 'rendered', 'user:2']);
$this->assertCacheContexts(['languages:language_interface', 'theme', 'url.query_args:' . MainContentViewSubscriber::WRAPPER_FORMAT, 'user']);
- $this->drupalGet('token-test-without-bubleable-metadata/' . $node->id());
+ $this->drupalGet('token-test-without-bubbleable-metadata/' . $node->id());
$this->assertText("Tokens: {$node->id()} {$account->id()}");
$this->assertCacheTags(['node:1', 'rendered', 'user:2']);
$this->assertCacheContexts(['languages:language_interface', 'theme', 'url.query_args:' . MainContentViewSubscriber::WRAPPER_FORMAT, 'user']);
diff --git a/web/core/modules/system/tests/src/Functional/System/TrustedHostsTest.php b/web/core/modules/system/tests/src/Functional/System/TrustedHostsTest.php
index 62ed131f..74292c02 100644
--- a/web/core/modules/system/tests/src/Functional/System/TrustedHostsTest.php
+++ b/web/core/modules/system/tests/src/Functional/System/TrustedHostsTest.php
@@ -108,7 +108,7 @@ class TrustedHostsTest extends BrowserTestBase {
$this->drupalPlaceBlock('shortcuts');
$this->drupalGet('');
- $this->assertLink($shortcut->label());
+ $this->assertSession()->linkExists($shortcut->label());
}
}
diff --git a/web/core/modules/system/tests/src/Functional/Theme/EntityFilteringThemeTest.php b/web/core/modules/system/tests/src/Functional/Theme/EntityFilteringThemeTest.php
index 130c8c41..2e2c6b28 100644
--- a/web/core/modules/system/tests/src/Functional/Theme/EntityFilteringThemeTest.php
+++ b/web/core/modules/system/tests/src/Functional/Theme/EntityFilteringThemeTest.php
@@ -90,7 +90,10 @@ class EntityFilteringThemeTest extends BrowserTestBase {
\Drupal::service('theme_installer')->install(array_keys($this->themes));
// Create a test user.
- $this->user = $this->drupalCreateUser(['access content', 'access user profiles']);
+ $this->user = $this->drupalCreateUser([
+ 'access content',
+ 'access user profiles',
+ ]);
$this->user->name = $this->xssLabel;
$this->user->save();
$this->drupalLogin($this->user);
diff --git a/web/core/modules/system/tests/src/Functional/Theme/ExperimentalThemeTest.php b/web/core/modules/system/tests/src/Functional/Theme/ExperimentalThemeTest.php
index 01409642..1fad43e7 100644
--- a/web/core/modules/system/tests/src/Functional/Theme/ExperimentalThemeTest.php
+++ b/web/core/modules/system/tests/src/Functional/Theme/ExperimentalThemeTest.php
@@ -28,7 +28,10 @@ class ExperimentalThemeTest extends BrowserTestBase {
*/
protected function setUp() {
parent::setUp();
- $this->adminUser = $this->drupalCreateUser(['access administration pages', 'administer themes']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'access administration pages',
+ 'administer themes',
+ ]);
$this->drupalLogin($this->adminUser);
}
diff --git a/web/core/modules/system/tests/src/Functional/Theme/ThemeTokenTest.php b/web/core/modules/system/tests/src/Functional/Theme/ThemeTokenTest.php
index fe07bb50..d3c8b420 100644
--- a/web/core/modules/system/tests/src/Functional/Theme/ThemeTokenTest.php
+++ b/web/core/modules/system/tests/src/Functional/Theme/ThemeTokenTest.php
@@ -28,7 +28,10 @@ class ThemeTokenTest extends BrowserTestBase {
*/
protected function setUp() {
parent::setUp();
- $account = $this->drupalCreateUser(['administer blocks', 'view the administration theme']);
+ $account = $this->drupalCreateUser([
+ 'administer blocks',
+ 'view the administration theme',
+ ]);
$this->drupalLogin($account);
}
diff --git a/web/core/modules/system/tests/src/Functional/UpdateSystem/InvalidUpdateHookTest.php b/web/core/modules/system/tests/src/Functional/UpdateSystem/InvalidUpdateHookTest.php
index c3771718..6edaa58b 100644
--- a/web/core/modules/system/tests/src/Functional/UpdateSystem/InvalidUpdateHookTest.php
+++ b/web/core/modules/system/tests/src/Functional/UpdateSystem/InvalidUpdateHookTest.php
@@ -50,7 +50,9 @@ class InvalidUpdateHookTest extends BrowserTestBase {
require_once $this->root . '/core/includes/update.inc';
$this->updateUrl = $GLOBALS['base_url'] . '/update.php';
- $this->updateUser = $this->drupalCreateUser(['administer software updates']);
+ $this->updateUser = $this->drupalCreateUser([
+ 'administer software updates',
+ ]);
}
public function testInvalidUpdateHook() {
diff --git a/web/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathLastRemovedTest.php b/web/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathLastRemovedTest.php
index 9b6cc77a..f51769ac 100644
--- a/web/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathLastRemovedTest.php
+++ b/web/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathLastRemovedTest.php
@@ -46,7 +46,9 @@ class UpdatePathLastRemovedTest extends BrowserTestBase {
require_once $this->root . '/core/includes/update.inc';
$this->updateUrl = Url::fromRoute('system.db_update');
- $this->updateUser = $this->drupalCreateUser(['administer software updates']);
+ $this->updateUser = $this->drupalCreateUser([
+ 'administer software updates',
+ ]);
}
/**
diff --git a/web/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathTestBaseFilledTest.php b/web/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathTestBaseFilledTest.php
index 254a9d95..3aa73661 100644
--- a/web/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathTestBaseFilledTest.php
+++ b/web/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathTestBaseFilledTest.php
@@ -103,7 +103,7 @@ class UpdatePathTestBaseFilledTest extends UpdatePathTestBaseTest {
// now that we're logged in.
$this->drupalGet('node/8', ['language' => $spanish]);
$this->assertText('Test 12');
- $this->assertLink('drupal');
+ $this->assertSession()->linkExists('drupal');
// Make sure the content for node 8 is still in the edit form.
$this->drupalGet('node/8/edit');
@@ -135,7 +135,7 @@ class UpdatePathTestBaseFilledTest extends UpdatePathTestBaseTest {
$this->assertText('usuario_test');
$this->assertRaw('druplicon.small');
$this->assertText('Test file field');
- $this->assertLink('test.txt');
+ $this->assertSession()->linkExists('test.txt');
// Make sure the user is translated.
$this->drupalGet('user/3/translations');
@@ -235,24 +235,24 @@ class UpdatePathTestBaseFilledTest extends UpdatePathTestBaseTest {
$this->drupalGet('admin/structure/types/manage/test_content_type/fields');
// Make sure fields are the right type.
- $this->assertLink('Text (formatted, long, with summary)');
- $this->assertLink('Boolean');
- $this->assertLink('Comments');
- $this->assertLink('Date');
- $this->assertLink('Email');
- $this->assertLink('Link');
- $this->assertLink('List (float)');
- $this->assertLink('Telephone number');
- $this->assertLink('Entity reference');
- $this->assertLink('File');
- $this->assertLink('Image');
- $this->assertLink('Text (plain, long)');
- $this->assertLink('List (text)');
- $this->assertLink('Text (formatted, long)');
- $this->assertLink('Text (plain)');
- $this->assertLink('List (integer)');
- $this->assertLink('Number (integer)');
- $this->assertLink('Number (float)');
+ $this->assertSession()->linkExists('Text (formatted, long, with summary)');
+ $this->assertSession()->linkExists('Boolean');
+ $this->assertSession()->linkExists('Comments');
+ $this->assertSession()->linkExists('Date');
+ $this->assertSession()->linkExists('Email');
+ $this->assertSession()->linkExists('Link');
+ $this->assertSession()->linkExists('List (float)');
+ $this->assertSession()->linkExists('Telephone number');
+ $this->assertSession()->linkExists('Entity reference');
+ $this->assertSession()->linkExists('File');
+ $this->assertSession()->linkExists('Image');
+ $this->assertSession()->linkExists('Text (plain, long)');
+ $this->assertSession()->linkExists('List (text)');
+ $this->assertSession()->linkExists('Text (formatted, long)');
+ $this->assertSession()->linkExists('Text (plain)');
+ $this->assertSession()->linkExists('List (integer)');
+ $this->assertSession()->linkExists('Number (integer)');
+ $this->assertSession()->linkExists('Number (float)');
// Make sure our form mode exists.
$this->drupalGet('admin/structure/display-modes/form');
@@ -327,7 +327,7 @@ class UpdatePathTestBaseFilledTest extends UpdatePathTestBaseTest {
// Make sure the terms are still translated.
$this->drupalGet('taxonomy/term/2/translations');
- $this->assertLink('Test root term - Spanish');
+ $this->assertSession()->linkExists('Test root term - Spanish');
// Make sure our contact form exists.
$this->drupalGet('admin/structure/contact');
diff --git a/web/core/modules/system/tests/src/Functional/UpdateSystem/UpdateRemovedPostUpdateTest.php b/web/core/modules/system/tests/src/Functional/UpdateSystem/UpdateRemovedPostUpdateTest.php
index 96f1559a..b6dfc1a5 100644
--- a/web/core/modules/system/tests/src/Functional/UpdateSystem/UpdateRemovedPostUpdateTest.php
+++ b/web/core/modules/system/tests/src/Functional/UpdateSystem/UpdateRemovedPostUpdateTest.php
@@ -56,7 +56,9 @@ class UpdateRemovedPostUpdateTest extends BrowserTestBase {
->execute();
$this->updateUrl = Url::fromRoute('system.db_update');
- $this->updateUser = $this->drupalCreateUser(['administer software updates']);
+ $this->updateUser = $this->drupalCreateUser([
+ 'administer software updates',
+ ]);
}
/**
diff --git a/web/core/modules/system/tests/src/Functional/UpdateSystem/UpdateSchemaTest.php b/web/core/modules/system/tests/src/Functional/UpdateSystem/UpdateSchemaTest.php
index c075e184..9f2811c2 100644
--- a/web/core/modules/system/tests/src/Functional/UpdateSystem/UpdateSchemaTest.php
+++ b/web/core/modules/system/tests/src/Functional/UpdateSystem/UpdateSchemaTest.php
@@ -45,7 +45,10 @@ class UpdateSchemaTest extends BrowserTestBase {
parent::setUp();
require_once $this->root . '/core/includes/update.inc';
- $this->user = $this->drupalCreateUser(['administer software updates', 'access site in maintenance mode']);
+ $this->user = $this->drupalCreateUser([
+ 'administer software updates',
+ 'access site in maintenance mode',
+ ]);
$this->updateUrl = Url::fromRoute('system.db_update');
}
diff --git a/web/core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php b/web/core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php
index 7c3c3bff..5cb492df 100644
--- a/web/core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php
+++ b/web/core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php
@@ -86,7 +86,7 @@ class UpdateScriptTest extends BrowserTestBase {
// Check that a link to the update page is not accessible to regular users.
$this->drupalGet('/update-script-test/database-updates-menu-item');
- $this->assertNoLink('Run database updates');
+ $this->assertSession()->linkNotExists('Run database updates');
// Try accessing update.php as an anonymous user.
$this->drupalLogout();
@@ -96,7 +96,7 @@ class UpdateScriptTest extends BrowserTestBase {
// Check that a link to the update page is not accessible to anonymous
// users.
$this->drupalGet('/update-script-test/database-updates-menu-item');
- $this->assertNoLink('Run database updates');
+ $this->assertSession()->linkNotExists('Run database updates');
// Access the update page with the proper permission.
$this->drupalLogin($this->updateUser);
@@ -106,7 +106,7 @@ class UpdateScriptTest extends BrowserTestBase {
// Check that a link to the update page is accessible to users with proper
// permissions.
$this->drupalGet('/update-script-test/database-updates-menu-item');
- $this->assertLink('Run database updates');
+ $this->assertSession()->linkExists('Run database updates');
// Access the update page as user 1.
$this->drupalLogin($this->rootUser);
@@ -115,7 +115,7 @@ class UpdateScriptTest extends BrowserTestBase {
// Check that a link to the update page is accessible to user 1.
$this->drupalGet('/update-script-test/database-updates-menu-item');
- $this->assertLink('Run database updates');
+ $this->assertSession()->linkExists('Run database updates');
}
/**
@@ -519,19 +519,22 @@ class UpdateScriptTest extends BrowserTestBase {
$this->updateRequirementsProblem();
$this->clickLink(t('Continue'));
$this->assertText(t('No pending updates.'));
- $this->assertNoLink('Administration pages');
+ $this->assertSession()->linkNotExists('Administration pages');
$this->assertEmpty($this->xpath('//main//a[contains(@href, :href)]', [':href' => 'update.php']));
$this->clickLink('Front page');
$this->assertSession()->statusCodeEquals(200);
// Click through update.php with 'access administration pages' permission.
- $admin_user = $this->drupalCreateUser(['administer software updates', 'access administration pages']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer software updates',
+ 'access administration pages',
+ ]);
$this->drupalLogin($admin_user);
$this->drupalGet($this->updateUrl, ['external' => TRUE]);
$this->updateRequirementsProblem();
$this->clickLink(t('Continue'));
$this->assertText(t('No pending updates.'));
- $this->assertLink('Administration pages');
+ $this->assertSession()->linkExists('Administration pages');
$this->assertEmpty($this->xpath('//main//a[contains(@href, :href)]', [':href' => 'update.php']));
$this->clickLink('Administration pages');
$this->assertSession()->statusCodeEquals(200);
@@ -558,7 +561,12 @@ class UpdateScriptTest extends BrowserTestBase {
// Click through update.php with 'access administration pages' and
// 'access site reports' permissions.
- $admin_user = $this->drupalCreateUser(['administer software updates', 'access administration pages', 'access site reports', 'access site in maintenance mode']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer software updates',
+ 'access administration pages',
+ 'access site reports',
+ 'access site in maintenance mode',
+ ]);
$this->drupalLogin($admin_user);
$this->drupalGet($this->updateUrl, ['external' => TRUE]);
$this->updateRequirementsProblem();
@@ -566,8 +574,8 @@ class UpdateScriptTest extends BrowserTestBase {
$this->clickLink(t('Apply pending updates'));
$this->checkForMetaRefresh();
$this->assertText('Updates were attempted.');
- $this->assertLink('logged');
- $this->assertLink('Administration pages');
+ $this->assertSession()->linkExists('logged');
+ $this->assertSession()->linkExists('Administration pages');
$this->assertEmpty($this->xpath('//main//a[contains(@href, :href)]', [':href' => 'update.php']));
$this->clickLink('Administration pages');
$this->assertSession()->statusCodeEquals(200);
@@ -617,7 +625,13 @@ class UpdateScriptTest extends BrowserTestBase {
$this->assertEqual($schema_version, 8000, 'update_script_test schema version overridden to 8000.');
// Create admin user.
- $admin_user = $this->drupalCreateUser(['administer software updates', 'access administration pages', 'access site reports', 'access site in maintenance mode', 'administer site configuration']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer software updates',
+ 'access administration pages',
+ 'access site reports',
+ 'access site in maintenance mode',
+ 'administer site configuration',
+ ]);
$this->drupalLogin($admin_user);
// Visit status report page and ensure, that link to update.php has no path prefix set.
@@ -634,8 +648,8 @@ class UpdateScriptTest extends BrowserTestBase {
$this->clickLink(t('Apply pending updates'));
$this->checkForMetaRefresh();
$this->assertText('Updates were attempted.');
- $this->assertLink('logged');
- $this->assertLink('Administration pages');
+ $this->assertSession()->linkExists('logged');
+ $this->assertSession()->linkExists('Administration pages');
$this->assertEmpty($this->xpath('//main//a[contains(@href, :href)]', [':href' => 'update.php']));
$this->clickLink('Administration pages');
$this->assertSession()->statusCodeEquals(200);
@@ -686,7 +700,7 @@ class UpdateScriptTest extends BrowserTestBase {
// Verify that updates were completed successfully.
$this->assertText('Updates were attempted.');
- $this->assertLink('site');
+ $this->assertSession()->linkExists('site');
$this->assertText('The update_script_test_update_8001() update was executed successfully.');
// Verify that no 7.x updates were run.
@@ -694,9 +708,9 @@ class UpdateScriptTest extends BrowserTestBase {
$this->assertNoText('The update_script_test_update_7201() update was executed successfully.');
// Verify that there are no links to different parts of the workflow.
- $this->assertNoLink('Administration pages');
+ $this->assertSession()->linkNotExists('Administration pages');
$this->assertEmpty($this->xpath('//main//a[contains(@href, :href)]', [':href' => 'update.php']));
- $this->assertNoLink('logged');
+ $this->assertSession()->linkNotExists('logged');
// Verify the front page can be visited following the upgrade.
$this->clickLink('Front page');
diff --git a/web/core/modules/system/tests/src/Functional/UpdateSystem/UpdatesWith7xTest.php b/web/core/modules/system/tests/src/Functional/UpdateSystem/UpdatesWith7xTest.php
index 0eda9dd8..7dca8dc9 100644
--- a/web/core/modules/system/tests/src/Functional/UpdateSystem/UpdatesWith7xTest.php
+++ b/web/core/modules/system/tests/src/Functional/UpdateSystem/UpdatesWith7xTest.php
@@ -43,7 +43,9 @@ class UpdatesWith7xTest extends BrowserTestBase {
parent::setUp();
require_once $this->root . '/core/includes/update.inc';
$this->updateUrl = $GLOBALS['base_url'] . '/update.php';
- $this->updateUser = $this->drupalCreateUser(['administer software updates']);
+ $this->updateUser = $this->drupalCreateUser([
+ 'administer software updates',
+ ]);
}
public function testWith7x() {
diff --git a/web/core/modules/system/tests/src/FunctionalJavascript/System/DateFormatTest.php b/web/core/modules/system/tests/src/FunctionalJavascript/System/DateFormatTest.php
index 3460f15b..cd789030 100644
--- a/web/core/modules/system/tests/src/FunctionalJavascript/System/DateFormatTest.php
+++ b/web/core/modules/system/tests/src/FunctionalJavascript/System/DateFormatTest.php
@@ -29,7 +29,9 @@ class DateFormatTest extends WebDriverTestBase {
parent::setUp();
// Create admin user and log in admin user.
- $this->drupalLogin($this->drupalCreateUser(['administer site configuration']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer site configuration',
+ ]));
$this->drupalPlaceBlock('local_actions_block');
}
diff --git a/web/core/modules/taxonomy/tests/src/Functional/EarlyDateTest.php b/web/core/modules/taxonomy/tests/src/Functional/EarlyDateTest.php
index 74b00937..211e3e57 100644
--- a/web/core/modules/taxonomy/tests/src/Functional/EarlyDateTest.php
+++ b/web/core/modules/taxonomy/tests/src/Functional/EarlyDateTest.php
@@ -51,7 +51,11 @@ class EarlyDateTest extends TaxonomyTestBase {
])
->save();
- $this->drupalLogin($this->drupalCreateUser(['administer taxonomy', 'administer nodes', 'bypass node access']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer taxonomy',
+ 'administer nodes',
+ 'bypass node access',
+ ]));
}
/**
diff --git a/web/core/modules/taxonomy/tests/src/Functional/RssTest.php b/web/core/modules/taxonomy/tests/src/Functional/RssTest.php
index d208a3a4..ae80adb5 100644
--- a/web/core/modules/taxonomy/tests/src/Functional/RssTest.php
+++ b/web/core/modules/taxonomy/tests/src/Functional/RssTest.php
@@ -42,7 +42,12 @@ class RssTest extends TaxonomyTestBase {
protected function setUp() {
parent::setUp();
- $this->drupalLogin($this->drupalCreateUser(['administer taxonomy', 'bypass node access', 'administer content types', 'administer node display']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer taxonomy',
+ 'bypass node access',
+ 'administer content types',
+ 'administer node display',
+ ]));
$this->vocabulary = $this->createVocabulary();
$this->fieldName = 'taxonomy_' . $this->vocabulary->id();
diff --git a/web/core/modules/taxonomy/tests/src/Functional/TaxonomyImageTest.php b/web/core/modules/taxonomy/tests/src/Functional/TaxonomyImageTest.php
index 4c326519..747a4c04 100644
--- a/web/core/modules/taxonomy/tests/src/Functional/TaxonomyImageTest.php
+++ b/web/core/modules/taxonomy/tests/src/Functional/TaxonomyImageTest.php
@@ -80,7 +80,11 @@ class TaxonomyImageTest extends TaxonomyTestBase {
}
public function testTaxonomyImageAccess() {
- $user = $this->drupalCreateUser(['administer site configuration', 'administer taxonomy', 'access user profiles']);
+ $user = $this->drupalCreateUser([
+ 'administer site configuration',
+ 'administer taxonomy',
+ 'access user profiles',
+ ]);
$this->drupalLogin($user);
// Create a term and upload the image.
diff --git a/web/core/modules/taxonomy/tests/src/Functional/TaxonomyTermIndentationTest.php b/web/core/modules/taxonomy/tests/src/Functional/TaxonomyTermIndentationTest.php
index 8e580023..74d10f55 100644
--- a/web/core/modules/taxonomy/tests/src/Functional/TaxonomyTermIndentationTest.php
+++ b/web/core/modules/taxonomy/tests/src/Functional/TaxonomyTermIndentationTest.php
@@ -30,7 +30,10 @@ class TaxonomyTermIndentationTest extends TaxonomyTestBase {
protected function setUp() {
parent::setUp();
- $this->drupalLogin($this->drupalCreateUser(['administer taxonomy', 'bypass node access']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer taxonomy',
+ 'bypass node access',
+ ]));
$this->vocabulary = $this->createVocabulary();
}
diff --git a/web/core/modules/taxonomy/tests/src/Functional/TaxonomyTermPagerTest.php b/web/core/modules/taxonomy/tests/src/Functional/TaxonomyTermPagerTest.php
index 99c80db1..c5866fdd 100644
--- a/web/core/modules/taxonomy/tests/src/Functional/TaxonomyTermPagerTest.php
+++ b/web/core/modules/taxonomy/tests/src/Functional/TaxonomyTermPagerTest.php
@@ -33,7 +33,10 @@ class TaxonomyTermPagerTest extends TaxonomyTestBase {
*/
protected function setUp() {
parent::setUp();
- $this->drupalLogin($this->drupalCreateUser(['administer taxonomy', 'bypass node access']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer taxonomy',
+ 'bypass node access',
+ ]));
$this->vocabulary = $this->createVocabulary();
}
diff --git a/web/core/modules/taxonomy/tests/src/Functional/TermIndexTest.php b/web/core/modules/taxonomy/tests/src/Functional/TermIndexTest.php
index dd240bee..f83313d7 100644
--- a/web/core/modules/taxonomy/tests/src/Functional/TermIndexTest.php
+++ b/web/core/modules/taxonomy/tests/src/Functional/TermIndexTest.php
@@ -50,7 +50,10 @@ class TermIndexTest extends TaxonomyTestBase {
parent::setUp();
// Create an administrative user.
- $this->drupalLogin($this->drupalCreateUser(['administer taxonomy', 'bypass node access']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer taxonomy',
+ 'bypass node access',
+ ]));
// Create a vocabulary and add two term reference fields to article nodes.
$this->vocabulary = $this->createVocabulary();
diff --git a/web/core/modules/taxonomy/tests/src/Functional/TermTest.php b/web/core/modules/taxonomy/tests/src/Functional/TermTest.php
index 9c5b9939..3c8e2ee0 100644
--- a/web/core/modules/taxonomy/tests/src/Functional/TermTest.php
+++ b/web/core/modules/taxonomy/tests/src/Functional/TermTest.php
@@ -51,7 +51,10 @@ class TermTest extends TaxonomyTestBase {
$this->drupalPlaceBlock('local_tasks_block');
$this->drupalPlaceBlock('page_title_block');
- $this->drupalLogin($this->drupalCreateUser(['administer taxonomy', 'bypass node access']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer taxonomy',
+ 'bypass node access',
+ ]));
$this->vocabulary = $this->createVocabulary();
$field_name = 'taxonomy_' . $this->vocabulary->id();
@@ -355,7 +358,7 @@ class TermTest extends TaxonomyTestBase {
// Check that the term is still present at admin UI after edit.
$this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/overview');
$this->assertText($edit['name[0][value]'], 'The randomly generated term name is present.');
- $this->assertLink(t('Edit'));
+ $this->assertSession()->linkExists(t('Edit'));
// Check the term link can be clicked through to the term page.
$this->clickLink($edit['name[0][value]']);
@@ -601,7 +604,7 @@ class TermTest extends TaxonomyTestBase {
$this->assertCount(2, $breadcrumbs, 'The breadcrumbs are present on the page.');
$this->assertIdentical($breadcrumbs[0]->getText(), 'Home', 'First breadcrumb text is Home');
$this->assertIdentical($breadcrumbs[1]->getText(), $term->label(), 'Second breadcrumb text is term name on term edit page.');
- $this->assertEscaped($breadcrumbs[1]->getText(), 'breadcrumbs displayed and escaped.');
+ $this->assertEscaped($breadcrumbs[1]->getText());
// Check the breadcrumb on the term delete page.
$this->drupalGet('taxonomy/term/' . $term->id() . '/delete');
@@ -609,7 +612,7 @@ class TermTest extends TaxonomyTestBase {
$this->assertCount(2, $breadcrumbs, 'The breadcrumbs are present on the page.');
$this->assertIdentical($breadcrumbs[0]->getText(), 'Home', 'First breadcrumb text is Home');
$this->assertIdentical($breadcrumbs[1]->getText(), $term->label(), 'Second breadcrumb text is term name on term delete page.');
- $this->assertEscaped($breadcrumbs[1]->getText(), 'breadcrumbs displayed and escaped.');
+ $this->assertEscaped($breadcrumbs[1]->getText());
}
}
diff --git a/web/core/modules/taxonomy/tests/src/Functional/ThemeTest.php b/web/core/modules/taxonomy/tests/src/Functional/ThemeTest.php
index e0a8774f..2fd550ef 100644
--- a/web/core/modules/taxonomy/tests/src/Functional/ThemeTest.php
+++ b/web/core/modules/taxonomy/tests/src/Functional/ThemeTest.php
@@ -27,7 +27,10 @@ class ThemeTest extends TaxonomyTestBase {
// Create and log in as a user who has permission to add and edit taxonomy
// terms and view the administrative theme.
- $admin_user = $this->drupalCreateUser(['administer taxonomy', 'view the administration theme']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer taxonomy',
+ 'view the administration theme',
+ ]);
$this->drupalLogin($admin_user);
}
diff --git a/web/core/modules/taxonomy/tests/src/Functional/TokenReplaceTest.php b/web/core/modules/taxonomy/tests/src/Functional/TokenReplaceTest.php
index 7474cee2..c2100136 100644
--- a/web/core/modules/taxonomy/tests/src/Functional/TokenReplaceTest.php
+++ b/web/core/modules/taxonomy/tests/src/Functional/TokenReplaceTest.php
@@ -35,7 +35,10 @@ class TokenReplaceTest extends TaxonomyTestBase {
protected function setUp() {
parent::setUp();
- $this->drupalLogin($this->drupalCreateUser(['administer taxonomy', 'bypass node access']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer taxonomy',
+ 'bypass node access',
+ ]));
$this->vocabulary = $this->createVocabulary();
$this->fieldName = 'taxonomy_' . $this->vocabulary->id();
diff --git a/web/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyIndexTidUiTest.php b/web/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyIndexTidUiTest.php
index df286a33..eb0774ab 100644
--- a/web/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyIndexTidUiTest.php
+++ b/web/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyIndexTidUiTest.php
@@ -57,7 +57,10 @@ class TaxonomyIndexTidUiTest extends UITestBase {
protected function setUp($import_test_views = TRUE) {
parent::setUp($import_test_views);
- $this->adminUser = $this->drupalCreateUser(['administer taxonomy', 'administer views']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'administer taxonomy',
+ 'administer views',
+ ]);
$this->drupalLogin($this->adminUser);
Vocabulary::create([
diff --git a/web/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php b/web/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php
index e1b7f3f1..f1ac4414 100644
--- a/web/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php
+++ b/web/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php
@@ -49,7 +49,10 @@ class TaxonomyTermViewTest extends TaxonomyTestBase {
parent::setUp($import_test_views);
// Create an administrative user.
- $this->adminUser = $this->drupalCreateUser(['administer taxonomy', 'bypass node access']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'administer taxonomy',
+ 'bypass node access',
+ ]);
$this->drupalLogin($this->adminUser);
// Create a vocabulary and add two term reference fields to article nodes.
diff --git a/web/core/modules/telephone/tests/src/Functional/TelephoneFieldTest.php b/web/core/modules/telephone/tests/src/Functional/TelephoneFieldTest.php
index 40607d23..447d26c3 100644
--- a/web/core/modules/telephone/tests/src/Functional/TelephoneFieldTest.php
+++ b/web/core/modules/telephone/tests/src/Functional/TelephoneFieldTest.php
@@ -43,7 +43,10 @@ class TelephoneFieldTest extends BrowserTestBase {
parent::setUp();
$this->drupalCreateContentType(['type' => 'article']);
- $this->webUser = $this->drupalCreateUser(['create article content', 'edit own article content']);
+ $this->webUser = $this->drupalCreateUser([
+ 'create article content',
+ 'edit own article content',
+ ]);
$this->drupalLogin($this->webUser);
// Add the telephone field to the article content type.
diff --git a/web/core/modules/text/tests/src/FunctionalJavascript/TextareaWithSummaryTest.php b/web/core/modules/text/tests/src/FunctionalJavascript/TextareaWithSummaryTest.php
index 9d939eea..c3682771 100644
--- a/web/core/modules/text/tests/src/FunctionalJavascript/TextareaWithSummaryTest.php
+++ b/web/core/modules/text/tests/src/FunctionalJavascript/TextareaWithSummaryTest.php
@@ -30,7 +30,10 @@ class TextareaWithSummaryTest extends WebDriverTestBase {
$this->drupalCreateContentType(['type' => 'page']);
- $account = $this->drupalCreateUser(['create page content', 'edit own page content']);
+ $account = $this->drupalCreateUser([
+ 'create page content',
+ 'edit own page content',
+ ]);
$this->drupalLogin($account);
}
diff --git a/web/core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php b/web/core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php
index 8a0a3bb7..2afaeaeb 100644
--- a/web/core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php
+++ b/web/core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php
@@ -262,7 +262,10 @@ class ToolbarAdminMenuTest extends BrowserTestBase {
public function testLocaleTranslationSubtreesHashCacheClear() {
$admin_user = $this->adminUser;
// User to translate and delete string.
- $translate_user = $this->drupalCreateUser(['translate interface', 'access administration pages']);
+ $translate_user = $this->drupalCreateUser([
+ 'translate interface',
+ 'access administration pages',
+ ]);
// Create a new language with the langcode 'xx'.
$langcode = 'xx';
diff --git a/web/core/modules/toolbar/tests/src/Functional/ToolbarMenuTranslationTest.php b/web/core/modules/toolbar/tests/src/Functional/ToolbarMenuTranslationTest.php
index 8ff8fd8a..1b1a24cb 100644
--- a/web/core/modules/toolbar/tests/src/Functional/ToolbarMenuTranslationTest.php
+++ b/web/core/modules/toolbar/tests/src/Functional/ToolbarMenuTranslationTest.php
@@ -39,7 +39,12 @@ class ToolbarMenuTranslationTest extends BrowserTestBase {
parent::setUp();
// Create an administrative user and log it in.
- $this->adminUser = $this->drupalCreateUser(['access toolbar', 'translate interface', 'administer languages', 'access administration pages']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'access toolbar',
+ 'translate interface',
+ 'administer languages',
+ 'access administration pages',
+ ]);
$this->drupalLogin($this->adminUser);
}
diff --git a/web/core/modules/tour/tests/src/Functional/TourHelpPageTest.php b/web/core/modules/tour/tests/src/Functional/TourHelpPageTest.php
index a88da72c..d3d10948 100644
--- a/web/core/modules/tour/tests/src/Functional/TourHelpPageTest.php
+++ b/web/core/modules/tour/tests/src/Functional/TourHelpPageTest.php
@@ -46,8 +46,14 @@ class TourHelpPageTest extends BrowserTestBase {
// Create users. For the Tour user, include permissions for the language
// tours' parent pages, but not the translation tour's parent page. See
// self:getTourList().
- $this->tourUser = $this->drupalCreateUser(['access administration pages', 'access tour', 'administer languages']);
- $this->noTourUser = $this->drupalCreateUser(['access administration pages']);
+ $this->tourUser = $this->drupalCreateUser([
+ 'access administration pages',
+ 'access tour',
+ 'administer languages',
+ ]);
+ $this->noTourUser = $this->drupalCreateUser([
+ 'access administration pages',
+ ]);
}
/**
@@ -73,7 +79,7 @@ class TourHelpPageTest extends BrowserTestBase {
// All users should be able to see the module section.
$this->assertText('Module overviews are provided by modules');
foreach ($this->getModuleList() as $name) {
- $this->assertLink($name);
+ $this->assertSession()->linkExists($name);
}
// Some users should be able to see the tour section.
@@ -89,10 +95,10 @@ class TourHelpPageTest extends BrowserTestBase {
// Test the titles that should be links.
foreach ($titles[0] as $title) {
if ($tours_ok) {
- $this->assertLink($title);
+ $this->assertSession()->linkExists($title);
}
else {
- $this->assertNoLink($title);
+ $this->assertSession()->linkNotExists($title);
// Just test the first item in the list of links that should not
// be there, because the second matches the name of a module that is
// in the Module overviews section, so the link will be there and
diff --git a/web/core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php b/web/core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php
index 990612d0..1a7304f3 100644
--- a/web/core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php
+++ b/web/core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php
@@ -42,7 +42,10 @@ class TrackerNodeAccessTest extends BrowserTestBase {
*/
public function testTrackerNodeAccess() {
// Create user with node test view permission.
- $access_user = $this->drupalCreateUser(['node test view', 'access user profiles']);
+ $access_user = $this->drupalCreateUser([
+ 'node test view',
+ 'access user profiles',
+ ]);
// Create user without node test view permission.
$no_access_user = $this->drupalCreateUser(['access user profiles']);
diff --git a/web/core/modules/tracker/tests/src/Functional/TrackerRecentContentLinkTest.php b/web/core/modules/tracker/tests/src/Functional/TrackerRecentContentLinkTest.php
new file mode 100644
index 00000000..f0b85b34
--- /dev/null
+++ b/web/core/modules/tracker/tests/src/Functional/TrackerRecentContentLinkTest.php
@@ -0,0 +1,47 @@
+drupalGet('');
+ $this->assertSession()->linkNotExists('Recent content');
+ $this->drupalPlaceBlock('system_menu_block:tools');
+
+ // Create a regular user.
+ $user = $this->drupalCreateUser();
+
+ // Log in and get the homepage.
+ $this->drupalLogin($user);
+ $this->drupalGet('');
+
+ $link = $this->xpath('//ul/li/a[contains(@href, :href) and text()=:text]', [
+ ':menu_class' => 'menu-item',
+ ':href' => '/activity',
+ ':text' => 'Recent content',
+ ]);
+ $this->assertCount(1, $link);
+ }
+
+}
diff --git a/web/core/modules/tracker/tests/src/Functional/TrackerTest.php b/web/core/modules/tracker/tests/src/Functional/TrackerTest.php
index 8a8c378b..0e98d86d 100644
--- a/web/core/modules/tracker/tests/src/Functional/TrackerTest.php
+++ b/web/core/modules/tracker/tests/src/Functional/TrackerTest.php
@@ -215,7 +215,11 @@ class TrackerTest extends BrowserTestBase {
$this->assertTitle($this->user->getAccountName() . ' | Drupal');
// Verify that unpublished comments are removed from the tracker.
- $admin_user = $this->drupalCreateUser(['post comments', 'administer comments', 'access user profiles']);
+ $admin_user = $this->drupalCreateUser([
+ 'post comments',
+ 'administer comments',
+ 'access user profiles',
+ ]);
$this->drupalLogin($admin_user);
$this->drupalPostForm('comment/1/edit', ['status' => CommentInterface::NOT_PUBLISHED], t('Save'));
$this->drupalGet('user/' . $this->user->id() . '/activity');
@@ -418,7 +422,11 @@ class TrackerTest extends BrowserTestBase {
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']);
+ $admin_user = $this->drupalCreateUser([
+ 'access content overview',
+ 'administer nodes',
+ 'bypass node access',
+ ]);
$this->drupalLogin($admin_user);
$node = $this->drupalCreateNode([
diff --git a/web/core/modules/update/tests/src/Functional/FileTransferAuthorizeFormTest.php b/web/core/modules/update/tests/src/Functional/FileTransferAuthorizeFormTest.php
index 2d7d7805..ac483cb2 100644
--- a/web/core/modules/update/tests/src/Functional/FileTransferAuthorizeFormTest.php
+++ b/web/core/modules/update/tests/src/Functional/FileTransferAuthorizeFormTest.php
@@ -23,7 +23,11 @@ class FileTransferAuthorizeFormTest extends UpdateTestBase {
protected function setUp() {
parent::setUp();
- $admin_user = $this->drupalCreateUser(['administer modules', 'administer software updates', 'administer site configuration']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer modules',
+ 'administer software updates',
+ 'administer site configuration',
+ ]);
$this->drupalLogin($admin_user);
// Create a local cache so the module is not downloaded from drupal.org.
diff --git a/web/core/modules/update/tests/src/Functional/UpdateContribTest.php b/web/core/modules/update/tests/src/Functional/UpdateContribTest.php
index 6410f5fd..dc2907ff 100644
--- a/web/core/modules/update/tests/src/Functional/UpdateContribTest.php
+++ b/web/core/modules/update/tests/src/Functional/UpdateContribTest.php
@@ -507,7 +507,10 @@ class UpdateContribTest extends UpdateTestBase {
*/
public function testHookUpdateStatusAlter() {
$update_test_config = $this->config('update_test.settings');
- $update_admin_user = $this->drupalCreateUser(['administer site configuration', 'administer software updates']);
+ $update_admin_user = $this->drupalCreateUser([
+ 'administer site configuration',
+ 'administer software updates',
+ ]);
$this->drupalLogin($update_admin_user);
$system_info = [
diff --git a/web/core/modules/update/tests/src/Functional/UpdateCoreTest.php b/web/core/modules/update/tests/src/Functional/UpdateCoreTest.php
index a7a982f1..f01e9b2d 100644
--- a/web/core/modules/update/tests/src/Functional/UpdateCoreTest.php
+++ b/web/core/modules/update/tests/src/Functional/UpdateCoreTest.php
@@ -40,7 +40,11 @@ class UpdateCoreTest extends UpdateTestBase {
protected function setUp() {
parent::setUp();
- $admin_user = $this->drupalCreateUser(['administer site configuration', 'administer modules', 'administer themes']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer site configuration',
+ 'administer modules',
+ 'administer themes',
+ ]);
$this->drupalLogin($admin_user);
$this->drupalPlaceBlock('local_actions_block');
}
@@ -814,7 +818,12 @@ class UpdateCoreTest extends UpdateTestBase {
* Ensures that the local actions appear.
*/
public function testLocalActions() {
- $admin_user = $this->drupalCreateUser(['administer site configuration', 'administer modules', 'administer software updates', 'administer themes']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer site configuration',
+ 'administer modules',
+ 'administer software updates',
+ 'administer themes',
+ ]);
$this->drupalLogin($admin_user);
$this->drupalGet('admin/modules');
diff --git a/web/core/modules/update/tests/src/Functional/UpdateUploadTest.php b/web/core/modules/update/tests/src/Functional/UpdateUploadTest.php
index c3da5583..f71b3430 100644
--- a/web/core/modules/update/tests/src/Functional/UpdateUploadTest.php
+++ b/web/core/modules/update/tests/src/Functional/UpdateUploadTest.php
@@ -32,7 +32,11 @@ class UpdateUploadTest extends UpdateTestBase {
protected function setUp() {
parent::setUp();
- $admin_user = $this->drupalCreateUser(['administer modules', 'administer software updates', 'administer site configuration']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer modules',
+ 'administer software updates',
+ 'administer site configuration',
+ ]);
$this->drupalLogin($admin_user);
}
@@ -88,11 +92,11 @@ class UpdateUploadTest extends UpdateTestBase {
$this->assertFileExists($installedInfoFilePath);
// Ensure the links are relative to the site root and not
// core/authorize.php.
- $this->assertLink(t('Install another module'));
+ $this->assertSession()->linkExists(t('Install another module'));
$this->assertLinkByHref(Url::fromRoute('update.module_install')->toString());
- $this->assertLink(t('Enable newly added modules'));
+ $this->assertSession()->linkExists(t('Enable newly added modules'));
$this->assertLinkByHref(Url::fromRoute('system.modules_list')->toString());
- $this->assertLink(t('Administration pages'));
+ $this->assertSession()->linkExists(t('Administration pages'));
$this->assertLinkByHref(Url::fromRoute('system.admin')->toString());
// Ensure we can reach the "Install another module" link.
$this->clickLink(t('Install another module'));
diff --git a/web/core/modules/user/src/UserAuthInterface.php b/web/core/modules/user/src/UserAuthInterface.php
index 38cffc03..91f2cc34 100644
--- a/web/core/modules/user/src/UserAuthInterface.php
+++ b/web/core/modules/user/src/UserAuthInterface.php
@@ -14,6 +14,7 @@ interface UserAuthInterface {
* The user name to authenticate.
* @param string $password
* A plain-text password, such as trimmed text from form values.
+ *
* @return int|bool
* The user's uid on success, or FALSE on failure to authenticate.
*/
diff --git a/web/core/modules/user/tests/src/Functional/UserAccountLinksTest.php b/web/core/modules/user/tests/src/Functional/UserAccountLinksTest.php
index 25b4df1e..456b1ee2 100644
--- a/web/core/modules/user/tests/src/Functional/UserAccountLinksTest.php
+++ b/web/core/modules/user/tests/src/Functional/UserAccountLinksTest.php
@@ -78,7 +78,10 @@ class UserAccountLinksTest extends BrowserTestBase {
*/
public function testDisabledAccountLink() {
// Create an admin user and log in.
- $this->drupalLogin($this->drupalCreateUser(['access administration pages', 'administer menu']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'access administration pages',
+ 'administer menu',
+ ]));
// Verify that the 'My account' link exists before we check for its
// disappearance.
@@ -134,7 +137,7 @@ class UserAccountLinksTest extends BrowserTestBase {
// Check the page title for registered users is "My Account" in menus.
$this->drupalLogin($this->drupalCreateUser());
// After login, the client is redirected to /user.
- $this->assertLink(t('My account'), 0, "Page title of /user is 'My Account' in menus for registered users");
+ $this->assertSession()->linkExists(t('My account'), 0, "Page title of /user is 'My Account' in menus for registered users");
$this->assertLinkByHref(\Drupal::urlGenerator()->generate('user.page'), 0);
}
diff --git a/web/core/modules/user/tests/src/Functional/UserAdminLanguageTest.php b/web/core/modules/user/tests/src/Functional/UserAdminLanguageTest.php
index a9901773..30f03fea 100644
--- a/web/core/modules/user/tests/src/Functional/UserAdminLanguageTest.php
+++ b/web/core/modules/user/tests/src/Functional/UserAdminLanguageTest.php
@@ -41,7 +41,10 @@ class UserAdminLanguageTest extends BrowserTestBase {
protected function setUp() {
parent::setUp();
// User to add and remove language.
- $this->adminUser = $this->drupalCreateUser(['administer languages', 'access administration pages']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'administer languages',
+ 'access administration pages',
+ ]);
// User to check non-admin access.
$this->regularUser = $this->drupalCreateUser();
}
diff --git a/web/core/modules/user/tests/src/Functional/UserAdminTest.php b/web/core/modules/user/tests/src/Functional/UserAdminTest.php
index c67dd6b1..ede9088c 100644
--- a/web/core/modules/user/tests/src/Functional/UserAdminTest.php
+++ b/web/core/modules/user/tests/src/Functional/UserAdminTest.php
@@ -162,7 +162,10 @@ class UserAdminTest extends BrowserTestBase {
*/
public function testNotificationEmailAddress() {
// Test that the Notification Email address field is on the config page.
- $admin_user = $this->drupalCreateUser(['administer users', 'administer account settings']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer users',
+ 'administer account settings',
+ ]);
$this->drupalLogin($admin_user);
$this->drupalGet('admin/config/people/accounts');
$this->assertRaw('id="edit-mail-notification-address"', 'Notification Email address field exists');
diff --git a/web/core/modules/user/tests/src/Functional/UserCancelTest.php b/web/core/modules/user/tests/src/Functional/UserCancelTest.php
index b800a5c2..b714ff42 100644
--- a/web/core/modules/user/tests/src/Functional/UserCancelTest.php
+++ b/web/core/modules/user/tests/src/Functional/UserCancelTest.php
@@ -420,7 +420,11 @@ class UserCancelTest extends BrowserTestBase {
$user_storage = $this->container->get('entity_type.manager')->getStorage('user');
// Create a user.
- $account = $this->drupalCreateUser(['cancel account', 'post comments', 'skip comment approval']);
+ $account = $this->drupalCreateUser([
+ 'cancel account',
+ 'post comments',
+ 'skip comment approval',
+ ]);
$this->drupalLogin($account);
// Load a real user object.
$user_storage->resetCache([$account->id()]);
diff --git a/web/core/modules/user/tests/src/Functional/UserLanguageCreationTest.php b/web/core/modules/user/tests/src/Functional/UserLanguageCreationTest.php
index d19ae76a..e6f8870b 100644
--- a/web/core/modules/user/tests/src/Functional/UserLanguageCreationTest.php
+++ b/web/core/modules/user/tests/src/Functional/UserLanguageCreationTest.php
@@ -30,7 +30,11 @@ class UserLanguageCreationTest extends BrowserTestBase {
*/
public function testLocalUserCreation() {
// User to add and remove language and create new users.
- $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages', 'administer users']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer languages',
+ 'access administration pages',
+ 'administer users',
+ ]);
$this->drupalLogin($admin_user);
// Add predefined language.
diff --git a/web/core/modules/user/tests/src/Functional/UserLanguageTest.php b/web/core/modules/user/tests/src/Functional/UserLanguageTest.php
index d221a61c..b0bd1e41 100644
--- a/web/core/modules/user/tests/src/Functional/UserLanguageTest.php
+++ b/web/core/modules/user/tests/src/Functional/UserLanguageTest.php
@@ -29,7 +29,10 @@ class UserLanguageTest extends BrowserTestBase {
*/
public function testUserLanguageConfiguration() {
// User to add and remove language.
- $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer languages',
+ 'access administration pages',
+ ]);
// User to change their default language.
$web_user = $this->drupalCreateUser();
diff --git a/web/core/modules/user/tests/src/Functional/UserPasswordResetTest.php b/web/core/modules/user/tests/src/Functional/UserPasswordResetTest.php
index 7828e328..11a37c27 100644
--- a/web/core/modules/user/tests/src/Functional/UserPasswordResetTest.php
+++ b/web/core/modules/user/tests/src/Functional/UserPasswordResetTest.php
@@ -391,28 +391,28 @@ class UserPasswordResetTest extends BrowserTestBase {
}
/**
- * Helper function to make assertions about a password reset triggering user flood cotrol.
+ * Makes assertions about a password reset triggering user flood control.
*/
public function assertPasswordUserFlood() {
$this->assertText(t('Too many password recovery requests for this account. It is temporarily blocked. Try again later or contact the site administrator.'), 'User password reset flood error message shown.');
}
/**
- * Helper function to make assertions about a password reset not triggering user flood control.
+ * Makes assertions about a password reset not triggering user flood control.
*/
public function assertNoPasswordUserFlood() {
$this->assertNoText(t('Too many password recovery requests for this account. It is temporarily blocked. Try again later or contact the site administrator.'), 'User password reset flood error message not shown.');
}
/**
- * Helper function to make assertions about a password reset triggering IP flood cotrol.
+ * Makes assertions about a password reset triggering IP flood control.
*/
public function assertPasswordIpFlood() {
$this->assertText(t('Too many password recovery requests from your IP address. It is temporarily blocked. Try again later or contact the site administrator.'), 'IP password reset flood error message shown.');
}
/**
- * Helper function to make assertions about a password reset not triggering IP flood control.
+ * Makes assertions about a password reset not triggering IP flood control.
*/
public function assertNoPasswordIpFlood() {
$this->assertNoText(t('Too many password recovery requests from your IP address. It is temporarily blocked. Try again later or contact the site administrator.'), 'IP password reset flood error message not shown.');
diff --git a/web/core/modules/user/tests/src/Functional/UserPermissionsTest.php b/web/core/modules/user/tests/src/Functional/UserPermissionsTest.php
index 0eb453fc..df828979 100644
--- a/web/core/modules/user/tests/src/Functional/UserPermissionsTest.php
+++ b/web/core/modules/user/tests/src/Functional/UserPermissionsTest.php
@@ -36,7 +36,13 @@ class UserPermissionsTest extends BrowserTestBase {
protected function setUp() {
parent::setUp();
- $this->adminUser = $this->drupalCreateUser(['administer permissions', 'access user profiles', 'administer site configuration', 'administer modules', 'administer account settings']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'administer permissions',
+ 'access user profiles',
+ 'administer site configuration',
+ 'administer modules',
+ 'administer account settings',
+ ]);
// Find the new role ID.
$all_rids = $this->adminUser->getRoles();
diff --git a/web/core/modules/user/tests/src/Functional/UserPictureTest.php b/web/core/modules/user/tests/src/Functional/UserPictureTest.php
index 7c8c8975..0b6940ec 100644
--- a/web/core/modules/user/tests/src/Functional/UserPictureTest.php
+++ b/web/core/modules/user/tests/src/Functional/UserPictureTest.php
@@ -3,6 +3,7 @@
namespace Drupal\Tests\user\Functional;
use Drupal\Core\Database\Database;
+use Drupal\Core\Entity\Entity\EntityViewDisplay;
use Drupal\Core\StreamWrapper\StreamWrapperManager;
use Drupal\file\Entity\File;
use Drupal\image\Entity\ImageStyle;
@@ -159,4 +160,21 @@ class UserPictureTest extends BrowserTestBase {
return File::load($account->user_picture->target_id);
}
+ /**
+ * Tests user picture field with a non-standard field formatter.
+ *
+ * @see user_user_view_alter()
+ */
+ public function testUserViewAlter() {
+ \Drupal::service('module_installer')->install(['image_module_test']);
+ // Set dummy_image_formatter to the default view mode of user entity.
+ EntityViewDisplay::load('user.user.default')->setComponent('user_picture', [
+ 'region' => 'content',
+ 'type' => 'dummy_image_formatter',
+ ])->save();
+ $this->drupalLogin($this->webUser);
+ $this->assertSession()->statusCodeEquals(200);
+ $this->assertSession()->pageTextContains('Dummy');
+ }
+
}
diff --git a/web/core/modules/user/tests/src/Functional/UserRoleAdminTest.php b/web/core/modules/user/tests/src/Functional/UserRoleAdminTest.php
index 1ac9f214..29b7a600 100644
--- a/web/core/modules/user/tests/src/Functional/UserRoleAdminTest.php
+++ b/web/core/modules/user/tests/src/Functional/UserRoleAdminTest.php
@@ -37,7 +37,10 @@ class UserRoleAdminTest extends BrowserTestBase {
*/
protected function setUp() {
parent::setUp();
- $this->adminUser = $this->drupalCreateUser(['administer permissions', 'administer users']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'administer permissions',
+ 'administer users',
+ ]);
$this->drupalPlaceBlock('local_tasks_block');
}
diff --git a/web/core/modules/user/tests/src/Functional/UserRolesAssignmentTest.php b/web/core/modules/user/tests/src/Functional/UserRolesAssignmentTest.php
index bbda4c79..c7eb970c 100644
--- a/web/core/modules/user/tests/src/Functional/UserRolesAssignmentTest.php
+++ b/web/core/modules/user/tests/src/Functional/UserRolesAssignmentTest.php
@@ -13,7 +13,10 @@ class UserRolesAssignmentTest extends BrowserTestBase {
protected function setUp() {
parent::setUp();
- $admin_user = $this->drupalCreateUser(['administer permissions', 'administer users']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer permissions',
+ 'administer users',
+ ]);
$this->drupalLogin($admin_user);
}
diff --git a/web/core/modules/user/tests/src/Functional/UserSearchTest.php b/web/core/modules/user/tests/src/Functional/UserSearchTest.php
index 1c5aa6ae..13c49e0f 100644
--- a/web/core/modules/user/tests/src/Functional/UserSearchTest.php
+++ b/web/core/modules/user/tests/src/Functional/UserSearchTest.php
@@ -28,7 +28,10 @@ class UserSearchTest extends BrowserTestBase {
// 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.
- $user1 = $this->drupalCreateUser(['access user profiles', 'search content'], "foo+bar");
+ $user1 = $this->drupalCreateUser([
+ 'access user profiles',
+ 'search content',
+ ], "foo+bar");
$this->drupalLogin($user1);
$keys = $user1->getEmail();
$edit = ['keys' => $keys];
@@ -46,23 +49,27 @@ class UserSearchTest extends BrowserTestBase {
$keys = $user1->getAccountName();
$edit = ['keys' => $keys];
$this->drupalPostForm('search/user', $edit, t('Search'));
- $this->assertLink($keys, 0, 'Search by username worked for non-admin user');
+ $this->assertSession()->linkExists($keys, 0, 'Search by username worked for non-admin user');
// Verify that searching by sub-string works too.
$subkey = substr($keys, 1, 5);
$edit = ['keys' => $subkey];
$this->drupalPostForm('search/user', $edit, t('Search'));
- $this->assertLink($keys, 0, 'Search by username substring worked for non-admin user');
+ $this->assertSession()->linkExists($keys, 0, 'Search by username substring worked for non-admin user');
// Verify that wildcard search works.
$subkey = substr($keys, 0, 2) . '*' . substr($keys, 4, 2);
$edit = ['keys' => $subkey];
$this->drupalPostForm('search/user', $edit, t('Search'));
- $this->assertLink($keys, 0, 'Search with wildcard worked for non-admin user');
+ $this->assertSession()->linkExists($keys, 0, 'Search with wildcard worked for non-admin user');
// Verify that a user with 'administer users' permission can search by
// email.
- $user2 = $this->drupalCreateUser(['administer users', 'access user profiles', 'search content']);
+ $user2 = $this->drupalCreateUser([
+ 'administer users',
+ 'access user profiles',
+ 'search content',
+ ]);
$this->drupalLogin($user2);
$keys = $user2->getEmail();
$edit = ['keys' => $keys];
diff --git a/web/core/modules/user/tests/src/Functional/Views/AccessTestBase.php b/web/core/modules/user/tests/src/Functional/Views/AccessTestBase.php
index 36f2334f..cc0de2a6 100644
--- a/web/core/modules/user/tests/src/Functional/Views/AccessTestBase.php
+++ b/web/core/modules/user/tests/src/Functional/Views/AccessTestBase.php
@@ -56,7 +56,9 @@ abstract class AccessTestBase extends UserTestBase {
$this->webRole = $roles[0];
$this->normalRole = $this->drupalCreateRole([]);
- $this->normalUser = $this->drupalCreateUser(['views_test_data test permission']);
+ $this->normalUser = $this->drupalCreateUser([
+ 'views_test_data test permission',
+ ]);
$this->normalUser->addRole($this->normalRole);
$this->normalUser->save();
// @todo when all the plugin information is cached make a reset function and
diff --git a/web/core/modules/user/tests/src/Functional/Views/BulkFormTest.php b/web/core/modules/user/tests/src/Functional/Views/BulkFormTest.php
index f7cb4f3f..87142c1c 100644
--- a/web/core/modules/user/tests/src/Functional/Views/BulkFormTest.php
+++ b/web/core/modules/user/tests/src/Functional/Views/BulkFormTest.php
@@ -114,7 +114,11 @@ class BulkFormTest extends UserTestBase {
$this->assertTrue($anonymous_account->isBlocked(), 'Ensure the anonymous user got blocked.');
// Test the list of available actions with a value that contains a dot.
- $this->drupalLogin($this->drupalCreateUser(['administer permissions', 'administer views', 'administer users']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer permissions',
+ 'administer views',
+ 'administer users',
+ ]));
$action_id = 'user_add_role_action.' . $role;
$edit = [
'options[include_exclude]' => 'exclude',
diff --git a/web/core/modules/user/tests/src/Functional/Views/FilterPermissionUiTest.php b/web/core/modules/user/tests/src/Functional/Views/FilterPermissionUiTest.php
index 18358585..ad21dd21 100644
--- a/web/core/modules/user/tests/src/Functional/Views/FilterPermissionUiTest.php
+++ b/web/core/modules/user/tests/src/Functional/Views/FilterPermissionUiTest.php
@@ -43,12 +43,15 @@ class FilterPermissionUiTest extends ViewTestBase {
* Tests basic filter handler settings in the UI.
*/
public function testHandlerUI() {
- $this->drupalLogin($this->drupalCreateUser(['administer views', 'administer users']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer views',
+ 'administer users',
+ ]));
$this->drupalGet('admin/structure/views/view/test_filter_permission/edit/default');
// Verify that the handler summary is correctly displaying the selected
// permission.
- $this->assertLink('User: Permission (= View user information)');
+ $this->assertSession()->linkExists('User: Permission (= View user information)');
$this->drupalPostForm(NULL, [], 'Save');
// Verify that we can save the view.
$this->assertNoText('No valid values found on filter: User: Permission.');
@@ -63,7 +66,7 @@ class FilterPermissionUiTest extends ViewTestBase {
],
];
$this->drupalPostForm('admin/structure/views/nojs/handler/test_filter_permission/default/filter/permission', $edit, 'Apply');
- $this->assertLink('User: Permission (or View us…)');
+ $this->assertSession()->linkExists('User: Permission (or View us…)');
$this->drupalPostForm(NULL, [], 'Save');
// Verify that we can save the view.
$this->assertNoText('No valid values found on filter: User: Permission.');
diff --git a/web/core/modules/user/tests/src/Functional/Views/HandlerFilterUserNameTest.php b/web/core/modules/user/tests/src/Functional/Views/HandlerFilterUserNameTest.php
index dbb8fc56..2660593f 100644
--- a/web/core/modules/user/tests/src/Functional/Views/HandlerFilterUserNameTest.php
+++ b/web/core/modules/user/tests/src/Functional/Views/HandlerFilterUserNameTest.php
@@ -90,7 +90,10 @@ class HandlerFilterUserNameTest extends ViewTestBase {
* Tests using the user interface.
*/
public function testAdminUserInterface() {
- $admin_user = $this->drupalCreateUser(['administer views', 'administer site configuration']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer views',
+ 'administer site configuration',
+ ]);
$this->drupalLogin($admin_user);
$path = 'admin/structure/views/nojs/handler/test_user_name/default/filter/uid';
diff --git a/web/core/modules/user/tests/src/Kernel/TempStoreDatabaseTest.php b/web/core/modules/user/tests/src/Kernel/TempStoreDatabaseTest.php
index 5a411802..318bbe09 100644
--- a/web/core/modules/user/tests/src/Kernel/TempStoreDatabaseTest.php
+++ b/web/core/modules/user/tests/src/Kernel/TempStoreDatabaseTest.php
@@ -96,24 +96,24 @@ class TempStoreDatabaseTest extends KernelTestBase {
$this->assertEqual(!$i, $stores[0]->setIfNotExists($key, $this->objects[$i]));
$metadata = $stores[0]->getMetadata($key);
$this->assertEqual($users[0], $metadata->owner);
- $this->assertIdenticalObject($this->objects[0], $stores[0]->get($key));
+ $this->assertEquals($this->objects[0], $stores[0]->get($key));
// Another user should get the same result.
$metadata = $stores[1]->getMetadata($key);
$this->assertEqual($users[0], $metadata->owner);
- $this->assertIdenticalObject($this->objects[0], $stores[1]->get($key));
+ $this->assertEquals($this->objects[0], $stores[1]->get($key));
}
// Remove the item and try to set it again.
$stores[0]->delete($key);
$stores[0]->setIfNotExists($key, $this->objects[1]);
// This time it should succeed.
- $this->assertIdenticalObject($this->objects[1], $stores[0]->get($key));
+ $this->assertEquals($this->objects[1], $stores[0]->get($key));
// This user can update the object.
$stores[0]->set($key, $this->objects[2]);
- $this->assertIdenticalObject($this->objects[2], $stores[0]->get($key));
+ $this->assertEquals($this->objects[2], $stores[0]->get($key));
// The object is the same when another user loads it.
- $this->assertIdenticalObject($this->objects[2], $stores[1]->get($key));
+ $this->assertEquals($this->objects[2], $stores[1]->get($key));
// This user should be allowed to get, update, delete.
$this->assertTrue($stores[0]->getIfOwner($key) instanceof \stdClass);
@@ -122,8 +122,8 @@ class TempStoreDatabaseTest extends KernelTestBase {
// Another user can update the object and become the owner.
$stores[1]->set($key, $this->objects[3]);
- $this->assertIdenticalObject($this->objects[3], $stores[0]->get($key));
- $this->assertIdenticalObject($this->objects[3], $stores[1]->get($key));
+ $this->assertEquals($this->objects[3], $stores[0]->get($key));
+ $this->assertEquals($this->objects[3], $stores[1]->get($key));
$metadata = $stores[1]->getMetadata($key);
$this->assertEqual($users[1], $metadata->owner);
diff --git a/web/core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php b/web/core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php
index 2e44cf4c..3c4fbeeb 100644
--- a/web/core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php
+++ b/web/core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php
@@ -135,9 +135,6 @@ class UserAccountFormFieldsTest extends KernelTestBase {
$entity = $this->container->get('entity_type.manager')
->getStorage($entity_type)
->create($fields);
- $this->container->get('entity_type.manager')
- ->getFormObject($entity_type, $operation)
- ->setEntity($entity);
// @see EntityFormBuilder::getForm()
return $this->container->get('entity.form_builder')->getForm($entity, $operation);
diff --git a/web/core/modules/user/tests/src/Kernel/UserInstallTest.php b/web/core/modules/user/tests/src/Kernel/UserInstallTest.php
index 3e9282b5..e8f16208 100644
--- a/web/core/modules/user/tests/src/Kernel/UserInstallTest.php
+++ b/web/core/modules/user/tests/src/Kernel/UserInstallTest.php
@@ -2,7 +2,6 @@
namespace Drupal\Tests\user\Kernel;
-use Drupal\Core\Database\Database;
use Drupal\KernelTests\KernelTestBase;
/**
@@ -33,22 +32,22 @@ class UserInstallTest extends KernelTestBase {
* Test that the initial users have correct values.
*/
public function testUserInstall() {
- $result = Database::getConnection()->query('SELECT u.uid, u.uuid, u.langcode, uf.status FROM {users} u INNER JOIN {users_field_data} uf ON u.uid=uf.uid ORDER BY u.uid')
- ->fetchAllAssoc('uid');
- $anon = $result[0];
- $admin = $result[1];
- $this->assertFalse(empty($anon->uuid), 'Anon user has a UUID');
- $this->assertFalse(empty($admin->uuid), 'Admin user has a UUID');
+ $user_ids = \Drupal::entityQuery('user')->sort('uid')->execute();
+ $users = \Drupal::entityTypeManager()->getStorage('user')->loadMultiple($user_ids);
+ $anon = $users[0];
+ $admin = $users[1];
+ $this->assertNotEmpty($anon->uuid(), 'Anon user has a UUID');
+ $this->assertNotEmpty($admin->uuid(), 'Admin user has a UUID');
// Test that the anonymous and administrators languages are equal to the
// site's default language.
- $this->assertEqual($anon->langcode, \Drupal::languageManager()->getDefaultLanguage()->getId());
- $this->assertEqual($admin->langcode, \Drupal::languageManager()->getDefaultLanguage()->getId());
+ $this->assertEquals('en', $anon->language()->getId());
+ $this->assertEquals('en', $admin->language()->getId());
// Test that the administrator is active.
- $this->assertEqual($admin->status, 1);
+ $this->assertTrue($admin->isActive());
// Test that the anonymous user is blocked.
- $this->assertEqual($anon->status, 0);
+ $this->assertTrue($anon->isBlocked());
}
}
diff --git a/web/core/modules/user/user.module b/web/core/modules/user/user.module
index 74ce5de0..a76615bc 100644
--- a/web/core/modules/user/user.module
+++ b/web/core/modules/user/user.module
@@ -19,6 +19,7 @@ use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Session\AnonymousUserSession;
use Drupal\Core\Site\Settings;
use Drupal\Core\Url;
+use Drupal\image\Plugin\Field\FieldType\ImageItem;
use Drupal\system\Entity\Action;
use Drupal\user\Entity\Role;
use Drupal\user\Entity\User;
@@ -414,8 +415,15 @@ function user_user_view(array &$build, UserInterface $account, EntityViewDisplay
* accessibility.
*/
function user_user_view_alter(array &$build, UserInterface $account, EntityViewDisplayInterface $display) {
- if (user_picture_enabled() && !empty($build['user_picture'])) {
+ if (!empty($build['user_picture']) && user_picture_enabled()) {
foreach (Element::children($build['user_picture']) as $key) {
+ if (!isset($build['user_picture'][$key]['#item']) || !($build['user_picture'][$key]['#item'] instanceof ImageItem)) {
+ // User picture field is provided by standard profile install. If the
+ // display is configured to use a different formatter, the #item render
+ // key may not exist, or may not be an image field.
+ continue;
+ }
+ /** @var \Drupal\image\Plugin\Field\FieldType\ImageItem $item */
$item = $build['user_picture'][$key]['#item'];
if (!$item->get('alt')->getValue()) {
$item->get('alt')->setValue(\Drupal::translation()->translate('Profile picture for user @username', ['@username' => $account->getAccountName()]));
diff --git a/web/core/modules/views/src/Plugin/views/field/BulkForm.php b/web/core/modules/views/src/Plugin/views/field/BulkForm.php
index b6f28d4b..0f114952 100644
--- a/web/core/modules/views/src/Plugin/views/field/BulkForm.php
+++ b/web/core/modules/views/src/Plugin/views/field/BulkForm.php
@@ -355,6 +355,7 @@ class BulkForm extends FieldPluginBase implements CacheableDependencyInterface {
*
* @param bool $filtered
* (optional) Whether to filter actions to selected actions.
+ *
* @return array
* An associative array of operations, suitable for a select element.
*/
diff --git a/web/core/modules/views/src/Plugin/views/style/StylePluginBase.php b/web/core/modules/views/src/Plugin/views/style/StylePluginBase.php
index c23dccd7..f031a32f 100644
--- a/web/core/modules/views/src/Plugin/views/style/StylePluginBase.php
+++ b/web/core/modules/views/src/Plugin/views/style/StylePluginBase.php
@@ -537,6 +537,7 @@ abstract class StylePluginBase extends PluginBase {
* Views 7.x-3.0-rc2. After Views 7.x-3.0 this boolean is only used if
* $groupings is an old-style string or if the rendered option is missing
* for a grouping instruction.
+ *
* @return
* The grouped record set.
* A nested set structure is generated if multiple grouping fields are used.
diff --git a/web/core/modules/views/src/Views.php b/web/core/modules/views/src/Views.php
index 86dcdf7a..42ae4311 100644
--- a/web/core/modules/views/src/Views.php
+++ b/web/core/modules/views/src/Views.php
@@ -115,14 +115,15 @@ class Views {
* @param string $id
* The view ID to load.
*
- * @return \Drupal\views\ViewExecutable
- * A view executable instance, from the loaded entity.
+ * @return \Drupal\views\ViewExecutable|null
+ * A view executable instance or NULL if the view does not exist.
*/
public static function getView($id) {
$view = \Drupal::entityTypeManager()->getStorage('view')->load($id);
if ($view) {
return static::executableFactory()->get($view);
}
+ return NULL;
}
/**
diff --git a/web/core/modules/views/src/ViewsConfigUpdater.php b/web/core/modules/views/src/ViewsConfigUpdater.php
index af326040..2555dbc9 100644
--- a/web/core/modules/views/src/ViewsConfigUpdater.php
+++ b/web/core/modules/views/src/ViewsConfigUpdater.php
@@ -8,6 +8,7 @@ use Drupal\Core\Config\TypedConfigManagerInterface;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Entity\EntityFieldManagerInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
+use Drupal\Core\Entity\FieldableEntityInterface;
use Drupal\Core\Entity\Sql\DefaultTableMapping;
use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -285,7 +286,7 @@ class ViewsConfigUpdater implements ContainerInjectionInterface {
$table_info = [];
foreach ($this->entityTypeManager->getDefinitions() as $entity_type_id => $entity_type) {
- if ($entity_type->hasHandlerClass('views_data')) {
+ if ($entity_type->hasHandlerClass('views_data') && $entity_type->entityClassImplements(FieldableEntityInterface::class)) {
$base_field_definitions = $this->entityFieldManager->getBaseFieldDefinitions($entity_type_id);
$entity_storage = $this->entityTypeManager->getStorage($entity_type_id);
diff --git a/web/core/modules/views/tests/modules/views_config_entity_test/config/schema/views_config_entity_test.schema.yml b/web/core/modules/views/tests/modules/views_config_entity_test/config/schema/views_config_entity_test.schema.yml
new file mode 100644
index 00000000..8ea57d87
--- /dev/null
+++ b/web/core/modules/views/tests/modules/views_config_entity_test/config/schema/views_config_entity_test.schema.yml
@@ -0,0 +1,9 @@
+views_config_entity_test.type.*:
+ type: config_entity
+ label: 'Config entity type with Views data'
+ mapping:
+ id:
+ type: string
+ name:
+ type: label
+ label: 'Name'
diff --git a/web/core/modules/views/tests/modules/views_config_entity_test/src/Entity/ViewsConfigEntityTest.php b/web/core/modules/views/tests/modules/views_config_entity_test/src/Entity/ViewsConfigEntityTest.php
new file mode 100644
index 00000000..2649e76a
--- /dev/null
+++ b/web/core/modules/views/tests/modules/views_config_entity_test/src/Entity/ViewsConfigEntityTest.php
@@ -0,0 +1,26 @@
+drupalCreateContentType(['type' => 'page']);
- $admin_user = $this->drupalCreateUser(['administer nodes', 'edit any page content', 'delete any page content']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer nodes',
+ 'edit any page content',
+ 'delete any page content',
+ ]);
$this->drupalLogin($admin_user);
$this->drupalGet('test_bulk_form');
diff --git a/web/core/modules/views/tests/src/Functional/Handler/AreaTest.php b/web/core/modules/views/tests/src/Functional/Handler/AreaTest.php
index cb6ce551..30dcaeb7 100644
--- a/web/core/modules/views/tests/src/Functional/Handler/AreaTest.php
+++ b/web/core/modules/views/tests/src/Functional/Handler/AreaTest.php
@@ -57,7 +57,10 @@ class AreaTest extends ViewTestBase {
* Tests the generic UI of a area handler.
*/
public function testUI() {
- $admin_user = $this->drupalCreateUser(['administer views', 'administer site configuration']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer views',
+ 'administer site configuration',
+ ]);
$this->drupalLogin($admin_user);
$types = ['header', 'footer', 'empty'];
@@ -158,7 +161,10 @@ class AreaTest extends ViewTestBase {
* Tests global tokens.
*/
public function testRenderAreaToken() {
- $admin_user = $this->drupalCreateUser(['administer views', 'administer site configuration']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer views',
+ 'administer site configuration',
+ ]);
$this->drupalLogin($admin_user);
$view = Views::getView('test_example_area');
diff --git a/web/core/modules/views/tests/src/Functional/Handler/FieldDropButtonTest.php b/web/core/modules/views/tests/src/Functional/Handler/FieldDropButtonTest.php
index 1762ed5a..2605dd72 100644
--- a/web/core/modules/views/tests/src/Functional/Handler/FieldDropButtonTest.php
+++ b/web/core/modules/views/tests/src/Functional/Handler/FieldDropButtonTest.php
@@ -37,7 +37,11 @@ class FieldDropButtonTest extends ViewTestBase {
protected function setUp($import_test_views = TRUE) {
parent::setUp($import_test_views);
- $admin_user = $this->drupalCreateUser(['access content overview', 'administer nodes', 'bypass node access']);
+ $admin_user = $this->drupalCreateUser([
+ 'access content overview',
+ 'administer nodes',
+ 'bypass node access',
+ ]);
$this->drupalLogin($admin_user);
}
diff --git a/web/core/modules/views/tests/src/Functional/Handler/FieldEntityOperationsTest.php b/web/core/modules/views/tests/src/Functional/Handler/FieldEntityOperationsTest.php
index 99db5e1a..c7e89f96 100644
--- a/web/core/modules/views/tests/src/Functional/Handler/FieldEntityOperationsTest.php
+++ b/web/core/modules/views/tests/src/Functional/Handler/FieldEntityOperationsTest.php
@@ -66,7 +66,11 @@ class FieldEntityOperationsTest extends ViewTestBase {
$entities[$i] = $entity;
}
- $admin_user = $this->drupalCreateUser(['access administration pages', 'administer nodes', 'bypass node access']);
+ $admin_user = $this->drupalCreateUser([
+ 'access administration pages',
+ 'administer nodes',
+ 'bypass node access',
+ ]);
$this->drupalLogin($this->rootUser);
$this->drupalGet('test-entity-operations');
/** @var $entity \Drupal\entity_test\Entity\EntityTest */
diff --git a/web/core/modules/views/tests/src/Functional/Handler/FieldWebTest.php b/web/core/modules/views/tests/src/Functional/Handler/FieldWebTest.php
index b61204e1..4d2bb7fd 100644
--- a/web/core/modules/views/tests/src/Functional/Handler/FieldWebTest.php
+++ b/web/core/modules/views/tests/src/Functional/Handler/FieldWebTest.php
@@ -125,6 +125,7 @@ class FieldWebTest extends ViewTestBase {
* The message to display along with the assertion.
* @param string $group
* The type of assertion - examples are "Browser", "PHP".
+ *
* @return bool
* TRUE if the assertion succeeded, FALSE otherwise.
*/
@@ -143,6 +144,7 @@ class FieldWebTest extends ViewTestBase {
* The message to display along with the assertion.
* @param string $group
* The type of assertion - examples are "Browser", "PHP".
+ *
* @return bool
* TRUE if the assertion succeeded, FALSE otherwise.
*/
diff --git a/web/core/modules/views/tests/src/Functional/Handler/FilterDateTest.php b/web/core/modules/views/tests/src/Functional/Handler/FilterDateTest.php
index e1d3f439..8d325e5c 100644
--- a/web/core/modules/views/tests/src/Functional/Handler/FilterDateTest.php
+++ b/web/core/modules/views/tests/src/Functional/Handler/FilterDateTest.php
@@ -184,7 +184,10 @@ class FilterDateTest extends ViewTestBase {
*/
protected function _testUiValidation() {
- $this->drupalLogin($this->drupalCreateUser(['administer views', 'administer site configuration']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer views',
+ 'administer site configuration',
+ ]));
$this->drupalGet('admin/structure/views/view/test_filter_date_between/edit');
$this->drupalGet('admin/structure/views/nojs/handler/test_filter_date_between/default/filter/created');
diff --git a/web/core/modules/views/tests/src/Functional/Plugin/AccessTest.php b/web/core/modules/views/tests/src/Functional/Plugin/AccessTest.php
index 1fca2def..de12c0eb 100644
--- a/web/core/modules/views/tests/src/Functional/Plugin/AccessTest.php
+++ b/web/core/modules/views/tests/src/Functional/Plugin/AccessTest.php
@@ -58,7 +58,9 @@ class AccessTest extends ViewTestBase {
$this->webUser = $this->drupalCreateUser();
$normal_role = $this->drupalCreateRole([]);
- $this->normalUser = $this->drupalCreateUser(['views_test_data test permission']);
+ $this->normalUser = $this->drupalCreateUser([
+ 'views_test_data test permission',
+ ]);
$this->normalUser->addRole($normal_role);
// @todo when all the plugin information is cached make a reset function and
// call it here.
diff --git a/web/core/modules/views/tests/src/Functional/Plugin/ArgumentDefaultTest.php b/web/core/modules/views/tests/src/Functional/Plugin/ArgumentDefaultTest.php
index 2ee68ea6..1306b92a 100644
--- a/web/core/modules/views/tests/src/Functional/Plugin/ArgumentDefaultTest.php
+++ b/web/core/modules/views/tests/src/Functional/Plugin/ArgumentDefaultTest.php
@@ -91,7 +91,10 @@ class ArgumentDefaultTest extends ViewTestBase {
* Tests the use of a default argument plugin that provides no options.
*/
public function testArgumentDefaultNoOptions() {
- $admin_user = $this->drupalCreateUser(['administer views', 'administer site configuration']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer views',
+ 'administer site configuration',
+ ]);
$this->drupalLogin($admin_user);
// The current_user plugin has no options form, and should pass validation.
diff --git a/web/core/modules/views/tests/src/Functional/Plugin/ContextualFiltersBlockContextTest.php b/web/core/modules/views/tests/src/Functional/Plugin/ContextualFiltersBlockContextTest.php
index c41edf53..508a61a5 100644
--- a/web/core/modules/views/tests/src/Functional/Plugin/ContextualFiltersBlockContextTest.php
+++ b/web/core/modules/views/tests/src/Functional/Plugin/ContextualFiltersBlockContextTest.php
@@ -81,7 +81,10 @@ class ContextualFiltersBlockContextTest extends ViewTestBase {
* Tests exposed context.
*/
public function testBlockContext() {
- $this->drupalLogin($this->drupalCreateUser(['administer views', 'administer blocks']));
+ $this->drupalLogin($this->drupalCreateUser([
+ 'administer views',
+ 'administer blocks',
+ ]));
// Check if context was correctly propagated to the block.
$definition = $this->container->get('plugin.manager.block')
diff --git a/web/core/modules/views/tests/src/Functional/Plugin/DisabledDisplayTest.php b/web/core/modules/views/tests/src/Functional/Plugin/DisabledDisplayTest.php
index 5f3f3705..0f6680af 100644
--- a/web/core/modules/views/tests/src/Functional/Plugin/DisabledDisplayTest.php
+++ b/web/core/modules/views/tests/src/Functional/Plugin/DisabledDisplayTest.php
@@ -38,7 +38,9 @@ class DisabledDisplayTest extends ViewTestBase {
$this->drupalPlaceBlock('page_title_block');
- $admin_user = $this->drupalCreateUser(['administer site configuration']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer site configuration',
+ ]);
$this->drupalLogin($admin_user);
}
diff --git a/web/core/modules/views/tests/src/Functional/Plugin/DisplayTest.php b/web/core/modules/views/tests/src/Functional/Plugin/DisplayTest.php
index 515a9179..d828a4ce 100644
--- a/web/core/modules/views/tests/src/Functional/Plugin/DisplayTest.php
+++ b/web/core/modules/views/tests/src/Functional/Plugin/DisplayTest.php
@@ -136,7 +136,7 @@ class DisplayTest extends ViewTestBase {
// Check the new value has been saved by checking the UI summary text.
$this->drupalGet('admin/structure/views/view/test_view/edit/display_test_1');
- $this->assertLink($test_option);
+ $this->assertSession()->linkExists($test_option);
// Test the enable/disable status of a display.
$view->display_handler->setOption('enabled', FALSE);
diff --git a/web/core/modules/views/tests/src/Functional/Plugin/MenuLinkTest.php b/web/core/modules/views/tests/src/Functional/Plugin/MenuLinkTest.php
index 9d58f4a4..f3800312 100644
--- a/web/core/modules/views/tests/src/Functional/Plugin/MenuLinkTest.php
+++ b/web/core/modules/views/tests/src/Functional/Plugin/MenuLinkTest.php
@@ -53,7 +53,10 @@ class MenuLinkTest extends ViewTestBase {
$this->enableViewsTestModule();
- $this->adminUser = $this->drupalCreateUser(['administer views', 'administer menu']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'administer views',
+ 'administer menu',
+ ]);
$this->drupalPlaceBlock('system_menu_block:main');
$this->drupalCreateContentType(['type' => 'page']);
}
diff --git a/web/core/modules/views/tests/src/Functional/Plugin/NumericFormatPluralTest.php b/web/core/modules/views/tests/src/Functional/Plugin/NumericFormatPluralTest.php
index 57a2f8be..bd29a173 100644
--- a/web/core/modules/views/tests/src/Functional/Plugin/NumericFormatPluralTest.php
+++ b/web/core/modules/views/tests/src/Functional/Plugin/NumericFormatPluralTest.php
@@ -36,7 +36,10 @@ class NumericFormatPluralTest extends ViewTestBase {
protected function setUp($import_test_views = TRUE) {
parent::setUp($import_test_views);
- $web_user = $this->drupalCreateUser(['administer views', 'administer languages']);
+ $web_user = $this->drupalCreateUser([
+ 'administer views',
+ 'administer languages',
+ ]);
$this->drupalLogin($web_user);
}
diff --git a/web/core/modules/views/tests/src/Functional/Plugin/PagerTest.php b/web/core/modules/views/tests/src/Functional/Plugin/PagerTest.php
index 81a0fa50..3cae40c6 100644
--- a/web/core/modules/views/tests/src/Functional/Plugin/PagerTest.php
+++ b/web/core/modules/views/tests/src/Functional/Plugin/PagerTest.php
@@ -51,7 +51,10 @@ class PagerTest extends ViewTestBase {
// Show the master display so the override selection is shown.
\Drupal::configFactory()->getEditable('views.settings')->set('ui.show.master_display', TRUE)->save();
- $admin_user = $this->drupalCreateUser(['administer views', 'administer site configuration']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer views',
+ 'administer site configuration',
+ ]);
$this->drupalLogin($admin_user);
// Test behavior described in
// https://www.drupal.org/node/652712#comment-2354918.
@@ -384,7 +387,12 @@ class PagerTest extends ViewTestBase {
$this->container->get('module_installer')->install(['locale', 'language', 'config_translation']);
$this->resetAll();
- $admin_user = $this->drupalCreateUser(['access content overview', 'administer nodes', 'bypass node access', 'translate configuration']);
+ $admin_user = $this->drupalCreateUser([
+ 'access content overview',
+ 'administer nodes',
+ 'bypass node access',
+ 'translate configuration',
+ ]);
$this->drupalLogin($admin_user);
$langcode = 'nl';
diff --git a/web/core/modules/views/tests/src/Functional/Plugin/StyleTableTest.php b/web/core/modules/views/tests/src/Functional/Plugin/StyleTableTest.php
index bcd8cf85..e81c213f 100644
--- a/web/core/modules/views/tests/src/Functional/Plugin/StyleTableTest.php
+++ b/web/core/modules/views/tests/src/Functional/Plugin/StyleTableTest.php
@@ -211,6 +211,8 @@ class StyleTableTest extends ViewTestBase {
// Ensure that we don't find the caption containing unsafe markup.
$this->assertNoRaw($unsafe_markup, "Didn't find caption containing unsafe markup.");
+ // Ensure that the summary isn't shown.
+ $this->assertEmpty($this->xpath('//caption/details'));
// Ensure that all expected captions are found.
foreach ($expected_captions as $raw_caption) {
diff --git a/web/core/modules/views/tests/src/Functional/SearchIntegrationTest.php b/web/core/modules/views/tests/src/Functional/SearchIntegrationTest.php
index 13441732..233cbabd 100644
--- a/web/core/modules/views/tests/src/Functional/SearchIntegrationTest.php
+++ b/web/core/modules/views/tests/src/Functional/SearchIntegrationTest.php
@@ -69,21 +69,21 @@ class SearchIntegrationTest extends ViewTestBase {
// Page with a keyword filter of 'pizza'.
$this->drupalGet('test-filter');
- $this->assertLink('pizza');
- $this->assertNoLink('sandwich');
- $this->assertLink('cola');
+ $this->assertSession()->linkExists('pizza');
+ $this->assertSession()->linkNotExists('sandwich');
+ $this->assertSession()->linkExists('cola');
// Page with a keyword argument, various argument values.
// Verify that the correct nodes are shown, and only once.
$this->drupalGet('test-arg/pizza');
$this->assertOneLink('pizza');
- $this->assertNoLink('sandwich');
+ $this->assertSession()->linkNotExists('sandwich');
$this->assertOneLink('cola');
$this->drupalGet('test-arg/sandwich');
- $this->assertNoLink('pizza');
+ $this->assertSession()->linkNotExists('pizza');
$this->assertOneLink('sandwich');
- $this->assertNoLink('cola');
+ $this->assertSession()->linkNotExists('cola');
$this->drupalGet('test-arg/pizza OR sandwich');
$this->assertOneLink('pizza');
@@ -91,18 +91,18 @@ class SearchIntegrationTest extends ViewTestBase {
$this->assertOneLink('cola');
$this->drupalGet('test-arg/pizza sandwich OR cola');
- $this->assertNoLink('pizza');
- $this->assertNoLink('sandwich');
+ $this->assertSession()->linkNotExists('pizza');
+ $this->assertSession()->linkNotExists('sandwich');
$this->assertOneLink('cola');
$this->drupalGet('test-arg/cola pizza');
- $this->assertNoLink('pizza');
- $this->assertNoLink('sandwich');
+ $this->assertSession()->linkNotExists('pizza');
+ $this->assertSession()->linkNotExists('sandwich');
$this->assertOneLink('cola');
$this->drupalGet('test-arg/"cola is good"');
- $this->assertNoLink('pizza');
- $this->assertNoLink('sandwich');
+ $this->assertSession()->linkNotExists('pizza');
+ $this->assertSession()->linkNotExists('sandwich');
$this->assertOneLink('cola');
// Test sorting.
diff --git a/web/core/modules/views/tests/src/Functional/SearchMultilingualTest.php b/web/core/modules/views/tests/src/Functional/SearchMultilingualTest.php
index d7e209ae..d2d2fb05 100644
--- a/web/core/modules/views/tests/src/Functional/SearchMultilingualTest.php
+++ b/web/core/modules/views/tests/src/Functional/SearchMultilingualTest.php
@@ -45,7 +45,14 @@ class SearchMultilingualTest extends ViewTestBase {
public function testMultilingualSearchFilter() {
// Create a user with admin for languages, content, and content types, plus
// the ability to access content and searches.
- $user = $this->drupalCreateUser(['administer nodes', 'administer content types', 'administer languages', 'administer content translation', 'access content', 'search content']);
+ $user = $this->drupalCreateUser([
+ 'administer nodes',
+ 'administer content types',
+ 'administer languages',
+ 'administer content translation',
+ 'access content',
+ 'search content',
+ ]);
$this->drupalLogin($user);
// Add Spanish language programmatically.
@@ -87,8 +94,8 @@ class SearchMultilingualTest extends ViewTestBase {
// translated node, which has 'pizza' in the title, but not the English
// one, which does not have the word 'pizza' in it.
$this->drupalGet('test-filter');
- $this->assertLink('pizza', 0, 'Found translation with matching title');
- $this->assertNoLink('sandwich', 'Did not find translation with non-matching title');
+ $this->assertSession()->linkExists('pizza', 0, 'Found translation with matching title');
+ $this->assertSession()->linkNotExists('sandwich', 'Did not find translation with non-matching title');
}
}
diff --git a/web/core/modules/views/tests/src/Functional/Wizard/MenuTest.php b/web/core/modules/views/tests/src/Functional/Wizard/MenuTest.php
index f35b851e..e9483c30 100644
--- a/web/core/modules/views/tests/src/Functional/Wizard/MenuTest.php
+++ b/web/core/modules/views/tests/src/Functional/Wizard/MenuTest.php
@@ -40,7 +40,7 @@ class MenuTest extends WizardTestBase {
// expect the main menu to display).
$this->drupalGet('');
$this->assertSession()->statusCodeEquals(200);
- $this->assertLink($view['page[link_properties][title]']);
+ $this->assertSession()->linkExists($view['page[link_properties][title]']);
$this->assertLinkByHref(Url::fromUri('base:' . $view['page[path]'])->toString());
// Make sure the link is associated with the main menu.
diff --git a/web/core/modules/views/tests/src/Functional/Wizard/WizardTestBase.php b/web/core/modules/views/tests/src/Functional/Wizard/WizardTestBase.php
index 0178c08c..482e07de 100644
--- a/web/core/modules/views/tests/src/Functional/Wizard/WizardTestBase.php
+++ b/web/core/modules/views/tests/src/Functional/Wizard/WizardTestBase.php
@@ -20,7 +20,13 @@ abstract class WizardTestBase extends ViewTestBase {
parent::setUp($import_test_views);
// Create and log in a user with administer views permission.
- $views_admin = $this->drupalCreateUser(['administer views', 'administer blocks', 'bypass node access', 'access user profiles', 'view all revisions']);
+ $views_admin = $this->drupalCreateUser([
+ 'administer views',
+ 'administer blocks',
+ 'bypass node access',
+ 'access user profiles',
+ 'view all revisions',
+ ]);
$this->drupalLogin($views_admin);
$this->drupalPlaceBlock('local_actions_block');
}
diff --git a/web/core/modules/views/tests/src/Kernel/ModuleTest.php b/web/core/modules/views/tests/src/Kernel/ModuleTest.php
index 219d3ae3..a37446e2 100644
--- a/web/core/modules/views/tests/src/Kernel/ModuleTest.php
+++ b/web/core/modules/views/tests/src/Kernel/ModuleTest.php
@@ -2,15 +2,19 @@
namespace Drupal\Tests\views\Kernel;
+use Drupal\Component\Render\FormattableMarkup;
+use Drupal\Core\Form\FormState;
+use Drupal\views\Plugin\views\area\Broken as BrokenArea;
+use Drupal\views\Plugin\views\field\Broken as BrokenField;
+use Drupal\views\Plugin\views\filter\Broken as BrokenFilter;
+use Drupal\views\Plugin\views\filter\Standard;
+use Drupal\views\Views;
+
/**
* Tests basic functions from the Views module.
*
* @group views
*/
-use Drupal\views\Plugin\views\filter\Standard;
-use Drupal\views\Views;
-use Drupal\Component\Render\FormattableMarkup;
-
class ModuleTest extends ViewsKernelTestBase {
/**
@@ -42,14 +46,41 @@ class ModuleTest extends ViewsKernelTestBase {
* @see \Drupal\views\Plugin\ViewsHandlerManager::getHandler()
*/
public function testViewsGetHandler() {
- $types = ['field', 'area', 'filter'];
- foreach ($types as $type) {
- $item = [
- 'table' => $this->randomMachineName(),
- 'field' => $this->randomMachineName(),
- ];
- $handler = $this->container->get('plugin.manager.views.' . $type)->getHandler($item);
- $this->assertEqual('Drupal\views\Plugin\views\\' . $type . '\Broken', get_class($handler), new FormattableMarkup('Make sure that a broken handler of type: @type is created.', ['@type' => $type]));
+ $types = [
+ 'field' => BrokenField::class,
+ 'area' => BrokenArea::class,
+ 'filter' => BrokenFilter::class,
+ ];
+ // Test non-existent tables/fields.
+ $items = [
+ [
+ 'table' => 'table_invalid',
+ 'field' => 'id',
+ ],
+ [
+ 'table' => 'views_test_data',
+ 'field' => 'field_invalid',
+ ],
+ ];
+ $form_state = new FormState();
+ $description_top = '
' . t('The handler for this item is broken or missing. The following details are available:') . '
';
+ $description_bottom = '
' . t('Enabling the appropriate module may solve this issue. Otherwise, check to see if there is a module update available.') . '
';
+ foreach ($types as $type => $class) {
+ foreach ($items as $item) {
+ $handler = $this->container->get('plugin.manager.views.' . $type)
+ ->getHandler($item);
+ $this->assertTrue($handler instanceof $class);
+ // Make sure details available at edit form.
+ $form = [];
+ $handler->buildOptionsForm($form, $form_state);
+ $this->assertEquals($description_top, $form['description']['description_top']['#markup']);
+ $this->assertEquals($description_bottom, $form['description']['description_bottom']['#markup']);
+ $details = [];
+ foreach ($item as $key => $value) {
+ $details[] = new FormattableMarkup('@key: @value', ['@key' => $key, '@value' => $value]);
+ }
+ $this->assertEquals($details, $form['description']['detail_list']['#items']);
+ }
}
$views_data = $this->viewsData();
@@ -77,61 +108,6 @@ class ModuleTest extends ViewsKernelTestBase {
];
$handler = $this->container->get('plugin.manager.views.filter')->getHandler($item, 'standard');
$this->assertInstanceOf(Standard::class, $handler);
-
- // @todo Reinstate these tests when the debug() in views_get_handler() is
- // restored.
- return;
-
- // Test non-existent tables/fields.
- set_error_handler([$this, 'customErrorHandler']);
- $item = [
- 'table' => 'views_test_data',
- 'field' => 'field_invalid',
- ];
- $this->container->get('plugin.manager.views.field')->getHandler($item);
- $this->assertStringContainsString(new FormattableMarkup("Missing handler: @table @field @type", ['@table' => 'views_test_data', '@field' => 'field_invalid', '@type' => 'field']), $this->lastErrorMessage, 'An invalid field name throws a debug message.');
- unset($this->lastErrorMessage);
-
- $item = [
- 'table' => 'table_invalid',
- 'field' => 'id',
- ];
- $this->container->get('plugin.manager.views.filter')->getHandler($item);
- $this->assertStringContainsString(new FormattableMarkup("Missing handler: @table @field @type", ['@table' => 'table_invalid', '@field' => 'id', '@type' => 'filter']), $this->lastErrorMessage, 'An invalid table name throws a debug message.');
- unset($this->lastErrorMessage);
-
- $item = [
- 'table' => 'table_invalid',
- 'field' => 'id',
- ];
- $this->container->get('plugin.manager.views.filter')->getHandler($item);
- $this->assertStringContainsString(new FormattableMarkup("Missing handler: @table @field @type", ['@table' => 'table_invalid', '@field' => 'id', '@type' => 'filter']), $this->lastErrorMessage, 'An invalid table name throws a debug message.');
- unset($this->lastErrorMessage);
-
- restore_error_handler();
- }
-
- /**
- * Defines an error handler which is used in the test.
- *
- * Because this is registered in set_error_handler(), it has to be public.
- *
- * @param int $error_level
- * The level of the error raised.
- * @param string $message
- * The error message.
- * @param string $filename
- * The filename that the error was raised in.
- * @param int $line
- * The line number the error was raised at.
- * @param array $context
- * An array that points to the active symbol table at the point the error
- * occurred.
- *
- * @see set_error_handler()
- */
- public function customErrorHandler($error_level, $message, $filename, $line, $context) {
- $this->lastErrorMessage = $message;
}
/**
diff --git a/web/core/modules/views/tests/src/Kernel/ViewsConfigUpdaterTest.php b/web/core/modules/views/tests/src/Kernel/ViewsConfigUpdaterTest.php
index d17e60ac..f8c416f9 100644
--- a/web/core/modules/views/tests/src/Kernel/ViewsConfigUpdaterTest.php
+++ b/web/core/modules/views/tests/src/Kernel/ViewsConfigUpdaterTest.php
@@ -19,6 +19,11 @@ class ViewsConfigUpdaterTest extends ViewsKernelTestBase {
*/
protected $configUpdater;
+ /**
+ * {@inheritdoc}
+ */
+ public static $modules = ['views_config_entity_test'];
+
/**
* {@inheritdoc}
*/
diff --git a/web/core/modules/views/tests/src/Unit/ViewsTest.php b/web/core/modules/views/tests/src/Unit/ViewsTest.php
index f6dbaadb..f14adae2 100644
--- a/web/core/modules/views/tests/src/Unit/ViewsTest.php
+++ b/web/core/modules/views/tests/src/Unit/ViewsTest.php
@@ -2,6 +2,7 @@
namespace Drupal\Tests\views\Unit;
+use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Tests\UnitTestCase;
use Drupal\views\Views;
@@ -72,6 +73,21 @@ class ViewsTest extends UnitTestCase {
$this->assertEquals(spl_object_hash($view), spl_object_hash($executable->storage));
}
+ /**
+ * Tests the getView() method against a non-existent view.
+ *
+ * @covers ::getView
+ */
+ public function testGetNonExistentView() {
+ $entity_type_manager = $this->prophesize(EntityTypeManagerInterface::class);
+ $storage = $this->prophesize(EntityStorageInterface::class);
+ $storage->load('test_view_non_existent')->willReturn(NULL);
+ $entity_type_manager->getStorage('view')->willReturn($storage->reveal());
+ $this->container->set('entity_type.manager', $entity_type_manager->reveal());
+ $executable_does_not_exist = Views::getView('test_view_non_existent');
+ $this->assertNull($executable_does_not_exist);
+ }
+
/**
* @covers ::getApplicableViews
*
diff --git a/web/core/modules/views/views.module b/web/core/modules/views/views.module
index 398b670f..f9f2946c 100644
--- a/web/core/modules/views/views.module
+++ b/web/core/modules/views/views.module
@@ -624,6 +624,7 @@ function views_disable_view(View $view) {
* @param array $element
* An associative array containing the properties of the element.
* Properties used: #substitutions, #children.
+ *
* @return array
* The $element with prepared variables ready for #theme 'form'
* in views_form_views_form.
@@ -777,6 +778,7 @@ function views_embed_view($name, $display_id = 'default') {
* Everything after #views-tab- is the display ID, e.g. page_1.
* @param ...
* Any additional parameters will be passed as arguments.
+ *
* @return array
* An array containing an object for each view item.
*/
diff --git a/web/core/modules/views/views.theme.inc b/web/core/modules/views/views.theme.inc
index ba955976..019899ad 100644
--- a/web/core/modules/views/views.theme.inc
+++ b/web/core/modules/views/views.theme.inc
@@ -664,20 +664,22 @@ function template_preprocess_views_view_table(&$variables) {
// variables, although core templates now all use 'summary_element' instead.
$variables['summary'] = $handler->options['summary'];
$variables['description'] = $handler->options['description'];
- $variables['summary_element'] = [
- '#type' => 'details',
- '#title' => $handler->options['summary'],
- // To ensure that the description is properly escaped during rendering, use
- // an 'inline_template' to let Twig do its magic, instead of 'markup'.
- 'description' => [
- '#type' => 'inline_template',
- '#template' => '{{ description }}',
- '#context' => [
- 'description' => $handler->options['description'],
+ if (!empty($handler->options['summary']) || !empty($handler->options['description'])) {
+ $variables['summary_element'] = [
+ '#type' => 'details',
+ '#title' => $handler->options['summary'],
+ // To ensure that the description is properly escaped during rendering,
+ // use an 'inline_template' to let Twig do its magic, instead of 'markup'.
+ 'description' => [
+ '#type' => 'inline_template',
+ '#template' => '{{ description }}',
+ '#context' => [
+ 'description' => $handler->options['description'],
+ ],
],
- ],
- ];
- $variables['caption_needed'] |= !empty($variables['summary']) || !empty($variables['description']);
+ ];
+ $variables['caption_needed'] = TRUE;
+ }
$variables['responsive'] = FALSE;
// If the table has headers and it should react responsively to columns hidden
diff --git a/web/core/modules/views_ui/tests/src/Functional/AnalyzeTest.php b/web/core/modules/views_ui/tests/src/Functional/AnalyzeTest.php
index 2ad5adc5..fcf0d850 100644
--- a/web/core/modules/views_ui/tests/src/Functional/AnalyzeTest.php
+++ b/web/core/modules/views_ui/tests/src/Functional/AnalyzeTest.php
@@ -35,7 +35,7 @@ class AnalyzeTest extends UITestBase {
$this->drupalLogin($this->adminUser);
$this->drupalGet('admin/structure/views/view/test_view/edit');
- $this->assertLink(t('Analyze view'));
+ $this->assertSession()->linkExists(t('Analyze view'));
// This redirects the user to the analyze form.
$this->clickLink(t('Analyze view'));
diff --git a/web/core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php b/web/core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php
index 6a5a75f0..7a356d00 100644
--- a/web/core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php
+++ b/web/core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php
@@ -53,7 +53,7 @@ class DefaultViewsTest extends UITestBase {
// It should not be possible to revert the view yet.
// @todo Figure out how to handle this with the new configuration system.
- // $this->assertNoLink(t('Revert'));
+ // $this->assertSession()->linkNotExists(t('Revert'));
// $revert_href = 'admin/structure/views/view/glossary/revert';
// $this->assertNoLinkByHref($revert_href);
@@ -81,7 +81,7 @@ class DefaultViewsTest extends UITestBase {
// It should now be possible to revert the view. Do that, and make sure the
// view title we added above no longer is displayed.
// $this->drupalGet('admin/structure/views');
- // $this->assertLink(t('Revert'));
+ // $this->assertSession()->linkExists(t('Revert'));
// $this->assertLinkByHref($revert_href);
// $this->drupalPostForm($revert_href, array(), t('Revert'));
// $this->drupalGet('glossary');
diff --git a/web/core/modules/views_ui/tests/src/Functional/DisplayCRUDTest.php b/web/core/modules/views_ui/tests/src/Functional/DisplayCRUDTest.php
index b24efd5e..f5100414 100644
--- a/web/core/modules/views_ui/tests/src/Functional/DisplayCRUDTest.php
+++ b/web/core/modules/views_ui/tests/src/Functional/DisplayCRUDTest.php
@@ -47,8 +47,8 @@ class DisplayCRUDTest extends UITestBase {
$this->drupalPostForm(NULL, [], 'Add Page');
$this->assertLinkByHref($path_prefix . '/page_1', 0, 'Make sure after adding a display the new display appears in the UI');
- $this->assertNoLink('Master*', 'Make sure the master display is not marked as changed.');
- $this->assertLink('Page*', 0, 'Make sure the added display is marked as changed.');
+ $this->assertSession()->linkNotExists('Master*', 'Make sure the master display is not marked as changed.');
+ $this->assertSession()->linkExists('Page*', 0, 'Make sure the added display is marked as changed.');
$this->drupalPostForm("admin/structure/views/nojs/display/{$view['id']}/page_1/path", ['path' => 'test/path'], t('Apply'));
$this->drupalPostForm(NULL, [], t('Save'));
diff --git a/web/core/modules/views_ui/tests/src/Functional/DisplayExtenderUITest.php b/web/core/modules/views_ui/tests/src/Functional/DisplayExtenderUITest.php
index 9a4edbc3..5b01e7f5 100644
--- a/web/core/modules/views_ui/tests/src/Functional/DisplayExtenderUITest.php
+++ b/web/core/modules/views_ui/tests/src/Functional/DisplayExtenderUITest.php
@@ -38,7 +38,7 @@ class DisplayExtenderUITest extends UITestBase {
$random_text = $this->randomMachineName();
$this->drupalPostForm($display_option_url, ['test_extender_test_option' => $random_text], t('Apply'));
- $this->assertLink($random_text);
+ $this->assertSession()->linkExists($random_text);
$this->drupalPostForm(NULL, [], t('Save'));
$view = Views::getView($view->storage->id());
$view->initDisplay();
diff --git a/web/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php b/web/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php
index e4ba28fa..d73df00a 100644
--- a/web/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php
+++ b/web/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php
@@ -57,7 +57,7 @@ class DisplayPathTest extends UITestBase {
// Add a new page display and check the appearing text.
$this->drupalPostForm(NULL, [], 'Add Page');
$this->assertText(t('No path is set'), 'The right text appears if no path was set.');
- $this->assertNoLink(t('View @display', ['@display' => 'page']), 'No view page link found on the page.');
+ $this->assertSession()->linkNotExists(t('View @display', ['@display' => 'page']), 'No view page link found on the page.');
// Save a path and make sure the summary appears as expected.
$random_path = $this->randomMachineName();
@@ -68,7 +68,7 @@ class DisplayPathTest extends UITestBase {
$this->drupalPostForm('admin/structure/views/nojs/display/test_view/page_1/path', ['path' => $random_path], t('Apply'));
$this->assertText('/' . $random_path, 'The custom path appears in the summary.');
$display_link_text = t('View @display', ['@display' => 'Page']);
- $this->assertLink($display_link_text, 0, 'view page link found on the page.');
+ $this->assertSession()->linkExists($display_link_text, 0, 'view page link found on the page.');
$this->clickLink($display_link_text);
$this->assertUrl($random_path);
}
@@ -159,7 +159,7 @@ class DisplayPathTest extends UITestBase {
$this->assertUrl('admin/structure/views/view/test_view/edit/page_1');
$this->drupalGet('admin/structure/views/view/test_view');
- $this->assertLink(t('Tab: @title', ['@title' => 'Test tab title']));
+ $this->assertSession()->linkExists(t('Tab: @title', ['@title' => 'Test tab title']));
// If it's a default tab, it should also have an additional settings link.
$this->assertLinkByHref('admin/structure/views/nojs/display/test_view/page_1/tab_options');
diff --git a/web/core/modules/views_ui/tests/src/Functional/DisplayTest.php b/web/core/modules/views_ui/tests/src/Functional/DisplayTest.php
index d2b03327..d3577f8a 100644
--- a/web/core/modules/views_ui/tests/src/Functional/DisplayTest.php
+++ b/web/core/modules/views_ui/tests/src/Functional/DisplayTest.php
@@ -173,7 +173,7 @@ class DisplayTest extends UITestBase {
// The form redirects to the master display.
$this->drupalGet($path);
- $this->assertLink(t('Custom URL'), 0, 'The link option has custom URL as summary.');
+ $this->assertSession()->linkExists(t('Custom URL'), 0, 'The link option has custom URL as summary.');
// Test the default link_url value for new display
$this->drupalPostForm(NULL, [], t('Add Block'));
diff --git a/web/core/modules/views_ui/tests/src/Functional/FilterUITest.php b/web/core/modules/views_ui/tests/src/Functional/FilterUITest.php
index 6422bb48..dc43ab99 100644
--- a/web/core/modules/views_ui/tests/src/Functional/FilterUITest.php
+++ b/web/core/modules/views_ui/tests/src/Functional/FilterUITest.php
@@ -41,7 +41,10 @@ class FilterUITest extends UITestBase {
* Tests that an option for a filter is saved as expected from the UI.
*/
public function testFilterInOperatorUi() {
- $admin_user = $this->drupalCreateUser(['administer views', 'administer site configuration']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer views',
+ 'administer site configuration',
+ ]);
$this->drupalLogin($admin_user);
$path = 'admin/structure/views/nojs/handler/test_filter_in_operator_ui/default/filter/type';
@@ -64,12 +67,15 @@ class FilterUITest extends UITestBase {
* Tests the filters from the UI.
*/
public function testFiltersUI() {
- $admin_user = $this->drupalCreateUser(['administer views', 'administer site configuration']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer views',
+ 'administer site configuration',
+ ]);
$this->drupalLogin($admin_user);
$this->drupalGet('admin/structure/views/view/test_filter_groups');
- $this->assertLink('Content: ID (= 1)', 0, 'Content: ID (= 1) link appears correctly.');
+ $this->assertSession()->linkExists('Content: ID (= 1)', 0, 'Content: ID (= 1) link appears correctly.');
// Tests that we can create a new filter group from UI.
$this->drupalGet('admin/structure/views/nojs/rearrange-filter/test_filter_groups/page');
@@ -96,7 +102,10 @@ class FilterUITest extends UITestBase {
* Tests the identifier settings and restrictions.
*/
public function testFilterIdentifier() {
- $admin_user = $this->drupalCreateUser(['administer views', 'administer site configuration']);
+ $admin_user = $this->drupalCreateUser([
+ 'administer views',
+ 'administer site configuration',
+ ]);
$this->drupalLogin($admin_user);
$path = 'admin/structure/views/nojs/handler/test_filter_in_operator_ui/default/filter/type';
diff --git a/web/core/modules/views_ui/tests/src/Functional/GroupByTest.php b/web/core/modules/views_ui/tests/src/Functional/GroupByTest.php
index e79ff9d2..b393411d 100644
--- a/web/core/modules/views_ui/tests/src/Functional/GroupByTest.php
+++ b/web/core/modules/views_ui/tests/src/Functional/GroupByTest.php
@@ -42,7 +42,7 @@ class GroupByTest extends UITestBase {
// Change the groupby type in the UI.
$this->drupalPostForm($edit_groupby_url, ['options[group_type]' => 'count'], t('Apply'));
- $this->assertLink('COUNT(Views test: ID)', 0, 'The count setting is displayed in the UI');
+ $this->assertSession()->linkExists('COUNT(Views test: ID)', 0, 'The count setting is displayed in the UI');
$this->drupalPostForm(NULL, [], t('Save'));
diff --git a/web/core/modules/views_ui/tests/src/Functional/RowUITest.php b/web/core/modules/views_ui/tests/src/Functional/RowUITest.php
index 53c74ea4..bff992f5 100644
--- a/web/core/modules/views_ui/tests/src/Functional/RowUITest.php
+++ b/web/core/modules/views_ui/tests/src/Functional/RowUITest.php
@@ -52,7 +52,7 @@ class RowUITest extends UITestBase {
$this->assertFieldByName('row_options[test_option]', $random_name, 'Make sure the custom settings form field has the expected value stored.');
$this->drupalPostForm($view_edit_url, [], t('Save'));
- $this->assertLink(t('Test row plugin'), 0, 'Make sure the test row plugin is shown in the UI');
+ $this->assertSession()->linkExists(t('Test row plugin'), 0, 'Make sure the test row plugin is shown in the UI');
$view = Views::getView($view_name);
$view->initDisplay();
diff --git a/web/core/modules/views_ui/tests/src/Functional/SettingsTest.php b/web/core/modules/views_ui/tests/src/Functional/SettingsTest.php
index 955a7c18..436c43bc 100644
--- a/web/core/modules/views_ui/tests/src/Functional/SettingsTest.php
+++ b/web/core/modules/views_ui/tests/src/Functional/SettingsTest.php
@@ -74,7 +74,7 @@ class SettingsTest extends UITestBase {
$view['id'] = strtolower($this->randomMachineName());
$this->drupalPostForm('admin/structure/views/add', $view, t('Save and edit'));
- $this->assertNoLink(t('Master'));
+ $this->assertSession()->linkNotExists(t('Master'));
// Configure to always show the advanced settings.
// @todo It doesn't seem to be a way to test this as this works just on js.
diff --git a/web/core/modules/views_ui/tests/src/Functional/StyleUITest.php b/web/core/modules/views_ui/tests/src/Functional/StyleUITest.php
index 0bd7e986..b85c65c5 100644
--- a/web/core/modules/views_ui/tests/src/Functional/StyleUITest.php
+++ b/web/core/modules/views_ui/tests/src/Functional/StyleUITest.php
@@ -51,7 +51,7 @@ class StyleUITest extends UITestBase {
$this->assertFieldByName('style_options[test_option]', $random_name, 'Make sure the custom settings form field has the expected value stored.');
$this->drupalPostForm($view_edit_url, [], t('Save'));
- $this->assertLink(t('Test style plugin'), 0, 'Make sure the test style plugin is shown in the UI');
+ $this->assertSession()->linkExists(t('Test style plugin'), 0, 'Make sure the test style plugin is shown in the UI');
$view = Views::getView($view_name);
$view->initDisplay();
diff --git a/web/core/modules/views_ui/tests/src/Functional/ViewEditTest.php b/web/core/modules/views_ui/tests/src/Functional/ViewEditTest.php
index c5cef740..029ac924 100644
--- a/web/core/modules/views_ui/tests/src/Functional/ViewEditTest.php
+++ b/web/core/modules/views_ui/tests/src/Functional/ViewEditTest.php
@@ -29,7 +29,7 @@ class ViewEditTest extends UITestBase {
*/
public function testDeleteLink() {
$this->drupalGet('admin/structure/views/view/test_view');
- $this->assertLink(t('Delete view'), 0, 'Ensure that the view delete link appears');
+ $this->assertSession()->linkExists(t('Delete view'), 0, 'Ensure that the view delete link appears');
$view = $this->container->get('entity_type.manager')->getStorage('view')->load('test_view');
$this->assertInstanceOf(View::class, $view);
@@ -59,7 +59,7 @@ class ViewEditTest extends UITestBase {
// Change the machine name for the display from page_1 to test_1.
$edit = ['display_id' => 'test_1'];
$this->drupalPostForm('admin/structure/views/nojs/display/test_view/attachment_1/display_id', $edit, 'Apply');
- $this->assertLink(t('test_1'));
+ $this->assertSession()->linkExists(t('test_1'));
// Save the view, and test the new ID has been saved.
$this->drupalPostForm(NULL, [], 'Save');
@@ -73,7 +73,7 @@ class ViewEditTest extends UITestBase {
$edit = ['display_id' => 'test_1'];
$this->drupalPostForm('admin/structure/views/nojs/display/test_view/test_1/display_id', $edit, 'Apply');
$this->drupalPostForm(NULL, [], 'Save');
- $this->assertLink(t('test_1'));
+ $this->assertSession()->linkExists(t('test_1'));
// Test the form validation with invalid IDs.
$machine_name_edit_url = 'admin/structure/views/nojs/display/test_view/test_1/display_id';
@@ -103,7 +103,7 @@ class ViewEditTest extends UITestBase {
// Test that the display ID has not been changed.
$this->drupalGet('admin/structure/views/view/test_view/edit/test_1');
- $this->assertLink(t('test_1'));
+ $this->assertSession()->linkExists(t('test_1'));
// Test that validation does not run on cancel.
$this->drupalGet('admin/structure/views/view/test_view');
@@ -136,7 +136,7 @@ class ViewEditTest extends UITestBase {
$langcode_url = 'admin/structure/views/nojs/display/' . $view_name . '/' . $display . '/rendering_language';
$this->assertNoLinkByHref($langcode_url);
$assert_session->linkNotExistsExact(t('@type language selected for page', ['@type' => t('Content')]));
- $this->assertNoLink(t('Content language of view row'));
+ $this->assertSession()->linkNotExists(t('Content language of view row'));
}
// Make the site multilingual and test the options again.
@@ -153,12 +153,12 @@ class ViewEditTest extends UITestBase {
if ($view_name == 'test_view') {
$this->assertNoLinkByHref($langcode_url);
$assert_session->linkNotExistsExact(t('@type language selected for page', ['@type' => t('Content')]));
- $this->assertNoLink(t('Content language of view row'));
+ $this->assertSession()->linkNotExists(t('Content language of view row'));
}
else {
$this->assertLinkByHref($langcode_url);
$assert_session->linkNotExistsExact(t('@type language selected for page', ['@type' => t('Content')]));
- $this->assertLink(t('Content language of view row'));
+ $this->assertSession()->linkExists(t('Content language of view row'));
}
$this->drupalGet($langcode_url);
diff --git a/web/core/modules/views_ui/tests/src/Functional/ViewsListTest.php b/web/core/modules/views_ui/tests/src/Functional/ViewsListTest.php
index d5ac50f7..ac4ebb46 100644
--- a/web/core/modules/views_ui/tests/src/Functional/ViewsListTest.php
+++ b/web/core/modules/views_ui/tests/src/Functional/ViewsListTest.php
@@ -50,7 +50,7 @@ class ViewsListTest extends UITestBase {
// Check if we can access the main views admin page.
$this->drupalGet('admin/structure/views');
$this->assertSession()->statusCodeEquals(200);
- $this->assertLink(t('Add view'));
+ $this->assertSession()->linkExists(t('Add view'));
// Check that there is a link to the content view without a destination
// parameter.
diff --git a/web/core/modules/views_ui/tests/src/Functional/ViewsUITourTest.php b/web/core/modules/views_ui/tests/src/Functional/ViewsUITourTest.php
index 2dd089da..7c2d9d36 100644
--- a/web/core/modules/views_ui/tests/src/Functional/ViewsUITourTest.php
+++ b/web/core/modules/views_ui/tests/src/Functional/ViewsUITourTest.php
@@ -40,7 +40,10 @@ class ViewsUITourTest extends TourTestBase {
protected function setUp() {
parent::setUp();
- $this->adminUser = $this->drupalCreateUser(['administer views', 'access tour']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'administer views',
+ 'access tour',
+ ]);
$this->drupalLogin($this->adminUser);
}
diff --git a/web/core/modules/views_ui/tests/src/Functional/XssTest.php b/web/core/modules/views_ui/tests/src/Functional/XssTest.php
index 3e7fc34b..1af89e39 100644
--- a/web/core/modules/views_ui/tests/src/Functional/XssTest.php
+++ b/web/core/modules/views_ui/tests/src/Functional/XssTest.php
@@ -23,11 +23,13 @@ class XssTest extends UITestBase {
public function testViewsUi() {
$this->drupalGet('admin/structure/views/view/sa_contrib_2013_035');
- $this->assertEscaped('', 'Field admin label is properly escaped.');
+ // Verify that the field admin label is properly escaped.
+ $this->assertEscaped('');
$this->drupalGet('admin/structure/views/nojs/handler/sa_contrib_2013_035/page_1/header/area');
- $this->assertEscaped('{{ title }} == ', 'Token label is properly escaped.');
- $this->assertEscaped('{{ title_1 }} == ', 'Token label is properly escaped.');
+ // Verify that the token label is properly escaped.
+ $this->assertEscaped('{{ title }} == ');
+ $this->assertEscaped('{{ title_1 }} == ');
}
/**
diff --git a/web/core/modules/views_ui/tests/src/FunctionalJavascript/ViewsListingTest.php b/web/core/modules/views_ui/tests/src/FunctionalJavascript/ViewsListingTest.php
index f6a9976d..8d839e3c 100644
--- a/web/core/modules/views_ui/tests/src/FunctionalJavascript/ViewsListingTest.php
+++ b/web/core/modules/views_ui/tests/src/FunctionalJavascript/ViewsListingTest.php
@@ -133,6 +133,7 @@ class ViewsListingTest extends WebDriverTestBase {
* Removes any non-visible elements from the passed array.
*
* @param array $elements
+ *
* @return array
*/
protected function filterVisibleElements($elements) {
diff --git a/web/core/modules/workspaces/src/ViewsQueryAlter.php b/web/core/modules/workspaces/src/ViewsQueryAlter.php
index 485f51a8..2548db4e 100644
--- a/web/core/modules/workspaces/src/ViewsQueryAlter.php
+++ b/web/core/modules/workspaces/src/ViewsQueryAlter.php
@@ -378,6 +378,7 @@ class ViewsQueryAlter implements ContainerInjectionInterface {
*
* @return \Drupal\views\Plugin\views\join\JoinPluginInterface
* An adjusted views join object to add to the query.
+ *
* @throws \Drupal\Component\Plugin\Exception\PluginException
*/
protected function getRevisionTableJoin($relationship, $table, $field, $workspace_association_table, EntityTypeInterface $entity_type) {
diff --git a/web/core/phpcs.xml.dist b/web/core/phpcs.xml.dist
index 645e4e0f..623ef14c 100644
--- a/web/core/phpcs.xml.dist
+++ b/web/core/phpcs.xml.dist
@@ -59,7 +59,6 @@
-
diff --git a/web/core/profiles/demo_umami/tests/src/Functional/UmamiMultilingualInstallTest.php b/web/core/profiles/demo_umami/tests/src/Functional/UmamiMultilingualInstallTest.php
index 1f70df45..4736be9f 100644
--- a/web/core/profiles/demo_umami/tests/src/Functional/UmamiMultilingualInstallTest.php
+++ b/web/core/profiles/demo_umami/tests/src/Functional/UmamiMultilingualInstallTest.php
@@ -46,6 +46,7 @@ class UmamiMultilingualInstallTest extends InstallerTestBase {
*
* @param string $langcode
* The language code.
+ *
* @return string
* Contents for the test .po file.
*/
diff --git a/web/core/profiles/minimal/tests/src/Functional/MinimalTest.php b/web/core/profiles/minimal/tests/src/Functional/MinimalTest.php
index 48894a13..6b3baa14 100644
--- a/web/core/profiles/minimal/tests/src/Functional/MinimalTest.php
+++ b/web/core/profiles/minimal/tests/src/Functional/MinimalTest.php
@@ -28,12 +28,15 @@ class MinimalTest extends BrowserTestBase {
public function testMinimal() {
$this->drupalGet('');
// Check the login block is present.
- $this->assertLink(t('Create new account'));
+ $this->assertSession()->linkExists(t('Create new account'));
$this->assertSession()->statusCodeEquals(200);
// Create a user to test tools and navigation blocks for logged in users
// with appropriate permissions.
- $user = $this->drupalCreateUser(['access administration pages', 'administer content types']);
+ $user = $this->drupalCreateUser([
+ 'access administration pages',
+ 'administer content types',
+ ]);
$this->drupalLogin($user);
$this->drupalGet('');
$this->assertText(t('Tools'));
diff --git a/web/core/profiles/standard/tests/src/Functional/StandardTest.php b/web/core/profiles/standard/tests/src/Functional/StandardTest.php
index 2acd63c7..82d16326 100644
--- a/web/core/profiles/standard/tests/src/Functional/StandardTest.php
+++ b/web/core/profiles/standard/tests/src/Functional/StandardTest.php
@@ -38,7 +38,7 @@ class StandardTest extends BrowserTestBase {
*/
public function testStandard() {
$this->drupalGet('');
- $this->assertLink(t('Contact'));
+ $this->assertSession()->linkExists(t('Contact'));
$this->clickLink(t('Contact'));
$this->assertSession()->statusCodeEquals(200);
diff --git a/web/core/tests/Drupal/FunctionalTests/Entity/DeleteMultipleFormTest.php b/web/core/tests/Drupal/FunctionalTests/Entity/DeleteMultipleFormTest.php
index ef57bd72..1933778d 100644
--- a/web/core/tests/Drupal/FunctionalTests/Entity/DeleteMultipleFormTest.php
+++ b/web/core/tests/Drupal/FunctionalTests/Entity/DeleteMultipleFormTest.php
@@ -46,7 +46,9 @@ class DeleteMultipleFormTest extends BrowserTestBase {
'id' => 'default',
'label' => 'Default',
])->save();
- $this->account = $this->drupalCreateUser(['administer entity_test content']);
+ $this->account = $this->drupalCreateUser([
+ 'administer entity_test content',
+ ]);
$this->drupalLogin($this->account);
}
diff --git a/web/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationQueryTest.php b/web/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationQueryTest.php
index 7345b744..c7508811 100644
--- a/web/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationQueryTest.php
+++ b/web/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationQueryTest.php
@@ -128,6 +128,7 @@ class DistributionProfileTranslationQueryTest extends InstallerTestBase {
*
* @param string $langcode
* The language code.
+ *
* @return string
* Contents for the test .po file.
*/
diff --git a/web/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationTest.php b/web/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationTest.php
index c6eadd6e..0a0f66f8 100644
--- a/web/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationTest.php
+++ b/web/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationTest.php
@@ -119,6 +119,7 @@ class DistributionProfileTranslationTest extends InstallerTestBase {
*
* @param string $langcode
* The language code.
+ *
* @return string
* Contents for the test .po file.
*/
diff --git a/web/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageTest.php b/web/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageTest.php
index 0f06d17a..19d85135 100644
--- a/web/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageTest.php
+++ b/web/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageTest.php
@@ -38,6 +38,7 @@ class InstallerTranslationMultipleLanguageTest extends InstallerTestBase {
*
* @param string $langcode
* The language code.
+ *
* @return string
* Contents for the test .po file.
*/
diff --git a/web/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationQueryTest.php b/web/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationQueryTest.php
index b94647ee..4601653b 100644
--- a/web/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationQueryTest.php
+++ b/web/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationQueryTest.php
@@ -72,6 +72,7 @@ class InstallerTranslationQueryTest extends InstallerTestBase {
*
* @param string $langcode
* The language code.
+ *
* @return string
* Contents for the test .po file.
*/
diff --git a/web/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php b/web/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php
index 1eec26e7..fb69ea77 100644
--- a/web/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php
+++ b/web/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php
@@ -134,6 +134,7 @@ class InstallerTranslationTest extends InstallerTestBase {
*
* @param string $langcode
* The language code.
+ *
* @return string
* Contents for the test .po file.
*/
diff --git a/web/core/tests/Drupal/FunctionalTests/Routing/CaseInsensitivePathTest.php b/web/core/tests/Drupal/FunctionalTests/Routing/CaseInsensitivePathTest.php
index a5532b24..b961f2ff 100644
--- a/web/core/tests/Drupal/FunctionalTests/Routing/CaseInsensitivePathTest.php
+++ b/web/core/tests/Drupal/FunctionalTests/Routing/CaseInsensitivePathTest.php
@@ -43,7 +43,11 @@ class CaseInsensitivePathTest extends BrowserTestBase {
$this->assertSession()->pageTextMatches('/Log in/');
// Tests paths defined by routes from the Views module.
- $admin = $this->drupalCreateUser(['access administration pages', 'administer nodes', 'access content overview']);
+ $admin = $this->drupalCreateUser([
+ 'access administration pages',
+ 'administer nodes',
+ 'access content overview',
+ ]);
$this->drupalLogin($admin);
$this->drupalGet('admin/content');
diff --git a/web/core/tests/Drupal/FunctionalTests/Routing/RouteCachingNonPathLanguageNegotiationTest.php b/web/core/tests/Drupal/FunctionalTests/Routing/RouteCachingNonPathLanguageNegotiationTest.php
index 43e58453..20ddb1df 100644
--- a/web/core/tests/Drupal/FunctionalTests/Routing/RouteCachingNonPathLanguageNegotiationTest.php
+++ b/web/core/tests/Drupal/FunctionalTests/Routing/RouteCachingNonPathLanguageNegotiationTest.php
@@ -39,7 +39,11 @@ class RouteCachingNonPathLanguageNegotiationTest extends BrowserTestBase {
parent::setUp();
// Create and log in user.
- $this->adminUser = $this->drupalCreateUser(['administer blocks', 'administer languages', 'access administration pages']);
+ $this->adminUser = $this->drupalCreateUser([
+ 'administer blocks',
+ 'administer languages',
+ 'access administration pages',
+ ]);
$this->drupalLogin($this->adminUser);
// Add language.
diff --git a/web/core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php b/web/core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php
index 885498fc..3bc2c8f6 100644
--- a/web/core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php
+++ b/web/core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php
@@ -31,12 +31,14 @@ class EndOfTransactionQueriesTest extends KernelTestBase {
* {@inheritdoc}
*/
protected function setUp() {
+ parent::setUp();
+
+ // This can only be checked after installing Drupal as it requires functions
+ // from bootstrap.inc.
if (!class_exists($this->getDatabaseConnectionInfo()['default']['namespace'] . '\Connection')) {
$this->markTestSkipped(sprintf('No logging override exists for the %s database driver. Create it, subclass this test class and override ::getDatabaseConnectionInfo().', $this->getDatabaseConnectionInfo()['default']['driver']));
}
- parent::setUp();
-
$this->installSchema('system', 'sequences');
$this->installEntitySchema('entity_test');
$this->installEntitySchema('user');
diff --git a/web/core/tests/Drupal/KernelTests/Core/File/DirectoryTest.php b/web/core/tests/Drupal/KernelTests/Core/File/DirectoryTest.php
index a0b5af5f..e10520b2 100644
--- a/web/core/tests/Drupal/KernelTests/Core/File/DirectoryTest.php
+++ b/web/core/tests/Drupal/KernelTests/Core/File/DirectoryTest.php
@@ -98,11 +98,11 @@ class DirectoryTest extends FileTestBase {
// Make directory read only.
@$file_system->chmod($directory, 0444);
- $this->assertFalse($file_system->prepareDirectory($directory, 0), 'Error reported for a non-writeable directory.', 'File');
+ $this->assertFalse($file_system->prepareDirectory($directory, 0), 'Error reported for a non-writable directory.', 'File');
// Test directory permission modification.
$this->setSetting('file_chmod_directory', 0777);
- $this->assertTrue($file_system->prepareDirectory($directory, FileSystemInterface::MODIFY_PERMISSIONS), 'No error reported when making directory writeable.', 'File');
+ $this->assertTrue($file_system->prepareDirectory($directory, FileSystemInterface::MODIFY_PERMISSIONS), 'No error reported when making directory writable.', 'File');
}
// Test that the directory has the correct permissions.
diff --git a/web/core/tests/Drupal/KernelTests/Core/File/FileTestBase.php b/web/core/tests/Drupal/KernelTests/Core/File/FileTestBase.php
index 27a78a1e..e17e427c 100644
--- a/web/core/tests/Drupal/KernelTests/Core/File/FileTestBase.php
+++ b/web/core/tests/Drupal/KernelTests/Core/File/FileTestBase.php
@@ -153,6 +153,7 @@ abstract class FileTestBase extends KernelTestBase {
* @param $path
* Optional string with a directory path. If none is provided, a random
* name in the site's files directory will be used.
+ *
* @return
* The path to the directory.
*/
@@ -178,6 +179,7 @@ abstract class FileTestBase extends KernelTestBase {
* @param $scheme
* Optional string indicating the stream scheme to use. Drupal core includes
* public, private, and temporary. The public wrapper is the default.
+ *
* @return
* File URI.
*/
diff --git a/web/core/tests/Drupal/KernelTests/Core/File/NameMungingTest.php b/web/core/tests/Drupal/KernelTests/Core/File/NameMungingTest.php
index 892fa3c6..644375a0 100644
--- a/web/core/tests/Drupal/KernelTests/Core/File/NameMungingTest.php
+++ b/web/core/tests/Drupal/KernelTests/Core/File/NameMungingTest.php
@@ -66,16 +66,16 @@ class NameMungingTest extends FileTestBase {
}
/**
- * White listed extensions are ignored by file_munge_filename().
+ * Tests that allowed extensions are ignored by file_munge_filename().
*/
- public function testMungeIgnoreWhitelisted() {
- // Declare our extension as whitelisted. The declared extensions should
- // be case insensitive so test using one with a different case.
+ public function testMungeIgnoreAllowedExtensions() {
+ // Declare that our extension is allowed. The declared extensions should be
+ // case insensitive, so test using one with a different case.
$munged_name = file_munge_filename($this->nameWithUcExt, $this->badExtension);
- $this->assertSame($munged_name, $this->nameWithUcExt, new FormattableMarkup('The new filename (%munged) matches the original (%original) once the extension has been whitelisted.', ['%munged' => $munged_name, '%original' => $this->nameWithUcExt]));
+ $this->assertSame($munged_name, $this->nameWithUcExt);
// The allowed extensions should also be normalized.
$munged_name = file_munge_filename($this->name, strtoupper($this->badExtension));
- $this->assertSame($munged_name, $this->name, new FormattableMarkup('The new filename (%munged) matches the original (%original) also when the whitelisted extension is in uppercase.', ['%munged' => $munged_name, '%original' => $this->name]));
+ $this->assertSame($munged_name, $this->name);
}
/**
diff --git a/web/core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageExpirableTest.php b/web/core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageExpirableTest.php
index e87abcb8..23d1f00a 100644
--- a/web/core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageExpirableTest.php
+++ b/web/core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageExpirableTest.php
@@ -44,20 +44,20 @@ class DatabaseStorageExpirableTest extends StorageTestBase {
// Verify that an item can be stored with setWithExpire().
// Use a random expiration in each test.
$stores[0]->setWithExpire('foo', $this->objects[0], rand(500, 100000));
- $this->assertIdenticalObject($this->objects[0], $stores[0]->get('foo'));
+ $this->assertEquals($this->objects[0], $stores[0]->get('foo'));
// Verify that the other collection is not affected.
$this->assertNull($stores[1]->get('foo'));
// Verify that an item can be updated with setWithExpire().
$stores[0]->setWithExpire('foo', $this->objects[1], rand(500, 100000));
- $this->assertIdenticalObject($this->objects[1], $stores[0]->get('foo'));
+ $this->assertEquals($this->objects[1], $stores[0]->get('foo'));
// Verify that the other collection is still not affected.
$this->assertNull($stores[1]->get('foo'));
// Verify that the expirable data key is unique.
$stores[1]->setWithExpire('foo', $this->objects[2], rand(500, 100000));
- $this->assertIdenticalObject($this->objects[1], $stores[0]->get('foo'));
- $this->assertIdenticalObject($this->objects[2], $stores[1]->get('foo'));
+ $this->assertEquals($this->objects[1], $stores[0]->get('foo'));
+ $this->assertEquals($this->objects[2], $stores[1]->get('foo'));
// Verify that multiple items can be stored with setMultipleWithExpire().
$values = [
@@ -67,11 +67,11 @@ class DatabaseStorageExpirableTest extends StorageTestBase {
$stores[0]->setMultipleWithExpire($values, rand(500, 100000));
$result = $stores[0]->getMultiple(['foo', 'bar']);
foreach ($values as $j => $value) {
- $this->assertIdenticalObject($value, $result[$j]);
+ $this->assertEquals($value, $result[$j]);
}
// Verify that the other collection was not affected.
- $this->assertIdenticalObject($stores[1]->get('foo'), $this->objects[2]);
+ $this->assertEquals($this->objects[2], $stores[1]->get('foo'));
$this->assertNull($stores[1]->get('bar'));
// Verify that all items in a collection can be retrieved.
@@ -93,7 +93,7 @@ class DatabaseStorageExpirableTest extends StorageTestBase {
$this->assertNull($stores[0]->get('bar'));
$this->assertEmpty($stores[0]->getMultiple(['foo', 'bar']));
// Verify that the item in the other collection still exists.
- $this->assertIdenticalObject($this->objects[5], $stores[1]->get('foo'));
+ $this->assertEquals($this->objects[5], $stores[1]->get('foo'));
// Test that setWithExpireIfNotExists() succeeds only the first time.
$key = $this->randomMachineName();
@@ -101,7 +101,7 @@ class DatabaseStorageExpirableTest extends StorageTestBase {
// setWithExpireIfNotExists() should be TRUE the first time (when $i is
// 0) and FALSE the second time (when $i is 1).
$this->assertEqual(!$i, $stores[0]->setWithExpireIfNotExists($key, $this->objects[$i], rand(500, 100000)));
- $this->assertIdenticalObject($this->objects[0], $stores[0]->get($key));
+ $this->assertEquals($this->objects[0], $stores[0]->get($key));
// Verify that the other collection is not affected.
$this->assertNull($stores[1]->get($key));
}
@@ -110,7 +110,7 @@ class DatabaseStorageExpirableTest extends StorageTestBase {
$stores[0]->delete($key);
$stores[0]->setWithExpireIfNotExists($key, $this->objects[1], rand(500, 100000));
// This time it should succeed.
- $this->assertIdenticalObject($this->objects[1], $stores[0]->get($key));
+ $this->assertEquals($this->objects[1], $stores[0]->get($key));
// Verify that the other collection is still not affected.
$this->assertNull($stores[1]->get($key));
diff --git a/web/core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php b/web/core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php
index c7ba8247..78e6ca83 100644
--- a/web/core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php
+++ b/web/core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php
@@ -54,21 +54,21 @@ abstract class StorageTestBase extends KernelTestBase {
// Verify that an item can be stored.
$stores[0]->set('foo', $this->objects[0]);
$this->assertTrue($stores[0]->has('foo'));
- $this->assertIdenticalObject($this->objects[0], $stores[0]->get('foo'));
+ $this->assertEquals($this->objects[0], $stores[0]->get('foo'));
// Verify that the other collection is not affected.
$this->assertFalse($stores[1]->has('foo'));
$this->assertNull($stores[1]->get('foo'));
// Verify that an item can be updated.
$stores[0]->set('foo', $this->objects[1]);
- $this->assertIdenticalObject($this->objects[1], $stores[0]->get('foo'));
+ $this->assertEquals($this->objects[1], $stores[0]->get('foo'));
// Verify that the other collection is still not affected.
$this->assertNull($stores[1]->get('foo'));
// Verify that a collection/name pair is unique.
$stores[1]->set('foo', $this->objects[2]);
- $this->assertIdenticalObject($this->objects[1], $stores[0]->get('foo'));
- $this->assertIdenticalObject($this->objects[2], $stores[1]->get('foo'));
+ $this->assertEquals($this->objects[1], $stores[0]->get('foo'));
+ $this->assertEquals($this->objects[2], $stores[1]->get('foo'));
// Verify that an item can be deleted.
$stores[0]->delete('foo');
@@ -77,7 +77,7 @@ abstract class StorageTestBase extends KernelTestBase {
// Verify that the other collection is not affected.
$this->assertTrue($stores[1]->has('foo'));
- $this->assertIdenticalObject($this->objects[2], $stores[1]->get('foo'));
+ $this->assertEquals($this->objects[2], $stores[1]->get('foo'));
$stores[1]->delete('foo');
$this->assertNull($stores[1]->get('foo'));
@@ -91,7 +91,7 @@ abstract class StorageTestBase extends KernelTestBase {
// Verify that multiple items can be retrieved.
$result = $stores[0]->getMultiple(['foo', 'bar']);
foreach ($values as $j => $value) {
- $this->assertIdenticalObject($value, $result[$j]);
+ $this->assertEquals($value, $result[$j]);
}
// Verify that the other collection was not affected.
@@ -119,7 +119,7 @@ abstract class StorageTestBase extends KernelTestBase {
// Verify that deleting no items does not cause an error.
$stores[0]->deleteMultiple([]);
// Verify that the item in the other collection still exists.
- $this->assertIdenticalObject($this->objects[5], $stores[1]->get('foo'));
+ $this->assertEquals($this->objects[5], $stores[1]->get('foo'));
}
@@ -163,7 +163,7 @@ abstract class StorageTestBase extends KernelTestBase {
// setIfNotExists() should be TRUE the first time (when $i is 0) and
// FALSE the second time (when $i is 1).
$this->assertEqual(!$i, $stores[0]->setIfNotExists($key, $this->objects[$i]));
- $this->assertIdenticalObject($this->objects[0], $stores[0]->get($key));
+ $this->assertEquals($this->objects[0], $stores[0]->get($key));
// Verify that the other collection is not affected.
$this->assertNull($stores[1]->get($key));
}
@@ -172,7 +172,7 @@ abstract class StorageTestBase extends KernelTestBase {
$stores[0]->delete($key);
$stores[0]->setIfNotExists($key, $this->objects[1]);
// This time it should succeed.
- $this->assertIdenticalObject($this->objects[1], $stores[0]->get($key));
+ $this->assertEquals($this->objects[1], $stores[0]->get($key));
// Verify that the other collection is still not affected.
$this->assertNull($stores[1]->get($key));
}
diff --git a/web/core/tests/Drupal/KernelTests/Core/Routing/ExceptionHandlingTest.php b/web/core/tests/Drupal/KernelTests/Core/Routing/ExceptionHandlingTest.php
index 0b955fd1..d13829b8 100644
--- a/web/core/tests/Drupal/KernelTests/Core/Routing/ExceptionHandlingTest.php
+++ b/web/core/tests/Drupal/KernelTests/Core/Routing/ExceptionHandlingTest.php
@@ -128,6 +128,7 @@ class ExceptionHandlingTest extends KernelTestBase {
* Sets the given path to use as the 404 page and triggers a 404.
*
* @param string $path
+ *
* @return \Drupal\Core\Render\HtmlResponse
*
* @see \Drupal\system\Tests\Routing\ExceptionHandlingTest::testExceptionResponseGeneratedForOriginalRequest()
diff --git a/web/core/tests/Drupal/KernelTests/Core/TempStore/TempStoreDatabaseTest.php b/web/core/tests/Drupal/KernelTests/Core/TempStore/TempStoreDatabaseTest.php
index b4c8a400..da24101d 100644
--- a/web/core/tests/Drupal/KernelTests/Core/TempStore/TempStoreDatabaseTest.php
+++ b/web/core/tests/Drupal/KernelTests/Core/TempStore/TempStoreDatabaseTest.php
@@ -87,24 +87,24 @@ class TempStoreDatabaseTest extends KernelTestBase {
$this->assertEqual(!$i, $stores[0]->setIfNotExists($key, $this->objects[$i]));
$metadata = $stores[0]->getMetadata($key);
$this->assertEqual($users[0], $metadata->getOwnerId());
- $this->assertIdenticalObject($this->objects[0], $stores[0]->get($key));
+ $this->assertEquals($this->objects[0], $stores[0]->get($key));
// Another user should get the same result.
$metadata = $stores[1]->getMetadata($key);
$this->assertEqual($users[0], $metadata->getOwnerId());
- $this->assertIdenticalObject($this->objects[0], $stores[1]->get($key));
+ $this->assertEquals($this->objects[0], $stores[1]->get($key));
}
// Remove the item and try to set it again.
$stores[0]->delete($key);
$stores[0]->setIfNotExists($key, $this->objects[1]);
// This time it should succeed.
- $this->assertIdenticalObject($this->objects[1], $stores[0]->get($key));
+ $this->assertEquals($this->objects[1], $stores[0]->get($key));
// This user can update the object.
$stores[0]->set($key, $this->objects[2]);
- $this->assertIdenticalObject($this->objects[2], $stores[0]->get($key));
+ $this->assertEquals($this->objects[2], $stores[0]->get($key));
// The object is the same when another user loads it.
- $this->assertIdenticalObject($this->objects[2], $stores[1]->get($key));
+ $this->assertEquals($this->objects[2], $stores[1]->get($key));
// This user should be allowed to get, update, delete.
$this->assertInstanceOf(\stdClass::class, $stores[0]->getIfOwner($key));
@@ -113,8 +113,8 @@ class TempStoreDatabaseTest extends KernelTestBase {
// Another user can update the object and become the owner.
$stores[1]->set($key, $this->objects[3]);
- $this->assertIdenticalObject($this->objects[3], $stores[0]->get($key));
- $this->assertIdenticalObject($this->objects[3], $stores[1]->get($key));
+ $this->assertEquals($this->objects[3], $stores[0]->get($key));
+ $this->assertEquals($this->objects[3], $stores[1]->get($key));
$metadata = $stores[1]->getMetadata($key);
$this->assertEqual($users[1], $metadata->getOwnerId());
diff --git a/web/core/tests/Drupal/KernelTests/FileSystemModuleDiscoveryDataProviderTrait.php b/web/core/tests/Drupal/KernelTests/FileSystemModuleDiscoveryDataProviderTrait.php
index 02d63841..c955289f 100644
--- a/web/core/tests/Drupal/KernelTests/FileSystemModuleDiscoveryDataProviderTrait.php
+++ b/web/core/tests/Drupal/KernelTests/FileSystemModuleDiscoveryDataProviderTrait.php
@@ -14,9 +14,10 @@ trait FileSystemModuleDiscoveryDataProviderTrait {
* An array of module names to test.
*/
public function coreModuleListDataProvider() {
- $module_dirs = array_keys(iterator_to_array(new \FilesystemIterator(__DIR__ . '/../../../modules/')));
- $module_names = array_map(function ($path) {
- return str_replace(__DIR__ . '/../../../modules/', '', $path);
+ $prefix = dirname(__DIR__, 3) . DIRECTORY_SEPARATOR . 'modules';
+ $module_dirs = array_keys(iterator_to_array(new \FilesystemIterator($prefix)));
+ $module_names = array_map(function ($path) use ($prefix) {
+ return str_replace($prefix . DIRECTORY_SEPARATOR, '', $path);
}, $module_dirs);
$modules_keyed = array_combine($module_names, $module_names);
diff --git a/web/core/tests/Drupal/Tests/Component/Annotation/PluginTest.php b/web/core/tests/Drupal/Tests/Component/Annotation/PluginTest.php
index d9427640..554ed8db 100644
--- a/web/core/tests/Drupal/Tests/Component/Annotation/PluginTest.php
+++ b/web/core/tests/Drupal/Tests/Component/Annotation/PluginTest.php
@@ -20,6 +20,7 @@ class PluginTest extends TestCase {
// Assert all values are accepted through constructor and default value is
// used for non existent but defined property.
$plugin = new PluginStub([
+ 1 => 'oak',
'foo' => 'bar',
'biz' => [
'baz' => 'boom',
@@ -32,6 +33,7 @@ class PluginTest extends TestCase {
// This property wasn't in our definition but is defined as a property on
// our plugin class.
'defaultProperty' => 'testvalue',
+ 1 => 'oak',
'foo' => 'bar',
'biz' => [
'baz' => 'boom',
diff --git a/web/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldUpgradeTest.php b/web/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldUpgradeTest.php
index b5af25fc..f21cf5bf 100644
--- a/web/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldUpgradeTest.php
+++ b/web/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldUpgradeTest.php
@@ -103,6 +103,7 @@ class ScaffoldUpgradeTest extends TestCase {
* Path to location to create git repository.
* @param string $version
* Version to tag the repository with.
+ *
* @return string
* Path to temporary git repository.
*/
diff --git a/web/core/tests/Drupal/Tests/ComposerIntegrationTest.php b/web/core/tests/Drupal/Tests/ComposerIntegrationTest.php
index 89294f3a..5c33b4e0 100644
--- a/web/core/tests/Drupal/Tests/ComposerIntegrationTest.php
+++ b/web/core/tests/Drupal/Tests/ComposerIntegrationTest.php
@@ -20,6 +20,19 @@ class ComposerIntegrationTest extends UnitTestCase {
$content_hash = self::getContentHash(file_get_contents($this->root . '/composer.json'));
$lock = json_decode(file_get_contents($this->root . '/composer.lock'), TRUE);
$this->assertSame($content_hash, $lock['content-hash']);
+
+ // @see \Composer\Repository\PathRepository::initialize()
+ $core_lock_file_hash = '';
+ $options = [];
+ foreach ($lock['packages'] as $package) {
+ if ($package['name'] === 'drupal/core') {
+ $core_lock_file_hash = $package['dist']['reference'];
+ $options = $package['transport-options'] ?? [];
+ break;
+ }
+ }
+ $core_content_hash = sha1(file_get_contents($this->root . '/core/composer.json') . serialize($options));
+ $this->assertSame($core_content_hash, $core_lock_file_hash);
}
/**
diff --git a/web/core/tests/Drupal/Tests/Core/Batch/BatchBuilderTest.php b/web/core/tests/Drupal/Tests/Core/Batch/BatchBuilderTest.php
index 4e273b29..e0ac9089 100644
--- a/web/core/tests/Drupal/Tests/Core/Batch/BatchBuilderTest.php
+++ b/web/core/tests/Drupal/Tests/Core/Batch/BatchBuilderTest.php
@@ -113,11 +113,20 @@ class BatchBuilderTest extends UnitTestCase {
* @covers ::setFile
*/
public function testSetFile() {
- $batch = (new BatchBuilder())
- ->setFile('filename.php')
- ->toArray();
+ $filename = dirname(__DIR__, 6) . '/core/modules/system/tests/modules/batch_test/batch_test.callbacks.inc';
+ $this->assertIsNotCallable('_batch_test_callback_1');
+ $this->assertIsNotCallable('_batch_test_finished_1');
- $this->assertEquals('filename.php', $batch['file']);
+ $batch = (new BatchBuilder())
+ ->setFile($filename)
+ ->setFinishCallback('_batch_test_finished_1')
+ ->addOperation('_batch_test_callback_1', [])
+ ->toArray();
+ $this->assertEquals($filename, $batch['file']);
+ $this->assertEquals([['_batch_test_callback_1', []]], $batch['operations']);
+ $this->assertEquals('_batch_test_finished_1', $batch['finished']);
+ $this->assertIsCallable('_batch_test_callback_1');
+ $this->assertIsCallable('_batch_test_finished_1');
}
/**
diff --git a/web/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php b/web/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php
index a77ad091..fa4cde64 100644
--- a/web/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php
+++ b/web/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php
@@ -97,6 +97,7 @@ class BackendCompilerPassTest extends UnitTestCase {
* bag so the setParameter() call effects the parent container as well.
*
* @param $service
+ *
* @return \Symfony\Component\DependencyInjection\ContainerBuilder
*/
protected function getSqliteContainer($service) {
@@ -115,6 +116,7 @@ class BackendCompilerPassTest extends UnitTestCase {
* bag so the setParameter() call effects the parent container as well.
*
* @param $service
+ *
* @return \Symfony\Component\DependencyInjection\ContainerBuilder
*/
protected function getMysqlContainer($service) {
diff --git a/web/core/tests/Drupal/Tests/Core/Entity/EntityAccessCheckTest.php b/web/core/tests/Drupal/Tests/Core/Entity/EntityAccessCheckTest.php
index daa9dcb5..4ac74d78 100644
--- a/web/core/tests/Drupal/Tests/Core/Entity/EntityAccessCheckTest.php
+++ b/web/core/tests/Drupal/Tests/Core/Entity/EntityAccessCheckTest.php
@@ -112,6 +112,7 @@ class EntityAccessCheckTest extends UnitTestCase {
*
* @param object $object
* Any object, including prophesized mocks based on interfaces.
+ *
* @return \Drupal\Core\Routing\RouteMatchInterface
* A prophesized RouteMatchInterface.
*/
diff --git a/web/core/tests/Drupal/Tests/Core/EventSubscriber/RssResponseRelativeUrlFilterTest.php b/web/core/tests/Drupal/Tests/Core/EventSubscriber/RssResponseRelativeUrlFilterTest.php
index e9c9549f..3a1f5f2e 100644
--- a/web/core/tests/Drupal/Tests/Core/EventSubscriber/RssResponseRelativeUrlFilterTest.php
+++ b/web/core/tests/Drupal/Tests/Core/EventSubscriber/RssResponseRelativeUrlFilterTest.php
@@ -25,7 +25,7 @@ class RssResponseRelativeUrlFilterTest extends UnitTestCase {
Drupal.org
https://www.drupal.org
Come for the software, stay for the community
-D rupal is an open source content management platform powering millions of websites and applications. It’s built, used, and supported by an active and diverse community of people around the world.
+Drupal is an open source content management platform powering millions of websites and applications. It’s built, used, and supported by an active and diverse community of people around the world.
enDrupal 8 turns one!
@@ -44,7 +44,7 @@ RSS;
Drupal.org
https://www.drupal.org
Come for the software, stay for the community
-D rupal is an open source content management platform powering millions of websites and applications. It’s built, used, and supported by an active and diverse community of people around the world.
+Drupal is an open source content management platform powering millions of websites and applications. It’s built, used, and supported by an active and diverse community of people around the world.
enDrupal 8 turns one!
@@ -66,7 +66,7 @@ RSS;
Drupal.org
https://www.drupal.org
Come for the software, stay for the community
-D rupal is an open source content management platform powering millions of websites and applications. It’s built, used, and supported by an active and diverse community of people around the world.
+Drupal is an open source content management platform powering millions of websites and applications. It’s built, used, and supported by an active and diverse community of people around the world.
enDrupal 8 turns one!
diff --git a/web/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php b/web/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php
index f9bc6aee..d2b49036 100644
--- a/web/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php
+++ b/web/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php
@@ -832,12 +832,30 @@ class FormBuilderTest extends FormTestBase {
$expected_form = $form_id();
$form_arg = $this->getMockForm($form_id, $expected_form);
+ // Set up some request data so we can be sure it is removed when a token is
+ // invalid.
+ $this->request->request->set('foo', 'bar');
+ $_POST['foo'] = 'bar';
+
$form_state = new FormState();
$input['form_id'] = $form_id;
$input['form_token'] = $form_token;
+ $input['test'] = 'example-value';
$form_state->setUserInput($input);
- $this->simulateFormSubmission($form_id, $form_arg, $form_state, FALSE);
+ $form = $this->simulateFormSubmission($form_id, $form_arg, $form_state, FALSE);
$this->assertSame($expected, $form_state->hasInvalidToken());
+ if ($expected) {
+ $this->assertEmpty($form['test']['#value']);
+ $this->assertEmpty($form_state->getValue('test'));
+ $this->assertEmpty($_POST);
+ $this->assertEmpty(iterator_to_array($this->request->request->getIterator()));
+ }
+ else {
+ $this->assertEquals('example-value', $form['test']['#value']);
+ $this->assertEquals('example-value', $form_state->getValue('test'));
+ $this->assertEquals('bar', $_POST['foo']);
+ $this->assertEquals('bar', $this->request->request->get('foo'));
+ }
}
public function providerTestInvalidToken() {
diff --git a/web/core/tests/Drupal/Tests/Core/Form/FormTestBase.php b/web/core/tests/Drupal/Tests/Core/Form/FormTestBase.php
index f0cb2f22..b01f1542 100644
--- a/web/core/tests/Drupal/Tests/Core/Form/FormTestBase.php
+++ b/web/core/tests/Drupal/Tests/Core/Form/FormTestBase.php
@@ -173,7 +173,7 @@ abstract class FormTestBase extends UnitTestCase {
->getMock();
$this->account = $this->createMock('Drupal\Core\Session\AccountInterface');
$this->themeManager = $this->createMock('Drupal\Core\Theme\ThemeManagerInterface');
- $this->request = new Request();
+ $this->request = Request::createFromGlobals();
$this->eventDispatcher = $this->createMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
$this->requestStack = new RequestStack();
$this->requestStack->push($this->request);
diff --git a/web/core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php b/web/core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php
index bf31b475..02d98113 100644
--- a/web/core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php
+++ b/web/core/tests/Drupal/Tests/Core/Form/FormValidatorTest.php
@@ -131,7 +131,7 @@ class FormValidatorTest extends UnitTestCase {
->getMock();
$form_state->expects($this->once())
->method('setErrorByName')
- ->with('form_token', 'The form has become outdated. Copy any unsaved work in the form below and then reload this page.');
+ ->with('form_token', 'The form has become outdated. Press the back button, copy any unsaved work in the form, and then reload the page.');
$form_state->setValue('form_token', 'some_random_token');
$form_validator->validateForm('test_form_id', $form, $form_state);
$this->assertTrue($form_state->isValidationComplete());
diff --git a/web/core/tests/Drupal/Tests/Core/Plugin/Discovery/TestDerivativeDiscoveryWithObject.php b/web/core/tests/Drupal/Tests/Core/Plugin/Discovery/TestDerivativeDiscoveryWithObject.php
index 353b21d4..1bb64cc5 100644
--- a/web/core/tests/Drupal/Tests/Core/Plugin/Discovery/TestDerivativeDiscoveryWithObject.php
+++ b/web/core/tests/Drupal/Tests/Core/Plugin/Discovery/TestDerivativeDiscoveryWithObject.php
@@ -13,6 +13,7 @@ class TestDerivativeDiscoveryWithObject implements DeriverInterface {
* {@inheritdoc}
* @param string $derivative_id
* @param array $base_plugin_definition
+ *
* @return array
*/
public function getDerivativeDefinition($derivative_id, $base_plugin_definition) {
@@ -23,6 +24,7 @@ class TestDerivativeDiscoveryWithObject implements DeriverInterface {
/**
* {@inheritdoc}
* @param array $base_plugin_definition
+ *
* @return array
*/
public function getDerivativeDefinitions($base_plugin_definition) {
diff --git a/web/core/tests/Drupal/Tests/Core/Routing/RouteMatchTestBase.php b/web/core/tests/Drupal/Tests/Core/Routing/RouteMatchTestBase.php
index a47ec732..6f9848a7 100644
--- a/web/core/tests/Drupal/Tests/Core/Routing/RouteMatchTestBase.php
+++ b/web/core/tests/Drupal/Tests/Core/Routing/RouteMatchTestBase.php
@@ -22,6 +22,7 @@ abstract class RouteMatchTestBase extends UnitTestCase {
* Parameters array
* @param $raw_parameters
* Raw parameters array
+ *
* @return \Drupal\Core\Routing\RouteMatchInterface
*/
abstract protected function getRouteMatch($name, Route $route, array $parameters, array $raw_parameters);
diff --git a/web/core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php b/web/core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php
index f0511e0c..3da4c012 100644
--- a/web/core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php
+++ b/web/core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php
@@ -99,6 +99,7 @@ class UnroutedUrlAssemblerTest extends UnitTestCase {
'override-query' => ['https://example.com/test?foo=1#bar', ['query' => ['foo' => 2]], 'https://example.com/test?foo=2#bar'],
'override-query-merge' => ['https://example.com/test?foo=1#bar', ['query' => ['bar' => 2]], 'https://example.com/test?foo=1&bar=2#bar'],
'override-deep-query-merge' => ['https://example.com/test?foo=1#bar', ['query' => ['bar' => ['baz' => 'foo']]], 'https://example.com/test?foo=1&bar%5Bbaz%5D=foo#bar'],
+ 'override-deep-query-merge-int-ket' => ['https://example.com/test?120=1', ['query' => ['bar' => ['baz' => 'foo']]], 'https://example.com/test?120=1&bar%5Bbaz%5D=foo'],
'override-fragment' => ['https://example.com/test?foo=1#bar', ['fragment' => 'baz'], 'https://example.com/test?foo=1#baz'],
['//www.drupal.org', [], '//www.drupal.org'],
];
diff --git a/web/core/tests/Drupal/Tests/EntityViewTrait.php b/web/core/tests/Drupal/Tests/EntityViewTrait.php
index 155d2b6f..41581a5f 100644
--- a/web/core/tests/Drupal/Tests/EntityViewTrait.php
+++ b/web/core/tests/Drupal/Tests/EntityViewTrait.php
@@ -30,6 +30,7 @@ trait EntityViewTrait {
* the current content language.
* @param bool $reset
* (optional) Whether to clear the cache for this entity.
+ *
* @return array
*
* @see \Drupal\Core\Render\RendererInterface::render()
diff --git a/web/core/tests/bootstrap.php b/web/core/tests/bootstrap.php
index 6d27ec01..a77a9911 100644
--- a/web/core/tests/bootstrap.php
+++ b/web/core/tests/bootstrap.php
@@ -25,6 +25,7 @@ use PHPUnit\Util\Xml;
*
* @param string $scan_directory
* The directory that should be recursively scanned.
+ *
* @return array
* An associative array of extension directories found within the scanned
* directory, keyed by extension name.
diff --git a/web/core/themes/claro/css/components/form.css b/web/core/themes/claro/css/components/form.css
index ca6f8f30..78dc419d 100644
--- a/web/core/themes/claro/css/components/form.css
+++ b/web/core/themes/claro/css/components/form.css
@@ -185,6 +185,19 @@ tr .form-item,
color: #82828c;
}
+/* Add some spacing so that the focus ring and suffix don't overlap. */
+
+@media screen and (min-width: 601px) {
+ .form-item__suffix {
+ margin-left: 0.5rem; /* LTR */
+ }
+
+ [dir="rtl"] .form-item__suffix {
+ margin-right: 0.5rem;
+ margin-left: 0;
+ }
+}
+
/**
* Form actions.
*/
diff --git a/web/core/themes/claro/css/components/form.pcss.css b/web/core/themes/claro/css/components/form.pcss.css
index a39ea942..554df9c9 100644
--- a/web/core/themes/claro/css/components/form.pcss.css
+++ b/web/core/themes/claro/css/components/form.pcss.css
@@ -114,6 +114,18 @@ tr .form-item,
color: var(--input--disabled-fg-color);
}
+/* Add some spacing so that the focus ring and suffix don't overlap. */
+@media screen and (min-width: 601px) {
+ .form-item__suffix {
+ margin-left: var(--space-xs); /* LTR */
+ }
+
+ [dir="rtl"] .form-item__suffix {
+ margin-right: var(--space-xs);
+ margin-left: 0;
+ }
+}
+
/**
* Form actions.
*/
diff --git a/web/themes/contrib/mediteran/css/components/dialog.css b/web/themes/contrib/mediteran/css/components/dialog.css
index 9d8a16f0..deda402e 100644
--- a/web/themes/contrib/mediteran/css/components/dialog.css
+++ b/web/themes/contrib/mediteran/css/components/dialog.css
@@ -155,7 +155,6 @@
/* Form action buttons are moved in dialogs. Remove empty space. */
.ui-dialog .ui-dialog-content .form-actions {
- padding: 0;
margin: 0;
}
diff --git a/web/themes/contrib/mediteran/css/components/form.css b/web/themes/contrib/mediteran/css/components/form.css
index 9ca4ae95..eff36e16 100644
--- a/web/themes/contrib/mediteran/css/components/form.css
+++ b/web/themes/contrib/mediteran/css/components/form.css
@@ -127,7 +127,8 @@ label[for] {
}
table .form-actions {
- margin-top: 0;
+ background: transparent;
+ border-top: 0;
}
@media screen and (min-width: 640px) {
diff --git a/web/themes/contrib/mediteran/css/theme/gutenberg.css b/web/themes/contrib/mediteran/css/theme/gutenberg.css
index 3eae349e..bf91752e 100644
--- a/web/themes/contrib/mediteran/css/theme/gutenberg.css
+++ b/web/themes/contrib/mediteran/css/theme/gutenberg.css
@@ -15,6 +15,12 @@
width: 100%;
}
+@media screen and (min-width: 782px) {
+.gutenberg__editor .edit-post-layout.is-sidebar-opened .edit-post-sidebar {
+ min-width: 350px;
+ }
+}
+
.components-panel__header.edit-post-sidebar__panel-tabs li {
flex: 1;
}
@@ -81,6 +87,13 @@
padding-left: 0 !important;
}
+.gutenberg__editor .edit-post-layout .edit-post-sidebar .form-type-radio .form-radio {
+ margin-left: 0;
+ margin-right: 0;
+ width: 20px;
+ height: 20px;
+}
+
@media screen and (min-width: 782px) {
body .gutenberg__editor .edit-post-layout .edit-post-header {
@@ -116,7 +129,7 @@
}
.toolbar-horizontal.toolbar-tray-open .interface-interface-skeleton {
- top: 120px;
+ top: 102px;
}
.edit-post-layout__metaboxes {
diff --git a/web/themes/contrib/mediteran/css/theme/webform.css b/web/themes/contrib/mediteran/css/theme/webform.css
index 959d7193..52d934ab 100644
--- a/web/themes/contrib/mediteran/css/theme/webform.css
+++ b/web/themes/contrib/mediteran/css/theme/webform.css
@@ -10,6 +10,23 @@
margin-left: 10px;
}
+.form--inline.webform-ui-element-form-inline--input .form-item {
+ min-width: 150px;
+ flex-basis: 45%;
+}
+
+.form--inline.webform-ui-element-form-inline--input .form-item select {
+ min-width: 150px;
+}
+
+.webform-ui-element-form .form-actions {
+ position: relative;
+}
+
+.webform-ui-element-form .form-actions input {
+ margin-top: 10px;
+}
+
.webform-contribute-community-info {
display: inline-block;
border-radius: 0;
@@ -38,6 +55,7 @@
.form--inline.webform-ui-element-form-inline--input .form-item input[type="text"],
.form--inline.webform-ui-element-form-inline--input .form-item input[type="number"] {
width: 100%;
+ min-width: 170px !important;
}
.button-webform-play {
@@ -66,7 +84,7 @@ html.js .webform-message--close .webform-message__link {
html.js .webform-message--close .messages.messages--promotion_drupal_association .webform-message__link {
top: 22px;
- right: 24px;
+ right: 24px;
}
.webform-multiple-table td.webform-multiple-table--operations {
@@ -139,7 +157,7 @@ td.webform-results-table__icon {
}
.button.button-webform-play:before {
- content: '► ';
+ content: '► ';
}
.ui-dialog-content .webform-ajax-link {
diff --git a/web/themes/contrib/mediteran/css/toolbar/toolbar.icons.theme.css b/web/themes/contrib/mediteran/css/toolbar/toolbar.icons.theme.css
index f1db04b1..baa6c7a9 100644
--- a/web/themes/contrib/mediteran/css/toolbar/toolbar.icons.theme.css
+++ b/web/themes/contrib/mediteran/css/toolbar/toolbar.icons.theme.css
@@ -73,6 +73,7 @@
}
.toolbar .toolbar-tray-vertical .toolbar-menu a.toolbar-icon {
padding-left: 50px;
+ position: relative;
}
.toolbar .toolbar-tray-vertical .toolbar-menu ul .level-2 a {
padding-left: 50px; /* LTR */
@@ -244,7 +245,7 @@
*/
.toolbar-fixed .toolbar .toolbar-toggle-orientation button {
- height: 60px;
+ height: 44px;
padding: 0;
font-size: 0;
}
diff --git a/web/themes/contrib/mediteran/css/toolbar/toolbar.theme.css b/web/themes/contrib/mediteran/css/toolbar/toolbar.theme.css
index ee6ac14b..d42b5154 100644
--- a/web/themes/contrib/mediteran/css/toolbar/toolbar.theme.css
+++ b/web/themes/contrib/mediteran/css/toolbar/toolbar.theme.css
@@ -81,12 +81,12 @@
@media only screen and (min-width: 1280px) {
.toolbar-tray a {
- padding: 20px 24px;
+ padding: 12px 24px;
}
}
.toolbar-tray-vertical.toolbar-tray a {
- padding: 20px 24px;
+ padding: 12px 24px;
}
.toolbar-tray a:hover,
diff --git a/web/themes/contrib/mediteran/mediteran.info.yml b/web/themes/contrib/mediteran/mediteran.info.yml
index 3d01b194..9747c11a 100644
--- a/web/themes/contrib/mediteran/mediteran.info.yml
+++ b/web/themes/contrib/mediteran/mediteran.info.yml
@@ -323,7 +323,7 @@ regions:
icon: images/mediteran.svg
screenshot: images/mediteran.png
-# Information added by Drupal.org packaging script on 2020-05-28
-version: '8.x-1.10'
+# Information added by Drupal.org packaging script on 2020-07-12
+version: '8.x-1.11'
project: 'mediteran'
-datestamp: 1590662210
+datestamp: 1594537824
diff --git a/web/themes/custom/popsu_colloque/popsu_colloque.info.yml b/web/themes/custom/popsu_colloque/popsu_colloque.info.yml
index c4776964..56d1952f 100644
--- a/web/themes/custom/popsu_colloque/popsu_colloque.info.yml
+++ b/web/themes/custom/popsu_colloque/popsu_colloque.info.yml
@@ -8,3 +8,12 @@ base theme: false
libraries:
- popsu_colloque/global-styling
- popsu_colloque/global-scripts
+
+regions:
+ header: Header
+ primary_menu: 'Primary menu'
+ highlighted: Highlighted
+ content: Content
+ sidebar_first: 'Sidebar first'
+ sidebar_second: 'Sidebar second'
+ footer: 'Footer'
diff --git a/web/themes/custom/popsu_colloque/template/regions/region--header.html.twig b/web/themes/custom/popsu_colloque/template/regions/region--header.html.twig
new file mode 100644
index 00000000..219e14b0
--- /dev/null
+++ b/web/themes/custom/popsu_colloque/template/regions/region--header.html.twig
@@ -0,0 +1,21 @@
+{#
+/**
+ * @file
+ * Default theme implementation to display a region.
+ *
+ * Available variables:
+ * - content: The content for this region, typically blocks.
+ * - attributes: HTML attributes for the region
.
+ * - region: The name of the region variable as defined in the theme's
+ * .info.yml file.
+ *
+ * @see template_preprocess_region()
+ *
+ * @ingroup themeable
+ */
+#}
+{% if content %}
+
+ {{ content }}
+
+{% endif %}
diff --git a/web/themes/custom/popsu_colloque/template/regions/region.html.twig b/web/themes/custom/popsu_colloque/template/regions/region.html.twig
new file mode 100644
index 00000000..219e14b0
--- /dev/null
+++ b/web/themes/custom/popsu_colloque/template/regions/region.html.twig
@@ -0,0 +1,21 @@
+{#
+/**
+ * @file
+ * Default theme implementation to display a region.
+ *
+ * Available variables:
+ * - content: The content for this region, typically blocks.
+ * - attributes: HTML attributes for the region
.
+ * - region: The name of the region variable as defined in the theme's
+ * .info.yml file.
+ *
+ * @see template_preprocess_region()
+ *
+ * @ingroup themeable
+ */
+#}
+{% if content %}
+