diff --git a/composer.lock b/composer.lock index 8652304fba4c8b01846aaec09cc3187ae52734be..dc2a6bdb8d9689a8fafa9e865199093bf43fc255 100644 --- a/composer.lock +++ b/composer.lock @@ -2958,16 +2958,16 @@ }, { "name": "drupal/core", - "version": "9.3.0", + "version": "9.3.2", "source": { "type": "git", "url": "https://github.com/drupal/core.git", - "reference": "1e1bf0e841e11029b21775dd125332d7ffd6fb47" + "reference": "6c9ba6b6314550e7efb8f5f4e2a40f54cfd6aee1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drupal/core/zipball/1e1bf0e841e11029b21775dd125332d7ffd6fb47", - "reference": "1e1bf0e841e11029b21775dd125332d7ffd6fb47", + "url": "https://api.github.com/repos/drupal/core/zipball/6c9ba6b6314550e7efb8f5f4e2a40f54cfd6aee1", + "reference": "6c9ba6b6314550e7efb8f5f4e2a40f54cfd6aee1", "shasum": "" }, "require": { @@ -3209,9 +3209,9 @@ ], "description": "Drupal is an open source content management platform powering millions of websites and applications.", "support": { - "source": "https://github.com/drupal/core/tree/9.3.0" + "source": "https://github.com/drupal/core/tree/9.3.2" }, - "time": "2021-12-08T22:09:38+00:00" + "time": "2022-01-05T02:55:30+00:00" }, { "name": "drupal/core-composer-scaffold", @@ -3265,16 +3265,16 @@ }, { "name": "drupal/core-recommended", - "version": "9.3.0", + "version": "9.3.2", "source": { "type": "git", "url": "https://github.com/drupal/core-recommended.git", - "reference": "d65aaa36a8cab54332787a20676f81928f675bb3" + "reference": "9f570d6bf6e568b8c2deab02349a11fad3d1e272" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drupal/core-recommended/zipball/d65aaa36a8cab54332787a20676f81928f675bb3", - "reference": "d65aaa36a8cab54332787a20676f81928f675bb3", + "url": "https://api.github.com/repos/drupal/core-recommended/zipball/9f570d6bf6e568b8c2deab02349a11fad3d1e272", + "reference": "9f570d6bf6e568b8c2deab02349a11fad3d1e272", "shasum": "" }, "require": { @@ -3283,7 +3283,7 @@ "doctrine/annotations": "1.13.2", "doctrine/lexer": "1.2.1", "doctrine/reflection": "1.2.2", - "drupal/core": "9.3.0", + "drupal/core": "9.3.2", "egulias/email-validator": "3.1.2", "guzzlehttp/guzzle": "6.5.5", "guzzlehttp/promises": "1.5.1", @@ -3345,9 +3345,9 @@ ], "description": "Locked core dependencies; require this project INSTEAD OF drupal/core.", "support": { - "source": "https://github.com/drupal/core-recommended/tree/9.3.0" + "source": "https://github.com/drupal/core-recommended/tree/9.3.2" }, - "time": "2021-12-08T22:09:38+00:00" + "time": "2022-01-05T02:55:30+00:00" }, { "name": "drupal/crop", @@ -12870,16 +12870,16 @@ }, { "name": "symfony/dom-crawler", - "version": "v4.4.30", + "version": "v4.4.36", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "4632ae3567746c7e915c33c67a2fb6ab746090c4" + "reference": "42de12bee3b5e594977209bcdf58ec4fef8dde39" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/4632ae3567746c7e915c33c67a2fb6ab746090c4", - "reference": "4632ae3567746c7e915c33c67a2fb6ab746090c4", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/42de12bee3b5e594977209bcdf58ec4fef8dde39", + "reference": "42de12bee3b5e594977209bcdf58ec4fef8dde39", "shasum": "" }, "require": { @@ -12924,7 +12924,7 @@ "description": "Eases DOM navigation for HTML and XML documents", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dom-crawler/tree/v4.4.30" + "source": "https://github.com/symfony/dom-crawler/tree/v4.4.36" }, "funding": [ { @@ -12940,7 +12940,7 @@ "type": "tidelift" } ], - "time": "2021-08-28T15:40:01+00:00" + "time": "2021-12-28T14:48:02+00:00" }, { "name": "symfony/error-handler", @@ -13237,16 +13237,16 @@ }, { "name": "symfony/finder", - "version": "v4.4.30", + "version": "v4.4.36", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "70362f1e112280d75b30087c7598b837c1b468b6" + "reference": "1fef05633cd61b629e963e5d8200fb6b67ecf42c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/70362f1e112280d75b30087c7598b837c1b468b6", - "reference": "70362f1e112280d75b30087c7598b837c1b468b6", + "url": "https://api.github.com/repos/symfony/finder/zipball/1fef05633cd61b629e963e5d8200fb6b67ecf42c", + "reference": "1fef05633cd61b629e963e5d8200fb6b67ecf42c", "shasum": "" }, "require": { @@ -13279,7 +13279,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v4.4.30" + "source": "https://github.com/symfony/finder/tree/v4.4.36" }, "funding": [ { @@ -13295,7 +13295,7 @@ "type": "tidelift" } ], - "time": "2021-08-04T20:31:23+00:00" + "time": "2021-12-15T10:33:10+00:00" }, { "name": "symfony/http-client-contracts", @@ -14042,7 +14042,7 @@ }, { "name": "symfony/polyfill-php72", - "version": "v1.23.0", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", @@ -14098,7 +14098,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.24.0" }, "funding": [ { @@ -14118,16 +14118,16 @@ }, { "name": "symfony/polyfill-php73", - "version": "v1.23.0", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", "shasum": "" }, "require": { @@ -14177,7 +14177,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.24.0" }, "funding": [ { @@ -14193,7 +14193,7 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2021-06-05T21:20:04+00:00" }, { "name": "symfony/polyfill-php80", @@ -14280,16 +14280,16 @@ }, { "name": "symfony/polyfill-php81", - "version": "v1.23.0", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "e66119f3de95efc359483f810c4c3e6436279436" + "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/e66119f3de95efc359483f810c4c3e6436279436", - "reference": "e66119f3de95efc359483f810c4c3e6436279436", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", + "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", "shasum": "" }, "require": { @@ -14339,7 +14339,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.24.0" }, "funding": [ { @@ -14355,7 +14355,7 @@ "type": "tidelift" } ], - "time": "2021-05-21T13:25:03+00:00" + "time": "2021-09-13T13:58:11+00:00" }, { "name": "symfony/process", diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php index 052f4f9196132f3db91c661e014bc2414829ef56..e2aa5e6eaf58011f5b5642d1c1fb0695cb31dbb7 100644 --- a/vendor/composer/autoload_files.php +++ b/vendor/composer/autoload_files.php @@ -7,19 +7,18 @@ return array( 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', - '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', + '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', + '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php', + '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', + '23c18046f52bef3eea034657bafda50f' => $vendorDir . '/symfony/polyfill-php81/bootstrap.php', 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php', 'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php', - '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', - '23c18046f52bef3eea034657bafda50f' => $vendorDir . '/symfony/polyfill-php81/bootstrap.php', - '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php', '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', - 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', + 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', - 'def43f6c87e4f8dfd0c9e1b1bab14fe8' => $vendorDir . '/symfony/polyfill-iconv/bootstrap.php', '07d7f1a47144818725fd8d91a907ac57' => $vendorDir . '/laminas/laminas-diactoros/src/functions/create_uploaded_file.php', 'da94ac5d3ca7d2dbab84ce561ce72bfd' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.php', '3d97c8dcdfba8cb85d3b34f116bb248b' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.php', @@ -36,6 +35,7 @@ 'cc8e14526dc240491e17a838cb78508c' => $vendorDir . '/laminas/laminas-diactoros/src/functions/normalize_server.legacy.php', '786bf90caabc9e09b6ad4cc5ca8f0e30' => $vendorDir . '/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.legacy.php', '751a5a3f463e4be759be31748b61737c' => $vendorDir . '/laminas/laminas-diactoros/src/functions/parse_cookie_header.legacy.php', + 'def43f6c87e4f8dfd0c9e1b1bab14fe8' => $vendorDir . '/symfony/polyfill-iconv/bootstrap.php', '2f69d3914119f042cca9e44442d5ce95' => $baseDir . '/web/core/includes/bootstrap.inc', '6db5533840cb1ae1bc049452845aa88e' => $baseDir . '/web/core/includes/guzzle_php81_shim.php', '5abda994d126976858eb25d2546ee3c9' => $vendorDir . '/simplesamlphp/simplesamlphp/lib/_autoload_modules.php', diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index a54fc274ccbefe17ff8b2130257cfc4c1923a2a0..fe74d74df6a586e625111599bbf553ca51c5cda3 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -8,19 +8,18 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 { public static $files = array ( 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', - '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', + '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', + '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php', + '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', + '23c18046f52bef3eea034657bafda50f' => __DIR__ . '/..' . '/symfony/polyfill-php81/bootstrap.php', 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php', 'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php', - '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', - '23c18046f52bef3eea034657bafda50f' => __DIR__ . '/..' . '/symfony/polyfill-php81/bootstrap.php', - '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php', '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', - 'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php', 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', + 'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', - 'def43f6c87e4f8dfd0c9e1b1bab14fe8' => __DIR__ . '/..' . '/symfony/polyfill-iconv/bootstrap.php', '07d7f1a47144818725fd8d91a907ac57' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/create_uploaded_file.php', 'da94ac5d3ca7d2dbab84ce561ce72bfd' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.php', '3d97c8dcdfba8cb85d3b34f116bb248b' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.php', @@ -37,6 +36,7 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 'cc8e14526dc240491e17a838cb78508c' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/normalize_server.legacy.php', '786bf90caabc9e09b6ad4cc5ca8f0e30' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.legacy.php', '751a5a3f463e4be759be31748b61737c' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/parse_cookie_header.legacy.php', + 'def43f6c87e4f8dfd0c9e1b1bab14fe8' => __DIR__ . '/..' . '/symfony/polyfill-iconv/bootstrap.php', '2f69d3914119f042cca9e44442d5ce95' => __DIR__ . '/../..' . '/web/core/includes/bootstrap.inc', '6db5533840cb1ae1bc049452845aa88e' => __DIR__ . '/../..' . '/web/core/includes/guzzle_php81_shim.php', '5abda994d126976858eb25d2546ee3c9' => __DIR__ . '/..' . '/simplesamlphp/simplesamlphp/lib/_autoload_modules.php', diff --git a/vendor/composer/include_paths.php b/vendor/composer/include_paths.php index 388b47e97c5c89a1f3cb39197440735fdde9b071..d4fb967181c34edeb03fdbced173d00c67b66855 100644 --- a/vendor/composer/include_paths.php +++ b/vendor/composer/include_paths.php @@ -8,6 +8,6 @@ return array( $vendorDir . '/pear/archive_tar', $vendorDir . '/pear/console_getopt', - $vendorDir . '/pear/pear_exception', $vendorDir . '/pear/pear-core-minimal/src', + $vendorDir . '/pear/pear_exception', ); diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index f9f97a089fbbf47afdee437da13b9d90a3a97778..761139236ff92b99aed52eb295816d0b1cfa5227 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -3039,17 +3039,17 @@ }, { "name": "drupal/core", - "version": "9.3.0", - "version_normalized": "9.3.0.0", + "version": "9.3.2", + "version_normalized": "9.3.2.0", "source": { "type": "git", "url": "https://github.com/drupal/core.git", - "reference": "1e1bf0e841e11029b21775dd125332d7ffd6fb47" + "reference": "6c9ba6b6314550e7efb8f5f4e2a40f54cfd6aee1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drupal/core/zipball/1e1bf0e841e11029b21775dd125332d7ffd6fb47", - "reference": "1e1bf0e841e11029b21775dd125332d7ffd6fb47", + "url": "https://api.github.com/repos/drupal/core/zipball/6c9ba6b6314550e7efb8f5f4e2a40f54cfd6aee1", + "reference": "6c9ba6b6314550e7efb8f5f4e2a40f54cfd6aee1", "shasum": "" }, "require": { @@ -3216,7 +3216,7 @@ "drupal/workflows": "self.version", "drupal/workspaces": "self.version" }, - "time": "2021-12-08T22:09:38+00:00", + "time": "2022-01-05T02:55:30+00:00", "type": "drupal-core", "extra": { "drupal-scaffold": { @@ -3297,7 +3297,7 @@ ], "description": "Drupal is an open source content management platform powering millions of websites and applications.", "support": { - "source": "https://github.com/drupal/core/tree/9.3.0" + "source": "https://github.com/drupal/core/tree/9.3.2" }, "install-path": "../../web/core" }, @@ -3353,17 +3353,17 @@ }, { "name": "drupal/core-recommended", - "version": "9.3.0", - "version_normalized": "9.3.0.0", + "version": "9.3.2", + "version_normalized": "9.3.2.0", "source": { "type": "git", "url": "https://github.com/drupal/core-recommended.git", - "reference": "d65aaa36a8cab54332787a20676f81928f675bb3" + "reference": "9f570d6bf6e568b8c2deab02349a11fad3d1e272" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drupal/core-recommended/zipball/d65aaa36a8cab54332787a20676f81928f675bb3", - "reference": "d65aaa36a8cab54332787a20676f81928f675bb3", + "url": "https://api.github.com/repos/drupal/core-recommended/zipball/9f570d6bf6e568b8c2deab02349a11fad3d1e272", + "reference": "9f570d6bf6e568b8c2deab02349a11fad3d1e272", "shasum": "" }, "require": { @@ -3372,7 +3372,7 @@ "doctrine/annotations": "1.13.2", "doctrine/lexer": "1.2.1", "doctrine/reflection": "1.2.2", - "drupal/core": "9.3.0", + "drupal/core": "9.3.2", "egulias/email-validator": "3.1.2", "guzzlehttp/guzzle": "6.5.5", "guzzlehttp/promises": "1.5.1", @@ -3427,7 +3427,7 @@ "conflict": { "webflo/drupal-core-strict": "*" }, - "time": "2021-12-08T22:09:38+00:00", + "time": "2022-01-05T02:55:30+00:00", "type": "metapackage", "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3435,7 +3435,7 @@ ], "description": "Locked core dependencies; require this project INSTEAD OF drupal/core.", "support": { - "source": "https://github.com/drupal/core-recommended/tree/9.3.0" + "source": "https://github.com/drupal/core-recommended/tree/9.3.2" }, "install-path": null }, @@ -13245,17 +13245,17 @@ }, { "name": "symfony/dom-crawler", - "version": "v4.4.30", - "version_normalized": "4.4.30.0", + "version": "v4.4.36", + "version_normalized": "4.4.36.0", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "4632ae3567746c7e915c33c67a2fb6ab746090c4" + "reference": "42de12bee3b5e594977209bcdf58ec4fef8dde39" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/4632ae3567746c7e915c33c67a2fb6ab746090c4", - "reference": "4632ae3567746c7e915c33c67a2fb6ab746090c4", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/42de12bee3b5e594977209bcdf58ec4fef8dde39", + "reference": "42de12bee3b5e594977209bcdf58ec4fef8dde39", "shasum": "" }, "require": { @@ -13274,7 +13274,7 @@ "suggest": { "symfony/css-selector": "" }, - "time": "2021-08-28T15:40:01+00:00", + "time": "2021-12-28T14:48:02+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -13302,7 +13302,7 @@ "description": "Eases DOM navigation for HTML and XML documents", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dom-crawler/tree/v4.4.30" + "source": "https://github.com/symfony/dom-crawler/tree/v4.4.36" }, "funding": [ { @@ -13627,24 +13627,24 @@ }, { "name": "symfony/finder", - "version": "v4.4.30", - "version_normalized": "4.4.30.0", + "version": "v4.4.36", + "version_normalized": "4.4.36.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "70362f1e112280d75b30087c7598b837c1b468b6" + "reference": "1fef05633cd61b629e963e5d8200fb6b67ecf42c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/70362f1e112280d75b30087c7598b837c1b468b6", - "reference": "70362f1e112280d75b30087c7598b837c1b468b6", + "url": "https://api.github.com/repos/symfony/finder/zipball/1fef05633cd61b629e963e5d8200fb6b67ecf42c", + "reference": "1fef05633cd61b629e963e5d8200fb6b67ecf42c", "shasum": "" }, "require": { "php": ">=7.1.3", "symfony/polyfill-php80": "^1.16" }, - "time": "2021-08-04T20:31:23+00:00", + "time": "2021-12-15T10:33:10+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -13672,7 +13672,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v4.4.30" + "source": "https://github.com/symfony/finder/tree/v4.4.36" }, "funding": [ { @@ -14462,8 +14462,8 @@ }, { "name": "symfony/polyfill-php72", - "version": "v1.23.0", - "version_normalized": "1.23.0.0", + "version": "v1.24.0", + "version_normalized": "1.24.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", @@ -14521,7 +14521,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.24.0" }, "funding": [ { @@ -14541,23 +14541,23 @@ }, { "name": "symfony/polyfill-php73", - "version": "v1.23.0", - "version_normalized": "1.23.0.0", + "version": "v1.24.0", + "version_normalized": "1.24.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", "shasum": "" }, "require": { "php": ">=7.1" }, - "time": "2021-02-19T12:13:01+00:00", + "time": "2021-06-05T21:20:04+00:00", "type": "library", "extra": { "branch-alias": { @@ -14603,7 +14603,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.24.0" }, "funding": [ { @@ -14709,23 +14709,23 @@ }, { "name": "symfony/polyfill-php81", - "version": "v1.23.0", - "version_normalized": "1.23.0.0", + "version": "v1.24.0", + "version_normalized": "1.24.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "e66119f3de95efc359483f810c4c3e6436279436" + "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/e66119f3de95efc359483f810c4c3e6436279436", - "reference": "e66119f3de95efc359483f810c4c3e6436279436", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", + "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", "shasum": "" }, "require": { "php": ">=7.1" }, - "time": "2021-05-21T13:25:03+00:00", + "time": "2021-09-13T13:58:11+00:00", "type": "library", "extra": { "branch-alias": { @@ -14771,7 +14771,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.24.0" }, "funding": [ { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 709ac9be8100bf7cde96305fb172deffd60fa91a..ac56782e510a5f6e5951979fb132a615b5c5bc00 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -5,7 +5,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '962cf59ff1854ec0ff565aeabc911451ac735d83', + 'reference' => 'b735b69933d4810762ebdd7a5df0515a4440839a', 'name' => 'osu-asc-webservices/d8-upstream', 'dev' => true, ), @@ -271,7 +271,7 @@ 'drupal/action' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/addtocalendar' => array( @@ -304,7 +304,7 @@ 'drupal/aggregator' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/allowed_formats' => array( @@ -328,25 +328,25 @@ 'drupal/automated_cron' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/ban' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/bartik' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/basic_auth' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/better_exposed_filters' => array( @@ -361,19 +361,19 @@ 'drupal/big_pipe' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/block' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/block_content' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/block_field' => array( @@ -406,7 +406,7 @@ 'drupal/book' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/bootstrap' => array( @@ -421,7 +421,7 @@ 'drupal/breakpoint' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/cache_control_override' => array( @@ -445,13 +445,13 @@ 'drupal/ckeditor' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/ckeditor5' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/ckeditor_indentblock' => array( @@ -466,31 +466,31 @@ 'drupal/claro' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/classy' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/color' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/comment' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/config' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/config_direct_save' => array( @@ -523,7 +523,7 @@ 'drupal/config_translation' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/config_update' => array( @@ -574,7 +574,7 @@ 'drupal/contact' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/content_access' => array( @@ -589,52 +589,52 @@ 'drupal/content_moderation' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/content_translation' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/contextual' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/core' => array( - 'pretty_version' => '9.3.0', - 'version' => '9.3.0.0', + 'pretty_version' => '9.3.2', + 'version' => '9.3.2.0', 'type' => 'drupal-core', 'install_path' => __DIR__ . '/../../web/core', 'aliases' => array(), - 'reference' => '1e1bf0e841e11029b21775dd125332d7ffd6fb47', + 'reference' => '6c9ba6b6314550e7efb8f5f4e2a40f54cfd6aee1', 'dev_requirement' => false, ), 'drupal/core-annotation' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/core-assertion' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/core-bridge' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/core-class-finder' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/core-composer-scaffold' => array( @@ -649,136 +649,136 @@ 'drupal/core-datetime' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/core-dependency-injection' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/core-diff' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/core-discovery' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/core-event-dispatcher' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/core-file-cache' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/core-file-security' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/core-filesystem' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/core-front-matter' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/core-gettext' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/core-graph' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/core-http-foundation' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/core-php-storage' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/core-plugin' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/core-proxy-builder' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/core-recommended' => array( - 'pretty_version' => '9.3.0', - 'version' => '9.3.0.0', + 'pretty_version' => '9.3.2', + 'version' => '9.3.2.0', 'type' => 'metapackage', 'install_path' => NULL, 'aliases' => array(), - 'reference' => 'd65aaa36a8cab54332787a20676f81928f675bb3', + 'reference' => '9f570d6bf6e568b8c2deab02349a11fad3d1e272', 'dev_requirement' => false, ), 'drupal/core-render' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/core-serialization' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/core-transliteration' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/core-utility' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/core-uuid' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/core-version' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/crop' => array( @@ -802,19 +802,19 @@ 'drupal/datetime' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/datetime_range' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/dblog' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/dropzonejs' => array( @@ -838,13 +838,13 @@ 'drupal/dynamic_page_cache' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/editor' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/editor_advanced_link' => array( @@ -913,7 +913,7 @@ 'drupal/entity_reference' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/entity_reference_revisions' => array( @@ -937,7 +937,7 @@ 'drupal/field' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/field_group' => array( @@ -952,7 +952,7 @@ 'drupal/field_layout' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/field_permissions' => array( @@ -967,13 +967,13 @@ 'drupal/field_ui' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/file' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/file_browser' => array( @@ -988,7 +988,7 @@ 'drupal/filter' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/focal_point' => array( @@ -1003,7 +1003,7 @@ 'drupal/forum' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/google_analytics' => array( @@ -1027,25 +1027,25 @@ 'drupal/hal' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/help' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/help_topics' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/history' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/honeypot' => array( @@ -1060,7 +1060,7 @@ 'drupal/image' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/inline_entity_form' => array( @@ -1075,7 +1075,7 @@ 'drupal/inline_form_errors' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/jquery_ui' => array( @@ -1117,25 +1117,25 @@ 'drupal/jsonapi' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/language' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/layout_builder' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/layout_discovery' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/libraries' => array( @@ -1150,7 +1150,7 @@ 'drupal/link' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/link_attributes' => array( @@ -1174,7 +1174,7 @@ 'drupal/locale' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/mathjax' => array( @@ -1189,7 +1189,7 @@ 'drupal/media' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/media_entity_browser' => array( @@ -1213,7 +1213,7 @@ 'drupal/media_library' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/menu_block' => array( @@ -1246,13 +1246,13 @@ 'drupal/menu_link_content' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/menu_ui' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/metatag' => array( @@ -1267,7 +1267,7 @@ 'drupal/migrate' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/migrate_devel' => array( @@ -1282,19 +1282,19 @@ 'drupal/migrate_drupal' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/migrate_drupal_multilingual' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/migrate_drupal_ui' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/migrate_plus' => array( @@ -1318,7 +1318,7 @@ 'drupal/minimal' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/mobile_detect' => array( @@ -1360,25 +1360,25 @@ 'drupal/node' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/olivero' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/options' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/page_cache' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/pantheon_advanced_page_cache' => array( @@ -1402,13 +1402,13 @@ 'drupal/path' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/path_alias' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/pathauto' => array( @@ -1432,13 +1432,13 @@ 'drupal/quickedit' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/rdf' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/rebuild_cache_access' => array( @@ -1480,13 +1480,13 @@ 'drupal/responsive_image' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/rest' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/roleassign' => array( @@ -1510,7 +1510,7 @@ 'drupal/search' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/search_api' => array( @@ -1534,25 +1534,25 @@ 'drupal/serialization' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/settings_tray' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/seven' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/shortcut' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/simple_gmap' => array( @@ -1621,19 +1621,19 @@ 'drupal/standard' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/stark' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/statistics' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/superfish' => array( @@ -1657,31 +1657,31 @@ 'drupal/syslog' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/system' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/taxonomy' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/telephone' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/text' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/token' => array( @@ -1696,19 +1696,19 @@ 'drupal/toolbar' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/tour' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/tracker' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/twig_tweak' => array( @@ -1741,13 +1741,13 @@ 'drupal/update' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/user' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/userprotect' => array( @@ -1780,7 +1780,7 @@ 'drupal/views' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/views_ajax_history' => array( @@ -1840,7 +1840,7 @@ 'drupal/views_ui' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/webform' => array( @@ -1855,13 +1855,13 @@ 'drupal/workflows' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drupal/workspaces' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '9.3.0', + 0 => '9.3.2', ), ), 'drush-ops/behat-drush-endpoint' => array( @@ -2101,7 +2101,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '962cf59ff1854ec0ff565aeabc911451ac735d83', + 'reference' => 'b735b69933d4810762ebdd7a5df0515a4440839a', 'dev_requirement' => false, ), 'pantheon-systems/quicksilver-pushback' => array( @@ -2658,12 +2658,12 @@ 'dev_requirement' => false, ), 'symfony/dom-crawler' => array( - 'pretty_version' => 'v4.4.30', - 'version' => '4.4.30.0', + 'pretty_version' => 'v4.4.36', + 'version' => '4.4.36.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/dom-crawler', 'aliases' => array(), - 'reference' => '4632ae3567746c7e915c33c67a2fb6ab746090c4', + 'reference' => '42de12bee3b5e594977209bcdf58ec4fef8dde39', 'dev_requirement' => false, ), 'symfony/error-handler' => array( @@ -2709,12 +2709,12 @@ 'dev_requirement' => false, ), 'symfony/finder' => array( - 'pretty_version' => 'v4.4.30', - 'version' => '4.4.30.0', + 'pretty_version' => 'v4.4.36', + 'version' => '4.4.36.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/finder', 'aliases' => array(), - 'reference' => '70362f1e112280d75b30087c7598b837c1b468b6', + 'reference' => '1fef05633cd61b629e963e5d8200fb6b67ecf42c', 'dev_requirement' => false, ), 'symfony/http-client-contracts' => array( @@ -2799,8 +2799,8 @@ 'dev_requirement' => false, ), 'symfony/polyfill-php72' => array( - 'pretty_version' => 'v1.23.0', - 'version' => '1.23.0.0', + 'pretty_version' => 'v1.24.0', + 'version' => '1.24.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php72', 'aliases' => array(), @@ -2808,12 +2808,12 @@ 'dev_requirement' => false, ), 'symfony/polyfill-php73' => array( - 'pretty_version' => 'v1.23.0', - 'version' => '1.23.0.0', + 'pretty_version' => 'v1.24.0', + 'version' => '1.24.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php73', 'aliases' => array(), - 'reference' => 'fba8933c384d6476ab14fb7b8526e5287ca7e010', + 'reference' => 'cc5db0e22b3cb4111010e48785a97f670b350ca5', 'dev_requirement' => false, ), 'symfony/polyfill-php80' => array( @@ -2826,12 +2826,12 @@ 'dev_requirement' => false, ), 'symfony/polyfill-php81' => array( - 'pretty_version' => 'v1.23.0', - 'version' => '1.23.0.0', + 'pretty_version' => 'v1.24.0', + 'version' => '1.24.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php81', 'aliases' => array(), - 'reference' => 'e66119f3de95efc359483f810c4c3e6436279436', + 'reference' => '5de4ba2d41b15f9bd0e19b2ab9674135813ec98f', 'dev_requirement' => false, ), 'symfony/process' => array( diff --git a/vendor/symfony/dom-crawler/Crawler.php b/vendor/symfony/dom-crawler/Crawler.php index de7b3aedc37ae8e6c22ea981e52dfd7d1d55f269..36c7a41e5fbc77229b40e0d8effa963480e8be25 100644 --- a/vendor/symfony/dom-crawler/Crawler.php +++ b/vendor/symfony/dom-crawler/Crawler.php @@ -1186,7 +1186,7 @@ protected function sibling($node, $siblingDir = 'nextSibling') private function parseHtml5(string $htmlContent, string $charset = 'UTF-8'): \DOMDocument { - return $this->html5Parser->parse($this->convertToHtmlEntities($htmlContent, $charset), [], $charset); + return $this->html5Parser->parse($this->convertToHtmlEntities($htmlContent, $charset)); } private function parseXhtml(string $htmlContent, string $charset = 'UTF-8'): \DOMDocument @@ -1222,11 +1222,11 @@ private function convertToHtmlEntities(string $htmlContent, string $charset = 'U try { return mb_convert_encoding($htmlContent, 'HTML-ENTITIES', $charset); - } catch (\Exception | \ValueError $e) { + } catch (\Exception|\ValueError $e) { try { $htmlContent = iconv($charset, 'UTF-8', $htmlContent); $htmlContent = mb_convert_encoding($htmlContent, 'HTML-ENTITIES', 'UTF-8'); - } catch (\Exception | \ValueError $e) { + } catch (\Exception|\ValueError $e) { } return $htmlContent; diff --git a/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php b/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php index a18e6185beeec2f2a972826063e8688319d95f45..8508ab707b9a30201acb0728a525cb678f75d52f 100644 --- a/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php +++ b/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php @@ -64,7 +64,7 @@ public function current() // the logic here avoids redoing the same work in all iterations if (null === $subPathname = $this->subPath) { - $subPathname = $this->subPath = (string) $this->getSubPath(); + $subPathname = $this->subPath = $this->getSubPath(); } if ('' !== $subPathname) { $subPathname .= $this->directorySeparator; diff --git a/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php b/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php index 673d100224854a8d9c0dc429cf4dfd5b3bef0726..f06d6c2694c34e11dfa95b242c6be61de599197a 100644 --- a/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php +++ b/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php @@ -9,6 +9,8 @@ * file that was distributed with this source code. */ -class JsonException extends Exception -{ +if (\PHP_VERSION_ID < 70300) { + class JsonException extends Exception + { + } } diff --git a/vendor/symfony/polyfill-php81/Php81.php b/vendor/symfony/polyfill-php81/Php81.php index 709c20bb55c8ebc9a398ce46119e48acb27b28c6..f0507b765c2dbbb4c42077a52cfe11c46eb6159d 100644 --- a/vendor/symfony/polyfill-php81/Php81.php +++ b/vendor/symfony/polyfill-php81/Php81.php @@ -20,7 +20,7 @@ final class Php81 { public static function array_is_list(array $array): bool { - if ([] === $array) { + if ([] === $array || $array === array_values($array)) { return true; } diff --git a/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php b/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php index 197709ba6680f0a25baa4139a9bbb1033dbcfcb5..f4cad34f646cac25f0712b3ddfc4c6ebdc75fe4c 100644 --- a/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php +++ b/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php @@ -1,9 +1,11 @@ <?php -#[Attribute(Attribute::TARGET_METHOD)] -final class ReturnTypeWillChange -{ - public function __construct() +if (\PHP_VERSION_ID < 80100) { + #[Attribute(Attribute::TARGET_METHOD)] + final class ReturnTypeWillChange { + public function __construct() + { + } } } diff --git a/web/core/MAINTAINERS.txt b/web/core/MAINTAINERS.txt index 25bb42f761a5421c7297bdcb6b885198f6f788a2..9d4167887ebe31d658009f8ef2755e4556e4022d 100644 --- a/web/core/MAINTAINERS.txt +++ b/web/core/MAINTAINERS.txt @@ -541,13 +541,13 @@ tools, documentation, and processes to make it easier for new contributors to get involved. They organize communications and logistics, and actively participate in mentoring. +- Chris Darke 'chrisdarke' https://www.drupal.org/u/chrisdarke - Mauricio Dinarte 'dinarcon' https://www.drupal.org/u/dinarcon +- Brian Gilbert 'realityloop' https://www.drupal.org/u/realityloop - Lucas Hedding 'heddn' https://www.drupal.org/u/heddn +- AmyJune Hineline 'volkswagenchick' https://www.drupal.org/u/volkswagenchick - Tara King 'sparklingrobots' https://www.drupal.org/u/sparklingrobots - Rachel Lawson 'rachel_norfolk' https://www.drupal.org/u/rachel_norfolk - Elli Ludwigson 'ekl1773' https://www.drupal.org/u/ekl1773 - Jess Myrbo 'xjm' https://www.drupal.org/u/xjm - Matthew Radcliffe 'mradcliffe' https://www.drupal.org/u/mradcliffe -- (provisional) Chris Darke 'chrisdarke' https://www.drupal.org/u/chrisdarke -- (provisional) Brian Gilbert 'realityloop' https://www.drupal.org/u/realityloop -- (provisional) AmyJune Hineline 'volkswagenchick' https://www.drupal.org/u/volkswagenchick diff --git a/web/core/core.api.php b/web/core/core.api.php index 81b697cb9387eb6a7607586e6f25b0a82d676a51..7cb3814a92bbffb1e263b64cb140a9da8e443df4 100644 --- a/web/core/core.api.php +++ b/web/core/core.api.php @@ -734,18 +734,19 @@ * * @section sec_overview Overview of container, injection, and services * The Services and Dependency Injection Container concepts have been adopted by - * Drupal from the @link http://symfony.com/ Symfony framework. @endlink A - * "service" (such as accessing the database, sending email, or translating user - * interface text) is defined (given a name and an interface or at least a - * class that defines the methods that may be called), and a default class is - * designated to provide the service. These two steps must be done together, and - * can be done by Drupal Core or a module. Other modules can then define - * alternative classes to provide the same services, overriding the default - * classes. Classes and functions that need to use the service should always - * instantiate the class via the dependency injection container (also known - * simply as the "container"), rather than instantiating a particular service - * provider class directly, so that they get the correct class (default or - * overridden). + * Drupal from the + * @link http://symfony.com/doc/current/components/dependency_injection.html + * Symfony DependencyInjection component. @endlink A "service" (such as + * accessing the database, sending email, or translating user interface text) is + * defined (given a name and an interface or at least a class that defines the + * methods that may be called), and a default class is designated to provide the + * service. These two steps must be done together, and can be done by Drupal + * Core or a module. Other modules can then define alternative classes to + * provide the same services, overriding the default classes. Classes and + * functions that need to use the service should always instantiate the class + * via the dependency injection container (also known simply as the + * "container"), rather than instantiating a particular service provider class + * directly, so that they get the correct class (default or overridden). * * See https://www.drupal.org/node/2133171 for more detailed information on * services and the dependency injection container. @@ -2496,14 +2497,13 @@ function hook_validation_constraint_alter(array &$definitions) { * Overview of event dispatch and subscribing * * @section sec_intro Introduction and terminology - * Events are part of the Symfony framework: they allow for different components - * of the system to interact and communicate with each other. Each event has a - * unique string name. One system component dispatches the event at an - * appropriate time; many events are dispatched by Drupal core and the Symfony - * framework in every request. Other system components can register as event - * subscribers; when an event is dispatched, a method is called on each - * registered subscriber, allowing each one to react. For more on the general - * concept of events, see + * Events allow different components of the system to interact and communicate + * with each other. One system component dispatches the event at an appropriate + * time; many events are dispatched by Drupal core and the Symfony event system + * in every request. Other system components can register as event subscribers; + * when an event is dispatched, a method is called on each registered + * subscriber, allowing each one to react. For more on the general concept of + * events, see * http://symfony.com/doc/current/components/event_dispatcher/introduction.html * * @section sec_dispatch Dispatching events diff --git a/web/core/lib/Drupal.php b/web/core/lib/Drupal.php index d8552ac0ffa8e072658f758c4b0610ff8917f9a9..845ae366335f6df2c2da0dffb204b26208f4b3c4 100644 --- a/web/core/lib/Drupal.php +++ b/web/core/lib/Drupal.php @@ -75,7 +75,7 @@ class Drupal { /** * The current system version. */ - const VERSION = '9.3.0'; + const VERSION = '9.3.2'; /** * Core API compatibility. diff --git a/web/core/lib/Drupal/Component/Gettext/PoStreamReader.php b/web/core/lib/Drupal/Component/Gettext/PoStreamReader.php index bbdd8e8ae6a24f3e62f85999ad703a4066585062..9b444260668435b8fd89968ae6c3c28ca0a37a24 100644 --- a/web/core/lib/Drupal/Component/Gettext/PoStreamReader.php +++ b/web/core/lib/Drupal/Component/Gettext/PoStreamReader.php @@ -438,7 +438,7 @@ private function readLine() { return FALSE; } - // Remove 'msgstr' and trim away away whitespaces. + // Remove 'msgstr' and trim away whitespaces. $line = trim(substr($line, 6)); // Only the msgstr string is left, parse it. diff --git a/web/core/lib/Drupal/Component/Utility/NestedArray.php b/web/core/lib/Drupal/Component/Utility/NestedArray.php index 86c73099ebd9b6c4fd09f5f910207808d7218da8..0521c0d59701b9224849218f88167aae27b5feb9 100644 --- a/web/core/lib/Drupal/Component/Utility/NestedArray.php +++ b/web/core/lib/Drupal/Component/Utility/NestedArray.php @@ -194,7 +194,7 @@ public static function setValue(array &$array, array $parents, $value, $force = * * Instead, use this helper function: * @code - * NestedArray::unset_nested_value($form, $parents, $element); + * NestedArray::unsetValue($form, $parents, $element); * @endcode * * However if the number of array parent keys is static, the value should diff --git a/web/core/lib/Drupal/Core/Database/Install/Tasks.php b/web/core/lib/Drupal/Core/Database/Install/Tasks.php index b7fceace1196398a97356007d835a9adf2573a9b..fcbb1a401a87b35157012b1a7f880f2e61876c86 100644 --- a/web/core/lib/Drupal/Core/Database/Install/Tasks.php +++ b/web/core/lib/Drupal/Core/Database/Install/Tasks.php @@ -82,41 +82,50 @@ abstract class Tasks { /** * Ensure the PDO driver is supported by the version of PHP in use. + * + * @return bool + * TRUE if the PDO driver is supported, otherwise FALSE. */ protected function hasPdoDriver() { return in_array($this->pdoDriver, \PDO::getAvailableDrivers()); } /** - * Assert test as failed. + * Asserts test as failed. */ protected function fail($message) { $this->results['fail'][] = $message; } /** - * Assert test as a pass. + * Asserts test as a pass. */ protected function pass($message) { $this->results['pass'][] = $message; } /** - * Check whether Drupal is installable on the database. + * Checks whether Drupal is installable on the database. + * + * @return bool + * TRUE if Drupal can be installed on the database, otherwise FALSE. */ public function installable() { return $this->hasPdoDriver() && empty($this->error); } /** - * Return the human-readable name of the driver. + * Returns the human-readable name of the driver. + * + * @return string + * The human-readable name of the driver. */ abstract public function name(); /** - * Return the minimum required version of the engine. + * Returns the minimum required version of the engine. * - * @return + * @return string|null * A version string. If not NULL, it will be checked against the version * reported by the Database engine using version_compare(). */ @@ -125,9 +134,9 @@ public function minimumVersion() { } /** - * Run database tasks and tests to see if Drupal can run on the database. + * Runs database tasks and tests to see if Drupal can run on the database. * - * @return array + * @return string[] * A list of error messages. */ public function runTasks() { @@ -165,7 +174,10 @@ final public function engineVersionRequirementsCheck() { } /** - * Check if we can connect to the database. + * Checks if we can connect to the database. + * + * @return bool + * TRUE if we can connect to the database, otherwise FALSE. */ protected function connect() { try { @@ -183,7 +195,7 @@ protected function connect() { } /** - * Run SQL tests to ensure the database can execute commands with the current user. + * Ensures the database can execute commands with the current user. */ protected function runTestQuery($query, $pass, $fail, $fatal = FALSE) { try { @@ -197,7 +209,7 @@ protected function runTestQuery($query, $pass, $fail, $fatal = FALSE) { } /** - * Check the engine version. + * Checks the engine version. */ protected function checkEngineVersion() { // Ensure that the database server has the right version. @@ -222,12 +234,12 @@ protected function checkEngineVersion() { } /** - * Return driver specific configuration options. + * Returns driver specific configuration options. * - * @param $database + * @param string[] $database * An array of driver specific configuration options. * - * @return + * @return array * The options form array. */ public function getFormOptions(array $database) { @@ -319,13 +331,13 @@ public function getFormOptions(array $database) { * Checks to ensure correct basic database settings and that a proper * connection to the database can be established. * - * @param $database + * @param string[] $database * An array of driver specific configuration options. * - * @return + * @return \Drupal\Core\StringTranslation\TranslatableMarkup[] * An array of driver configuration errors, keyed by form element name. */ - public function validateDatabaseSettings($database) { + public function validateDatabaseSettings(array $database) { $errors = []; // Verify the table prefix. @@ -339,6 +351,16 @@ public function validateDatabaseSettings($database) { /** * Translates a string to the current language or to a given language. * + * @param string $string + * The string literal to translate. + * @param array $args + * Placeholder arguments to use inside the translated string (if any). + * @param array $options + * Options for the translation. + * + * @return \Drupal\Core\StringTranslation\TranslatableMarkup + * An object representing the translatable markup for the given string. + * * @see \Drupal\Core\StringTranslation\TranslatableMarkup::__construct() */ protected function t($string, array $args = [], array $options = []) { diff --git a/web/core/lib/Drupal/Core/Database/Query/SelectInterface.php b/web/core/lib/Drupal/Core/Database/Query/SelectInterface.php index 14edb16c7817eb492d61f88a72a87cbb1bd48abc..449d0b64d3c2862e2091012253463a6ef18ff17d 100644 --- a/web/core/lib/Drupal/Core/Database/Query/SelectInterface.php +++ b/web/core/lib/Drupal/Core/Database/Query/SelectInterface.php @@ -332,7 +332,7 @@ public function leftJoin($table, $alias = NULL, $condition = NULL, $arguments = * fields on which to join. * * @param $type - * The type of join. Typically one one of INNER, LEFT OUTER, and RIGHT OUTER. + * The type of join. Typically one of INNER, LEFT OUTER, and RIGHT OUTER. * @param $table * The table against which to join. May be a string or another SelectQuery * object. If a query object is passed, it will be used as a subselect. diff --git a/web/core/lib/Drupal/Core/Database/database.api.php b/web/core/lib/Drupal/Core/Database/database.api.php index 890f36bd9a5cc32110a44a8cfe6bca1eb2159937..aed2448bdf2e4978d77d1531997619fb13466104 100644 --- a/web/core/lib/Drupal/Core/Database/database.api.php +++ b/web/core/lib/Drupal/Core/Database/database.api.php @@ -162,7 +162,7 @@ * remains in scope; when $transaction is destroyed, the transaction will be * committed. If your transaction is nested inside of another then Drupal will * track each transaction and only commit the outer-most transaction when the - * last transaction object goes out out of scope (when all relevant queries have + * last transaction object goes out of scope (when all relevant queries have * completed successfully). * * Example: diff --git a/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php b/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php index 6f970268090c1423ae5271f334b6bd7ae424bc8f..ce9e78c53a3e4b4d0a4335ba381d09d135ab2c9e 100644 --- a/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php +++ b/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php @@ -83,7 +83,7 @@ abstract class EntityStorageBase extends EntityHandlerBase implements EntityStor protected $memoryCache; /** - * The memory cache cache tag. + * The memory cache tag. * * @var string */ diff --git a/web/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php b/web/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php index 8ad4aadae857f8f23d2cdaae8e9e11e4200459df..6221d59a08bb7cac84f4a5cdecf0da4aefbc87e5 100644 --- a/web/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php +++ b/web/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php @@ -27,7 +27,7 @@ class MainContentViewSubscriber implements EventSubscriberInterface { /** * The class resolver service. * - * @var \Drupal\Core\Controller\ControllerResolverInterface + * @var \Drupal\Core\DependencyInjection\ClassResolverInterface */ protected $classResolver; diff --git a/web/core/lib/Drupal/Core/Extension/InfoParserInterface.php b/web/core/lib/Drupal/Core/Extension/InfoParserInterface.php index 214a4467fdc144a6e31eff0149637946cb717fe6..c2615284e2428d32d1109fb56f8d78413dff7cbc 100644 --- a/web/core/lib/Drupal/Core/Extension/InfoParserInterface.php +++ b/web/core/lib/Drupal/Core/Extension/InfoParserInterface.php @@ -20,6 +20,10 @@ interface InfoParserInterface { * - name: The real name of the module for display purposes. (Required) * - description: A brief description of the module. * - type: whether it is for a module or theme. (Required) + * - core_version_requirement: Specifies the compatible version or versions of + * Drupal core. For example, "9.3 || 9.4" means compatibility with Drupal + * 9.3 and 9.4; ">=9" means compatible with Drupal 9, 10 and later versions, + * "<=9" means compatible with Drupal 8 and 9. (Required) * - lifecycle: [experimental|stable|deprecated|obsolete]. A description of * the current phase in the lifecycle of the module, theme or profile. * diff --git a/web/core/lib/Drupal/Core/Extension/ModuleDependencyMessageTrait.php b/web/core/lib/Drupal/Core/Extension/ModuleDependencyMessageTrait.php index 2440e31317f6fe1c2e60f0c9a2837082886e5c7b..d91085a0e68a964474371d3ecc663eb99f760aa5 100644 --- a/web/core/lib/Drupal/Core/Extension/ModuleDependencyMessageTrait.php +++ b/web/core/lib/Drupal/Core/Extension/ModuleDependencyMessageTrait.php @@ -39,7 +39,7 @@ public function checkDependencyMessage(array $modules, $dependency, Dependency $ } // Check if the module is incompatible with the dependency constraints. - $version = str_replace(\Drupal::CORE_COMPATIBILITY . '-', '', $modules[$dependency]->info['version']); + $version = str_replace(\Drupal::CORE_COMPATIBILITY . '-', '', $modules[$dependency]->info['version'] ?? ''); if (!$dependency_object->isCompatible($version)) { $constraint_string = $dependency_object->getConstraintString(); return $this->t('@module_name (<span class="admin-missing">incompatible with</span> version @version)', [ diff --git a/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php b/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php index d337350983ef493bb3b180991c155ec52fc0e1f2..8f95e07b538e21f124d852959f95008bfbc41bb5 100644 --- a/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php +++ b/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php @@ -80,7 +80,7 @@ class EntityReferenceEntityFormatter extends EntityReferenceFormatterBase { * @param string $view_mode * The view mode. * @param array $third_party_settings - * Any third party settings settings. + * Any third party settings. * @param \Drupal\Core\Logger\LoggerChannelFactoryInterface $logger_factory * The logger factory. * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager diff --git a/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/LanguageFormatter.php b/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/LanguageFormatter.php index 6f3c7cac44f195e2383473535c9d3a739199c0b0..6acabfa696029f264f1e941fa04947b6c160de99 100644 --- a/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/LanguageFormatter.php +++ b/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/LanguageFormatter.php @@ -46,7 +46,7 @@ class LanguageFormatter extends StringFormatter { * @param string $view_mode * The view mode. * @param array $third_party_settings - * Any third party settings settings. + * Any third party settings. * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager * The entity type manager. * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager diff --git a/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/StringFormatter.php b/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/StringFormatter.php index 96f18958405b812a3fad9b6e5887b34ac57b1d37..c46a97b22d3344520c6f55db304524583bcf4699 100644 --- a/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/StringFormatter.php +++ b/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/StringFormatter.php @@ -51,7 +51,7 @@ class StringFormatter extends FormatterBase { * @param string $view_mode * The view mode. * @param array $third_party_settings - * Any third party settings settings. + * Any third party settings. * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager * The entity type manager. */ diff --git a/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DecimalItem.php b/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DecimalItem.php index 379ff74db0cdda1e8fa0f784f5321c1eb25607be..0c9e8195bc11fe5ddc79ebb25f8cfe3ce67dc005 100644 --- a/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DecimalItem.php +++ b/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DecimalItem.php @@ -136,8 +136,8 @@ public static function generateSampleValue(FieldDefinitionInterface $field_defin // point. // The maximum number you can get with 3 digits is 10^3 - 1 --> 999. // The minimum number you can get with 3 digits is -1 * (10^3 - 1). - $max = is_numeric($settings['max']) ?: pow(10, ($precision - $scale)) - 1; - $min = is_numeric($settings['min']) ?: -pow(10, ($precision - $scale)) + 1; + $max = is_numeric($settings['max']) ? $settings['max'] : pow(10, ($precision - $scale)) - 1; + $min = is_numeric($settings['min']) ? $settings['min'] : -pow(10, ($precision - $scale)) + 1; // Get the number of decimal digits for the $max $decimal_digits = self::getDecimalDigits($max); diff --git a/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/FloatItem.php b/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/FloatItem.php index 7b2234c18e1b62e86523be672a34e31f1cab9dc4..739a62c76e675e7c6938679c19fc32fc7b90c849 100644 --- a/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/FloatItem.php +++ b/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/FloatItem.php @@ -64,8 +64,8 @@ public static function generateSampleValue(FieldDefinitionInterface $field_defin $settings = $field_definition->getSettings(); $precision = rand(10, 32); $scale = rand(0, 2); - $max = is_numeric($settings['max']) ?: pow(10, ($precision - $scale)) - 1; - $min = is_numeric($settings['min']) ?: -pow(10, ($precision - $scale)) + 1; + $max = is_numeric($settings['max']) ? $settings['max'] : pow(10, ($precision - $scale)) - 1; + $min = is_numeric($settings['min']) ? $settings['min'] : -pow(10, ($precision - $scale)) + 1; // @see "Example #1 Calculate a random floating-point number" in // http://php.net/manual/function.mt-getrandmax.php $random_decimal = $min + mt_rand() / mt_getrandmax() * ($max - $min); diff --git a/web/core/lib/Drupal/Core/Logger/LoggerChannelInterface.php b/web/core/lib/Drupal/Core/Logger/LoggerChannelInterface.php index 8764535f71b9ad2b8162e3943de221bb8e778cff..ff6551335dd374a809daa44e8a0be8f2badfec5e 100644 --- a/web/core/lib/Drupal/Core/Logger/LoggerChannelInterface.php +++ b/web/core/lib/Drupal/Core/Logger/LoggerChannelInterface.php @@ -18,7 +18,7 @@ * add a service for that class to a services.yml file tagged with the 'logger' * tag. The default logger channel implementation will call the log() method * of every logger service with some useful data set in the $context argument - * of log(): request_uri, referer, ip, user, uid. + * of log(): request_uri, referer, ip, uid, link, channel, timestamp. * * SECURITY NOTE: the caller might also set a 'link' in the $context array * which will be printed as-is by the dblog module under an "operations" diff --git a/web/core/lib/Drupal/Core/Queue/QueueInterface.php b/web/core/lib/Drupal/Core/Queue/QueueInterface.php index 83f3ef709841992050a1ec3d8859991f073316b4..449ad6a0dd05b9cbe4f15274f72435732ad97b94 100644 --- a/web/core/lib/Drupal/Core/Queue/QueueInterface.php +++ b/web/core/lib/Drupal/Core/Queue/QueueInterface.php @@ -62,7 +62,7 @@ public function numberOfItems(); * problem. * * If returned, the object will have at least the following properties: - * - data: the same as what what passed into createItem(). + * - data: the same as what passed into createItem(). * - item_id: the unique ID returned from createItem(). * - created: timestamp when the item was put into the queue. */ diff --git a/web/core/lib/Drupal/Core/Render/Element/Table.php b/web/core/lib/Drupal/Core/Render/Element/Table.php index 9313ff975bf9612c22a7320ea920c55ee7f130bf..ef650c9df61956b37a641e5739843cc7c7999a4b 100644 --- a/web/core/lib/Drupal/Core/Render/Element/Table.php +++ b/web/core/lib/Drupal/Core/Render/Element/Table.php @@ -20,7 +20,7 @@ * element. Table elements would contain rows elements that would in turn * contain column elements. * - #empty: Text to display when no rows are present. - * - #responsive: Indicates whether to add the drupal.responsive_table library + * - #responsive: Indicates whether to add the drupal.tableresponsive library * providing responsive tables. Defaults to TRUE. * - #sticky: Indicates whether to add the drupal.tableheader library that makes * table headers always visible at the top of the page. Defaults to FALSE. diff --git a/web/core/lib/Drupal/Core/Render/theme.api.php b/web/core/lib/Drupal/Core/Render/theme.api.php index 778e48524e75bdd677d0689c8c52921005c7d2f3..d4fe6469605399311ee9bc453ef3ecbc76566619 100644 --- a/web/core/lib/Drupal/Core/Render/theme.api.php +++ b/web/core/lib/Drupal/Core/Render/theme.api.php @@ -1131,7 +1131,7 @@ function hook_page_bottom(array &$page_bottom) { * - 'base_theme': A base theme is being checked for theme implementations. * - 'theme': The actual theme in use is being checked. * @param $theme - * The actual name of theme, module, etc. that is being being processed. + * The actual name of theme, module, etc. that is being processed. * @param $path * The directory path of the theme or module, so that it doesn't need to be * looked up. diff --git a/web/core/lib/Drupal/Core/Routing/RouteProvider.php b/web/core/lib/Drupal/Core/Routing/RouteProvider.php index 24c6f6ea057599a050eaf7fc1425df166068a7c9..5158f21011edd2204f62aefc69b341fbc6f304b2 100644 --- a/web/core/lib/Drupal/Core/Routing/RouteProvider.php +++ b/web/core/lib/Drupal/Core/Routing/RouteProvider.php @@ -310,7 +310,7 @@ protected function getCandidateOutlines(array $parts) { $current .= $parts[$length - $j]; } else { - // Bit zero means means wildcard. + // Bit zero means wildcard. $current .= '%'; } // Unless we are at offset 0, add a slash. diff --git a/web/core/lib/Drupal/Core/Routing/routing.api.php b/web/core/lib/Drupal/Core/Routing/routing.api.php index 19d36f21386d1da5bab078e57e6d4ff3eedaa6c8..d1239af2487b77dde7f4dd6560635fc65a5b71ef 100644 --- a/web/core/lib/Drupal/Core/Routing/routing.api.php +++ b/web/core/lib/Drupal/Core/Routing/routing.api.php @@ -13,7 +13,7 @@ * @section sec_overview Overview and terminology * The Drupal routing system defines how Drupal responds to URL requests that * the web server passes on to Drupal. The routing system is based on the - * @link http://symfony.com Symfony framework. @endlink The central idea is + * @link http://symfony.com Symfony routing system. @endlink The central idea is * that Drupal subsystems and modules can register routes (basically, URL * paths and context); they can also register to respond dynamically to * routes, for more flexibility. When Drupal receives a URL request, it will @@ -65,10 +65,10 @@ * - _entity_form: A form for editing an entity. See the * @link entity_api Entity API topic @endlink for more information. * - The 'requirements' section is used in Drupal to give access permission - * instructions (it has other uses in the Symfony framework). Most - * routes have a simple permission-based access scheme, as shown in this - * example. See the @link user_api Permission system topic @endlink for - * more information about permissions. + * instructions (it has other uses in Symfony components). Most routes have a + * simple permission-based access scheme, as shown in this example. See the + * @link user_api Permission system topic @endlink for more information about + * permissions. * * See https://www.drupal.org/node/2092643 for more details about *.routing.yml * files, and https://www.drupal.org/node/2122201 for information on how to diff --git a/web/core/lib/Drupal/Core/Url.php b/web/core/lib/Drupal/Core/Url.php index 226ab436e022fccdbfa714c9752e75cee23ce733..55c4dc7b2cac89eb719715f253e2e5e200341dbc 100644 --- a/web/core/lib/Drupal/Core/Url.php +++ b/web/core/lib/Drupal/Core/Url.php @@ -242,7 +242,7 @@ public static function fromUserInput($user_input, $options = []) { * you may use entity:{entity_type}/{entity_id} URIs. The internal: scheme * should be avoided except when processing actual user input that may or * may not correspond to a Drupal route. Normally use Url::fromRoute() for - * code linking to any any Drupal page. + * code linking to any Drupal page. * @param array $options * (optional) An associative array of additional URL options, with the * following elements: diff --git a/web/core/misc/date.es6.js b/web/core/misc/date.es6.js index a1862133f68d040b978bf95468554260047f2830..42f720ee1a67732d42ee6a6992f21d54099e8572 100644 --- a/web/core/misc/date.es6.js +++ b/web/core/misc/date.es6.js @@ -3,7 +3,7 @@ * Polyfill for HTML5 date input. */ -(function ($, Modernizr, Drupal, once) { +(function (Modernizr, Drupal, once) { /** * Attach datepicker fallback on date elements. * @@ -151,4 +151,4 @@ `<div class="no-native-datepicker-help"> <span id="${dateId}">${dateDesc}</span> <span id="${timeId}">${timeDesc}</span> </div>`; -})(jQuery, Modernizr, Drupal, once); +})(Modernizr, Drupal, once); diff --git a/web/core/misc/date.js b/web/core/misc/date.js index 4ae1e561986c057b8ae380c683a324aab3bbeee7..98548b1409d2c43b0137d0501c167fb111fd51b1 100644 --- a/web/core/misc/date.js +++ b/web/core/misc/date.js @@ -11,7 +11,7 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } -(function ($, Modernizr, Drupal, once) { +(function (Modernizr, Drupal, once) { Drupal.behaviors.date = { attach: function attach(context, settings) { if (Modernizr.inputtypes.date === false) { @@ -91,4 +91,4 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d timeDesc = _ref2.timeDesc; return "<div class=\"no-native-datepicker-help\">\n <span id=\"".concat(dateId, "\">").concat(dateDesc, "</span> <span id=\"").concat(timeId, "\">").concat(timeDesc, "</span>\n </div>"); }; -})(jQuery, Modernizr, Drupal, once); \ No newline at end of file +})(Modernizr, Drupal, once); \ No newline at end of file diff --git a/web/core/modules/aggregator/tests/src/Functional/FeedFetcherPluginTest.php b/web/core/modules/aggregator/tests/src/Functional/FeedFetcherPluginTest.php index 8bf1244e353ecdbc07365371635e2b4ed8b7e087..be18d4dc35cf77e12abaca00c6185590a170c270 100644 --- a/web/core/modules/aggregator/tests/src/Functional/FeedFetcherPluginTest.php +++ b/web/core/modules/aggregator/tests/src/Functional/FeedFetcherPluginTest.php @@ -34,7 +34,7 @@ public function testfetch() { // Create feed with local url. $feed = $this->createFeed(); $this->updateFeedItems($feed); - $this->assertFalse(empty($feed->items)); + $this->assertNotEmpty($feed->items); // Delete items and restore checked property to 0. $this->deleteFeedItems($feed); @@ -43,7 +43,7 @@ public function testfetch() { $feed->save(); $this->updateFeedItems($feed); // Fetch should fail due to feed name. - $this->assertTrue(empty($feed->items)); + $this->assertEmpty($feed->items); } } diff --git a/web/core/modules/aggregator/tests/src/Functional/FeedProcessorPluginTest.php b/web/core/modules/aggregator/tests/src/Functional/FeedProcessorPluginTest.php index fd13616ef10025ce3b32b383c2729538fdbf29de..5595a6a62c2326a7d5bd652f8817b58e4465cb41 100644 --- a/web/core/modules/aggregator/tests/src/Functional/FeedProcessorPluginTest.php +++ b/web/core/modules/aggregator/tests/src/Functional/FeedProcessorPluginTest.php @@ -51,7 +51,7 @@ public function testDelete() { $this->updateAndDelete($feed, NULL); // Make sure the feed title is changed. $entities = \Drupal::entityTypeManager()->getStorage('aggregator_feed')->loadByProperties(['description' => $description]); - $this->assertTrue(empty($entities)); + $this->assertEmpty($entities); } /** diff --git a/web/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php b/web/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php index dcb68b48430b3259ba3623ba2bcf1f9349541d40..5624904e4a4e1968d3022e16c8a9360518338f99 100644 --- a/web/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php +++ b/web/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php @@ -188,7 +188,7 @@ public function testBigPipe() { $this->assertSession()->responseContains('</body>'); // Verifying BigPipe assets are present. - $this->assertFalse(empty($this->getDrupalSettings()), 'drupalSettings present.'); + $this->assertNotEmpty($this->getDrupalSettings()); $this->assertContains('big_pipe/big_pipe', explode(',', $this->getDrupalSettings()['ajaxPageState']['libraries']), 'BigPipe asset library is present.'); // Verify that the two expected exceptions are logged as errors. @@ -506,12 +506,25 @@ protected function assertBigPipeNoJsMetaRefreshRedirect(): void { $this->assertEquals(302, $statuses[0], 'The first response was a 302 (redirect).'); $this->assertStringStartsWith('big_pipe_nojs=1', $headers[0]['Set-Cookie'][0], 'The first response sets the big_pipe_nojs cookie.'); $this->assertEquals($original_url, $headers[0]['Location'][0], 'The first response redirected back to the original page.'); - $this->assertTrue(empty(array_diff(['cookies:big_pipe_nojs', 'session.exists'], explode(' ', $headers[0]['X-Drupal-Cache-Contexts'][0]))), 'The first response varies by the "cookies:big_pipe_nojs" and "session.exists" cache contexts.'); + $this->assertEmpty( + array_diff([ + 'cookies:big_pipe_nojs', + 'session.exists', + ], explode(' ', $headers[0]['X-Drupal-Cache-Contexts'][0])), + 'The first response varies by the "cookies:big_pipe_nojs" and "session.exists" cache contexts.' + ); $this->assertFalse(isset($headers[0]['Surrogate-Control']), 'The first response has no "Surrogate-Control" header.'); // Second response: redirect followed. $this->assertEquals(200, $statuses[1], 'The second response was a 200.'); - $this->assertTrue(empty(array_diff(['cookies:big_pipe_nojs', 'session.exists'], explode(' ', $headers[0]['X-Drupal-Cache-Contexts'][0]))), 'The first response varies by the "cookies:big_pipe_nojs" and "session.exists" cache contexts.'); + $this->assertEmpty( + array_diff([ + 'cookies:big_pipe_nojs', + 'session.exists', + ], explode(' ', $headers[0]['X-Drupal-Cache-Contexts'][0])), + 'The second response varies by the "cookies:big_pipe_nojs" and "session.exists" cache contexts.' + ); + $this->assertEquals('no-store, content="BigPipe/1.0"', $headers[1]['Surrogate-Control'][0], 'The second response has a "Surrogate-Control" header.'); // Check that the <meta> refresh is absent, only one redirect ever happens. diff --git a/web/core/modules/block/migrations/d6_block.yml b/web/core/modules/block/migrations/d6_block.yml index 9091d534465a9cf268c09d874039103a18c7d667..5b0f76a88df8b33bc20f57625ce7a4a5c8e04eea 100644 --- a/web/core/modules/block/migrations/d6_block.yml +++ b/web/core/modules/block/migrations/d6_block.yml @@ -1,5 +1,6 @@ id: d6_block label: Blocks +# This configuration migration depends on the d6_custom_block content migration. migration_tags: - Drupal 6 - Configuration diff --git a/web/core/modules/block/migrations/d7_block.yml b/web/core/modules/block/migrations/d7_block.yml index 154f63528dc3cfe45d8ffbf841b9239551b21ecc..3b301ef0cd100812e9f02e4f1d6e7b880f113770 100644 --- a/web/core/modules/block/migrations/d7_block.yml +++ b/web/core/modules/block/migrations/d7_block.yml @@ -1,5 +1,6 @@ id: d7_block label: Blocks +# This configuration migration depends on the d7_custom_block content migration. migration_tags: - Drupal 7 - Configuration diff --git a/web/core/modules/block/tests/src/Functional/AssertBlockAppearsTrait.php b/web/core/modules/block/tests/src/Functional/AssertBlockAppearsTrait.php index ef3ebef2f6050e7333eccd41a76cecdc59399700..b229c6f23c157e3a38b7b66f0bab67814479b9ad 100644 --- a/web/core/modules/block/tests/src/Functional/AssertBlockAppearsTrait.php +++ b/web/core/modules/block/tests/src/Functional/AssertBlockAppearsTrait.php @@ -3,7 +3,6 @@ namespace Drupal\Tests\block\Functional; use Drupal\block\Entity\Block; -use Drupal\Component\Render\FormattableMarkup; /** * Provides test assertions for testing block appearance. @@ -20,7 +19,7 @@ trait AssertBlockAppearsTrait { */ protected function assertBlockAppears(Block $block) { $result = $this->findBlockInstance($block); - $this->assertTrue(!empty($result), new FormattableMarkup('The block @id appears on the page', ['@id' => $block->id()])); + $this->assertNotEmpty($result, sprintf('The block %s should appear on the page.', $block->id())); } /** @@ -31,7 +30,7 @@ protected function assertBlockAppears(Block $block) { */ protected function assertNoBlockAppears(Block $block) { $result = $this->findBlockInstance($block); - $this->assertFalse(!empty($result), new FormattableMarkup('The block @id does not appear on the page', ['@id' => $block->id()])); + $this->assertEmpty($result, sprintf('The block %s should not appear on the page.', $block->id())); } /** diff --git a/web/core/modules/block/tests/src/Functional/BlockHtmlTest.php b/web/core/modules/block/tests/src/Functional/BlockHtmlTest.php index f6e8a284194dbfc51d211a32c8894cf8f0bb0cb5..19223a887c91512be76e4ba93f83d03030c7e0e8 100644 --- a/web/core/modules/block/tests/src/Functional/BlockHtmlTest.php +++ b/web/core/modules/block/tests/src/Functional/BlockHtmlTest.php @@ -49,7 +49,7 @@ public function testHtml() { // Ensure expected markup for a menu block. $elements = $this->xpath('//nav[contains(@class, :nav-class)]/ul[contains(@class, :ul-class)]/li', [':nav-class' => 'block-menu', ':ul-class' => 'menu']); - $this->assertTrue(!empty($elements), 'The proper block markup was found.'); + $this->assertNotEmpty($elements, 'The proper block markup was found.'); } } diff --git a/web/core/modules/block/tests/src/Functional/BlockLanguageTest.php b/web/core/modules/block/tests/src/Functional/BlockLanguageTest.php index a55a0f47b716853fc4adb7a6363517db00f65e4d..a1380da619a03e45c37a8acaa337a4381c0635fb 100644 --- a/web/core/modules/block/tests/src/Functional/BlockLanguageTest.php +++ b/web/core/modules/block/tests/src/Functional/BlockLanguageTest.php @@ -116,13 +116,13 @@ public function testLanguageBlockVisibilityLanguageDelete() { // it is deleted. $block = Block::load($block->id()); $visibility = $block->getVisibility(); - $this->assertTrue(empty($visibility['language']['langcodes']['fr']), 'Language is no longer not set in the block configuration after deleting the block.'); + $this->assertArrayNotHasKey('language', $visibility, 'Language is no longer not set in the block configuration after deleting the block.'); // Ensure that the block visibility for language is gone from the UI. $this->drupalGet('admin/structure/block'); $this->clickLink('Configure'); $elements = $this->xpath('//details[@id="edit-visibility-language"]'); - $this->assertTrue(empty($elements)); + $this->assertEmpty($elements); } /** diff --git a/web/core/modules/block/tests/src/Functional/BlockSystemBrandingTest.php b/web/core/modules/block/tests/src/Functional/BlockSystemBrandingTest.php index 518e95717a4e52aa8e1a55d4c4223e500977183e..9e95d73b64a25429a12b5473e7bf79361435b822 100644 --- a/web/core/modules/block/tests/src/Functional/BlockSystemBrandingTest.php +++ b/web/core/modules/block/tests/src/Functional/BlockSystemBrandingTest.php @@ -48,9 +48,9 @@ public function testSystemBrandingSettings() { $site_name_element = $this->xpath($site_name_xpath); $site_slogan_element = $this->xpath($site_slogan_xpath); // Test that all branding elements are displayed. - $this->assertTrue(!empty($site_logo_element), 'The branding block logo was found.'); - $this->assertTrue(!empty($site_name_element), 'The branding block site name was found.'); - $this->assertTrue(!empty($site_slogan_element), 'The branding block slogan was found.'); + $this->assertNotEmpty($site_logo_element, 'The branding block logo was found.'); + $this->assertNotEmpty($site_name_element, 'The branding block site name was found.'); + $this->assertNotEmpty($site_slogan_element, 'The branding block slogan was found.'); $this->assertSession()->responseHeaderContains('X-Drupal-Cache-Tags', 'config:system.site'); // Be sure the slogan is XSS-filtered. @@ -70,9 +70,9 @@ public function testSystemBrandingSettings() { $site_name_element = $this->xpath($site_name_xpath); $site_slogan_element = $this->xpath($site_slogan_xpath); // Re-test all branding elements. - $this->assertTrue(empty($site_logo_element), 'The branding block logo was disabled.'); - $this->assertTrue(!empty($site_name_element), 'The branding block site name was found.'); - $this->assertTrue(!empty($site_slogan_element), 'The branding block slogan was found.'); + $this->assertEmpty($site_logo_element, 'The branding block logo was disabled.'); + $this->assertNotEmpty($site_name_element, 'The branding block site name was found.'); + $this->assertNotEmpty($site_slogan_element, 'The branding block slogan was found.'); $this->assertSession()->responseHeaderContains('X-Drupal-Cache-Tags', 'config:system.site'); // Turn just the site name off. @@ -85,9 +85,9 @@ public function testSystemBrandingSettings() { $site_name_element = $this->xpath($site_name_xpath); $site_slogan_element = $this->xpath($site_slogan_xpath); // Re-test all branding elements. - $this->assertTrue(!empty($site_logo_element), 'The branding block logo was found.'); - $this->assertTrue(empty($site_name_element), 'The branding block site name was disabled.'); - $this->assertTrue(!empty($site_slogan_element), 'The branding block slogan was found.'); + $this->assertNotEmpty($site_logo_element, 'The branding block logo was found.'); + $this->assertEmpty($site_name_element, 'The branding block site name was disabled.'); + $this->assertNotEmpty($site_slogan_element, 'The branding block slogan was found.'); $this->assertSession()->responseHeaderContains('X-Drupal-Cache-Tags', 'config:system.site'); // Turn just the site slogan off. @@ -100,9 +100,9 @@ public function testSystemBrandingSettings() { $site_name_element = $this->xpath($site_name_xpath); $site_slogan_element = $this->xpath($site_slogan_xpath); // Re-test all branding elements. - $this->assertTrue(!empty($site_logo_element), 'The branding block logo was found.'); - $this->assertTrue(!empty($site_name_element), 'The branding block site name was found.'); - $this->assertTrue(empty($site_slogan_element), 'The branding block slogan was disabled.'); + $this->assertNotEmpty($site_logo_element, 'The branding block logo was found.'); + $this->assertNotEmpty($site_name_element, 'The branding block site name was found.'); + $this->assertEmpty($site_slogan_element, 'The branding block slogan was disabled.'); $this->assertSession()->responseHeaderContains('X-Drupal-Cache-Tags', 'config:system.site'); // Turn the site name and the site slogan off. @@ -115,9 +115,9 @@ public function testSystemBrandingSettings() { $site_name_element = $this->xpath($site_name_xpath); $site_slogan_element = $this->xpath($site_slogan_xpath); // Re-test all branding elements. - $this->assertTrue(!empty($site_logo_element), 'The branding block logo was found.'); - $this->assertTrue(empty($site_name_element), 'The branding block site name was disabled.'); - $this->assertTrue(empty($site_slogan_element), 'The branding block slogan was disabled.'); + $this->assertNotEmpty($site_logo_element, 'The branding block logo was found.'); + $this->assertEmpty($site_name_element, 'The branding block site name was disabled.'); + $this->assertEmpty($site_slogan_element, 'The branding block slogan was disabled.'); $this->assertSession()->responseHeaderContains('X-Drupal-Cache-Tags', 'config:system.site'); } diff --git a/web/core/modules/block/tests/src/Functional/BlockUiTest.php b/web/core/modules/block/tests/src/Functional/BlockUiTest.php index 5618a05e5b7a0253718c83a27bbb91b977dd5bf6..a7790c96ef4896ec67104fed0c1467a7c1e08f41 100644 --- a/web/core/modules/block/tests/src/Functional/BlockUiTest.php +++ b/web/core/modules/block/tests/src/Functional/BlockUiTest.php @@ -114,7 +114,7 @@ public function testBlockAdminUiPage() { $this->drupalGet('admin/structure/block'); // Look for the blocks table. $blocks_table = $this->xpath("//table[@id='blocks']"); - $this->assertTrue(!empty($blocks_table), 'The blocks table is being rendered.'); + $this->assertNotEmpty($blocks_table, 'The blocks table is being rendered.'); // Look for test blocks in the table. foreach ($this->blockValues as $delta => $values) { $block = $this->blocks[$delta]; @@ -142,7 +142,7 @@ public function testBlockAdminUiPage() { $this->drupalPlaceBlock('system_powered_by_block', ['region' => 'header', 'id' => 'header']); $this->drupalGet('admin/structure/block'); $element = $this->xpath('//tr[contains(@class, :class)]', [':class' => 'region-title-header']); - $this->assertTrue(!empty($element)); + $this->assertNotEmpty($element); // Ensure hidden themes do not appear in the UI. Enable another non base // theme and place the local tasks block. @@ -184,7 +184,7 @@ public function testCandidateBlockList() { $this->drupalGet('admin/structure/block'); $this->clickLink('Place block'); $elements = $this->xpath($pattern, $arguments); - $this->assertTrue(!empty($elements), 'The test block appears in the category for its module.'); + $this->assertNotEmpty($elements, 'The test block appears in the category for its module.'); // Trigger the custom category addition in block_test_block_alter(). $this->container->get('state')->set('block_test_info_alter', TRUE); @@ -194,7 +194,7 @@ public function testCandidateBlockList() { $this->clickLink('Place block'); $arguments[':category'] = 'Custom category'; $elements = $this->xpath($pattern, $arguments); - $this->assertTrue(!empty($elements), 'The test block appears in a custom category controlled by block_test_block_alter().'); + $this->assertNotEmpty($elements, 'The test block appears in a custom category controlled by block_test_block_alter().'); } /** @@ -207,7 +207,7 @@ public function testContextAwareUnsatisfiedBlocks() { $this->assertSession()->elementNotExists('xpath', '//tr[.//td/div[text()="Test context-aware unsatisfied block"] and .//td[text()="Block test"] and .//td//a[contains(@href, "admin/structure/block/add/test_context_aware_unsatisfied/classy")]]'); $definition = \Drupal::service('plugin.manager.block')->getDefinition('test_context_aware_unsatisfied'); - $this->assertTrue(!empty($definition), 'The context-aware test block does not exist.'); + $this->assertNotEmpty($definition, 'The context-aware test block does not exist.'); } /** @@ -230,9 +230,9 @@ public function testContextAwareBlocks() { $this->drupalGet('admin/structure/block'); $this->clickLink('Place block'); $elements = $this->xpath($pattern, $arguments); - $this->assertTrue(!empty($elements), 'The context-aware test block appears.'); + $this->assertNotEmpty($elements, 'The context-aware test block appears.'); $definition = \Drupal::service('plugin.manager.block')->getDefinition('test_context_aware'); - $this->assertTrue(!empty($definition), 'The context-aware test block exists.'); + $this->assertNotEmpty($definition, 'The context-aware test block exists.'); $edit = [ 'region' => 'content', 'settings[context_mapping][user]' => '@block_test.multiple_static_context:userB', 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 6d56f6bea0db0063e5797eb7e79c5cf2da23288d..c3f0b15ac859c9d438b84825a27416e0e515421b 100644 --- a/web/core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php +++ b/web/core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php @@ -214,7 +214,7 @@ public function testViewsBlockForm() { $block = $storage->load('views_block__test_view_block_block_1'); // This will only return a result if our new block has been created with the // expected machine name. - $this->assertTrue(!empty($block), 'The expected block was loaded.'); + $this->assertNotEmpty($block, 'The expected block was loaded.'); for ($i = 2; $i <= 3; $i++) { // Place the same block again and make sure we have a new ID. @@ -223,7 +223,7 @@ public function testViewsBlockForm() { $block = $storage->load('views_block__test_view_block_block_1_' . $i); // This will only return a result if our new block has been created with the // expected machine name. - $this->assertTrue(!empty($block), 'The expected block was loaded.'); + $this->assertNotEmpty($block, 'The expected block was loaded.'); } // Tests the override capability of items per page. diff --git a/web/core/modules/block/tests/src/Kernel/BlockStorageUnitTest.php b/web/core/modules/block/tests/src/Kernel/BlockStorageUnitTest.php index 26b0b6354743aab598db7747eb5533434a1981a0..a32aa61a15af8a1e05f2091377cfcf51867c7501 100644 --- a/web/core/modules/block/tests/src/Kernel/BlockStorageUnitTest.php +++ b/web/core/modules/block/tests/src/Kernel/BlockStorageUnitTest.php @@ -77,7 +77,7 @@ protected function createTests() { // Verify all of the block properties. $actual_properties = $this->config('block.block.test_block')->get(); - $this->assertTrue(!empty($actual_properties['uuid']), 'The block UUID is set.'); + $this->assertNotEmpty($actual_properties['uuid'], 'The block UUID is set.'); unset($actual_properties['uuid']); // Ensure that default values are filled in. @@ -129,14 +129,14 @@ protected function deleteTests() { // Ensure that the storage isn't currently empty. $config_storage = $this->container->get('config.storage'); $config = $config_storage->listAll('block.block.'); - $this->assertFalse(empty($config), 'There are blocks in config storage.'); + $this->assertNotEmpty($config, 'There are blocks in config storage.'); // Delete the block. $entity->delete(); // Ensure that the storage is now empty. $config = $config_storage->listAll('block.block.'); - $this->assertTrue(empty($config), 'There are no blocks in config storage.'); + $this->assertEmpty($config, 'There are no blocks in config storage.'); } /** @@ -145,7 +145,7 @@ protected function deleteTests() { public function testDefaultBlocks() { \Drupal::service('theme_installer')->install(['classy']); $entities = $this->controller->loadMultiple(); - $this->assertTrue(empty($entities), 'There are no blocks initially.'); + $this->assertEmpty($entities, 'There are no blocks initially.'); // Install the block_test.module, so that its default config is installed. $this->installConfig(['block_test']); diff --git a/web/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php b/web/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php index a9f31b4ca3d88a09484298091e5b3f8f15b6619f..0e0117e8b25779e9bca56d7f221df632ace918cb 100644 --- a/web/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php +++ b/web/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php @@ -167,7 +167,7 @@ public function testBlockMigration() { 'seven_statistics_popular', 'seven_block_1', ]; - $this->assertTrue(empty(Block::loadMultiple($non_existent_blocks))); + $this->assertEmpty(Block::loadMultiple($non_existent_blocks)); } } diff --git a/web/core/modules/book/tests/src/Functional/BookBreadcrumbTest.php b/web/core/modules/book/tests/src/Functional/BookBreadcrumbTest.php index 365a438363b5f7411d615e84314ca48c26dca344..0ecb7748a715bc908c11a07c2382e6e44666564b 100644 --- a/web/core/modules/book/tests/src/Functional/BookBreadcrumbTest.php +++ b/web/core/modules/book/tests/src/Functional/BookBreadcrumbTest.php @@ -141,7 +141,7 @@ protected function createBookNode($book_nid, $parent = NULL) { $this->submitForm($edit, 'Save'); // Make sure the parent was flagged as having children. $parent_node = \Drupal::entityTypeManager()->getStorage('node')->loadUnchanged($parent); - $this->assertFalse(empty($parent_node->book['has_children']), 'Parent node is marked as having children'); + $this->assertNotEmpty($parent_node->book['has_children'], 'Parent node is marked as having children'); } else { $this->drupalGet('node/add/book'); diff --git a/web/core/modules/book/tests/src/Functional/BookTest.php b/web/core/modules/book/tests/src/Functional/BookTest.php index 15366c4f5a07d4bef6629834c21f59fa6aa174ad..230125f28c07580f03b386c4ab7697b3044c7f3e 100644 --- a/web/core/modules/book/tests/src/Functional/BookTest.php +++ b/web/core/modules/book/tests/src/Functional/BookTest.php @@ -440,7 +440,7 @@ public function testBookDelete() { $this->submitForm($edit, 'Remove'); $node_storage->resetCache([$nodes[4]->id()]); $node4 = $node_storage->load($nodes[4]->id()); - $this->assertTrue(empty($node4->book), 'Deleting child book node properly allowed.'); + $this->assertEmpty($node4->book, 'Deleting child book node properly allowed.'); // $nodes[4] is stale, trying to delete it directly will cause an error. $node4->delete(); @@ -453,7 +453,7 @@ public function testBookDelete() { $this->submitForm($edit, 'Remove'); $node_storage->resetCache([$this->book->id()]); $node = $node_storage->load($this->book->id()); - $this->assertTrue(empty($node->book), 'Deleting childless top-level book node properly allowed.'); + $this->assertEmpty($node->book, 'Deleting childless top-level book node properly allowed.'); // Tests directly deleting a book parent. $nodes = $this->createBook(); @@ -681,7 +681,7 @@ public function testHookNodeLoadAccess() { // @see node_access_test_node_grants(). $this->drupalLogin($this->webUserWithoutNodeAccess); $book_node = $node_storage->load($this->book->id()); - $this->assertTrue(!empty($book_node->book)); + $this->assertNotEmpty($book_node->book); $this->assertEquals($this->book->id(), $book_node->book['bid']); // Reset the internal cache to retrigger the hook_node_load() call. @@ -689,7 +689,7 @@ public function testHookNodeLoadAccess() { $this->drupalLogin($this->webUser); $book_node = $node_storage->load($this->book->id()); - $this->assertTrue(!empty($book_node->book)); + $this->assertNotEmpty($book_node->book); $this->assertEquals($this->book->id(), $book_node->book['bid']); } diff --git a/web/core/modules/book/tests/src/Functional/BookTestTrait.php b/web/core/modules/book/tests/src/Functional/BookTestTrait.php index 508fafab4c138c9538b184766b4021fd1a5ea21d..724feea3605ebb7fba5a8f7bebe7313854f22c51 100644 --- a/web/core/modules/book/tests/src/Functional/BookTestTrait.php +++ b/web/core/modules/book/tests/src/Functional/BookTestTrait.php @@ -198,7 +198,7 @@ public function createBookNode($book_nid, $parent = NULL, $edit = []) { $this->submitForm($edit, 'Save'); // Make sure the parent was flagged as having children. $parent_node = \Drupal::entityTypeManager()->getStorage('node')->loadUnchanged($parent); - $this->assertFalse(empty($parent_node->book['has_children']), 'Parent node is marked as having children'); + $this->assertNotEmpty($parent_node->book['has_children'], 'Parent node is marked as having children'); } else { $this->drupalGet('node/add/book'); 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 410adf3f9a118fdc3745fd6f8d10ba52ebda49ca..5051f0a81eb6ca1744dd10bb2ce02e17a7c0ed6a 100644 --- a/web/core/modules/book/tests/src/Functional/Views/BookRelationshipTest.php +++ b/web/core/modules/book/tests/src/Functional/Views/BookRelationshipTest.php @@ -128,7 +128,7 @@ protected function createBookNode($book_nid, $parent = NULL) { $this->submitForm($edit, 'Save'); // Make sure the parent was flagged as having children. $parent_node = \Drupal::entityTypeManager()->getStorage('node')->loadUnchanged($parent); - $this->assertFalse(empty($parent_node->book['has_children']), 'Parent node is marked as having children'); + $this->assertNotEmpty($parent_node->book['has_children'], 'Parent node is marked as having children'); } else { $this->drupalGet('node/add/book'); diff --git a/web/core/modules/ckeditor/tests/src/Kernel/CKEditorTest.php b/web/core/modules/ckeditor/tests/src/Kernel/CKEditorTest.php index 3f852ef8e31301b163c1b5192539f3f381157f3f..aea21f6847c576e79c0c02bed5b7f94bc3acc4ce 100644 --- a/web/core/modules/ckeditor/tests/src/Kernel/CKEditorTest.php +++ b/web/core/modules/ckeditor/tests/src/Kernel/CKEditorTest.php @@ -422,7 +422,7 @@ public function testJSTranslation() { $this->ckeditor->getJSSettings($editor); $localeStorage = $this->container->get('locale.storage'); $string = $localeStorage->findString(['source' => 'Edit Link', 'context' => '']); - $this->assertTrue(!empty($string), 'String from JavaScript file saved.'); + $this->assertNotEmpty($string, 'String from JavaScript file saved.'); // With locale module, CKEditor should not adhere to the language selected. $this->assertCKEditorLanguage(); diff --git a/web/core/modules/comment/src/CommentStorage.php b/web/core/modules/comment/src/CommentStorage.php index 1b2c1b843ac9a01c983a46694ecd21cb12987205..6bf70252189c5dc7f1f7e2eaa77e894de16fd86f 100644 --- a/web/core/modules/comment/src/CommentStorage.php +++ b/web/core/modules/comment/src/CommentStorage.php @@ -319,9 +319,8 @@ public function loadThread(EntityInterface $entity, $field_name, $mode, $comment $query->orderBy('c.cid', 'ASC'); } else { - // See comment above. Analysis reveals that this doesn't cost too - // much. It scales much much better than having the whole comment - // structure. + // See comment above. Analysis reveals that this doesn't cost too much. It + // scales much better than having the whole comment structure. $query->addExpression('SUBSTRING([c].[thread], 1, (LENGTH([c].[thread]) - 1))', 'torder'); $query->orderBy('torder', 'ASC'); } diff --git a/web/core/modules/comment/tests/src/Functional/CommentFieldsTest.php b/web/core/modules/comment/tests/src/Functional/CommentFieldsTest.php index 71780ada8786d5e8bac95a48dfc361bb324f63ca..7b005eaeb399191572c09e4db41b5845834707f4 100644 --- a/web/core/modules/comment/tests/src/Functional/CommentFieldsTest.php +++ b/web/core/modules/comment/tests/src/Functional/CommentFieldsTest.php @@ -38,7 +38,7 @@ public function testCommentDefaultFields() { // Check that the 'comment_body' field is present on the comment bundle. $field = FieldConfig::loadByName('comment', 'comment', 'comment_body'); - $this->assertTrue(!empty($field), 'The comment_body field is added when a comment bundle is created'); + $this->assertNotEmpty($field, 'The comment_body field is added when a comment bundle is created'); $field->delete(); diff --git a/web/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php b/web/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php index 1440743eb19a9d1de17276601fb0643c98b79803..6631b26f91071a722e88ade5acd0df09396c7185 100644 --- a/web/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php +++ b/web/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php @@ -92,7 +92,7 @@ public function testCommentInterface() { ]; $pattern_permalink = '//footer[contains(@class,"comment__meta")]/a[contains(@href,:link) and text()="Permalink"]'; $permalink = $this->xpath($pattern_permalink, $arguments); - $this->assertTrue(!empty($permalink), 'Permalink link found.'); + $this->assertNotEmpty($permalink, 'Permalink link found.'); // Set comments to have subject and preview to optional. $this->drupalLogout(); @@ -317,7 +317,7 @@ public function testViewMode() { // Comment displayed in 'default' display mode found and has body text. $comment_element = $this->cssSelect('.comment-wrapper'); - $this->assertTrue(!empty($comment_element)); + $this->assertNotEmpty($comment_element); $this->assertSession()->responseContains('<p>' . $comment_text . '</p>'); // Create a new comment entity view mode. @@ -350,7 +350,7 @@ public function testViewMode() { // The comment should exist but without the body text because we used $mode // mode this time. $comment_element = $this->cssSelect('.comment-wrapper'); - $this->assertTrue(!empty($comment_element)); + $this->assertNotEmpty($comment_element); $this->assertSession()->responseNotContains('<p>' . $comment_text . '</p>'); } diff --git a/web/core/modules/comment/tests/src/Functional/CommentTestBase.php b/web/core/modules/comment/tests/src/Functional/CommentTestBase.php index 9b44b420959c33a9e28467d3a0feab229070ff21..d139683925aa97b5ec85af2c01cd0d9ab27962d2 100644 --- a/web/core/modules/comment/tests/src/Functional/CommentTestBase.php +++ b/web/core/modules/comment/tests/src/Functional/CommentTestBase.php @@ -391,7 +391,7 @@ public function getUnapprovedComment($subject) { } /** - * Creates a comment comment type (bundle). + * Creates a comment type (bundle). * * @param string $label * The comment type label. diff --git a/web/core/modules/comment/tests/src/Kernel/Views/CommentUserNameTest.php b/web/core/modules/comment/tests/src/Kernel/Views/CommentUserNameTest.php index 099db671d4ebb234fd10a74236f6d2a8f57560b3..e65be6c6b584bb812158a9d47131a45eb2846e4c 100644 --- a/web/core/modules/comment/tests/src/Kernel/Views/CommentUserNameTest.php +++ b/web/core/modules/comment/tests/src/Kernel/Views/CommentUserNameTest.php @@ -158,7 +158,7 @@ public function testUsername() { $comment_author = $this->xpath('//div[contains(@class, :class)]/span[normalize-space(text())=""]', [ ':class' => 'views-field-subject', ]); - $this->assertTrue(!empty($comment_author)); + $this->assertNotEmpty($comment_author); // When comment belongs to an anonymous user the name field has a value and // it is rendered correctly. $this->assertLink('barry (not verified)'); diff --git a/web/core/modules/config/tests/src/Functional/ConfigImportUITest.php b/web/core/modules/config/tests/src/Functional/ConfigImportUITest.php index 5e4bdd1d13d7186ca4887dbf41f046708a2bf734..a2078e6d30a80577f785e83c3c764dafd52e7acb 100644 --- a/web/core/modules/config/tests/src/Functional/ConfigImportUITest.php +++ b/web/core/modules/config/tests/src/Functional/ConfigImportUITest.php @@ -162,7 +162,7 @@ public function testImport() { $uninstalled = \Drupal::state()->get('ConfigImportUITest.core.extension.modules_uninstalled', []); $expected = ['automated_cron', 'ban', 'text', 'options']; $this->assertSame($expected, $installed, 'Automated Cron, Ban, Text and Options modules installed in the correct order.'); - $this->assertTrue(empty($uninstalled), 'No modules uninstalled during import'); + $this->assertEmpty($uninstalled, 'No modules uninstalled during import'); // Verify that the automated_cron configuration object was only written // once during the import process and only with the value set in the staged @@ -218,7 +218,7 @@ public function testImport() { $uninstalled = \Drupal::state()->get('ConfigImportUITest.core.extension.modules_uninstalled', []); $expected = ['options', 'text', 'ban', 'automated_cron']; $this->assertSame($expected, $uninstalled, 'Options, Text, Ban and Automated Cron modules uninstalled in the correct order.'); - $this->assertTrue(empty($installed), 'No modules installed during import'); + $this->assertEmpty($installed, 'No modules installed during import'); $theme_info = \Drupal::service('theme_handler')->listInfo(); $this->assertFalse(isset($theme_info['bartik']), 'Bartik theme uninstalled during import.'); 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 1fd76ccaff37dfec35c666171698a87571fb5e4f..42d54b21efe81eed2c735194799eced8c5727479 100644 --- a/web/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php +++ b/web/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php @@ -3,7 +3,6 @@ namespace Drupal\Tests\config_translation\Functional; use Drupal\Component\Utility\Html; -use Drupal\Component\Render\FormattableMarkup; use Drupal\Core\Language\Language; use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Test\AssertMailTrait; @@ -843,7 +842,7 @@ public function testLocaleDBStorage() { // Make sure there is no translation stored in locale storage before edit. $translation = $this->getTranslation('user.settings', 'anonymous', 'fr'); - $this->assertTrue(empty($translation)); + $this->assertEmpty($translation); // Add custom translation. $edit = [ @@ -1124,12 +1123,12 @@ public function testMenuTranslationWithoutChange() { */ protected function getTranslation($config_name, $key, $langcode) { $settings_locations = $this->localeStorage->getLocations(['type' => 'configuration', 'name' => $config_name]); - $this->assertTrue(!empty($settings_locations), new FormattableMarkup('Configuration locations found for %config_name.', ['%config_name' => $config_name])); + $this->assertNotEmpty($settings_locations, "$config_name should have configuration locations."); if (!empty($settings_locations)) { $source = $this->container->get('config.factory')->get($config_name)->get($key); $source_string = $this->localeStorage->findString(['source' => $source, 'type' => 'configuration']); - $this->assertTrue(!empty($source_string), new FormattableMarkup('Found string for %config_name.%key.', ['%config_name' => $config_name, '%key' => $key])); + $this->assertNotEmpty($source_string, "$config_name.$key should have a source string."); if (!empty($source_string)) { $conditions = [ diff --git a/web/core/modules/content_moderation/src/Form/ContentModerationConfigureForm.php b/web/core/modules/content_moderation/src/Form/ContentModerationConfigureForm.php index 301932f46c39abb70ce6c1f9118342ea7ebf22cd..c2c85892ade9e0c99a44ae42ee5cc472aee24428 100644 --- a/web/core/modules/content_moderation/src/Form/ContentModerationConfigureForm.php +++ b/web/core/modules/content_moderation/src/Form/ContentModerationConfigureForm.php @@ -35,7 +35,7 @@ class ContentModerationConfigureForm extends WorkflowTypeConfigureFormBase imple protected $moderationInfo; /** - * The entity type type bundle info service. + * The entity type bundle info service. * * @var \Drupal\Core\Entity\EntityTypeBundleInfoInterface */ diff --git a/web/core/modules/content_translation/tests/src/Functional/ContentTranslationSyncImageTest.php b/web/core/modules/content_translation/tests/src/Functional/ContentTranslationSyncImageTest.php index 4ff54ff0430d0d1895865fb7a3e8cd0537f29b5a..54da60b9e9de854c1042df2d99087711abf73d5f 100644 --- a/web/core/modules/content_translation/tests/src/Functional/ContentTranslationSyncImageTest.php +++ b/web/core/modules/content_translation/tests/src/Functional/ContentTranslationSyncImageTest.php @@ -97,7 +97,7 @@ protected function getEditorPermissions() { } /** - * Tests image field field synchronization. + * Tests image field synchronization. */ public function testImageFieldSync() { // Check that the alt and title fields are enabled for the image field. diff --git a/web/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php b/web/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php index 17f70fc4b67c11807340da4c0250bc0bbf2991c2..7355414411060e1b9407dc0efff2b1c3221faf9d 100644 --- a/web/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php +++ b/web/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php @@ -776,7 +776,7 @@ public function testDefaultValue() { // Check if default_date has been stored successfully. $config_entity = $this->config('field.field.node.date_content.' . $field_name) ->get(); - $this->assertTrue(empty($config_entity['default_value']), 'Empty default value has been stored successfully'); + $this->assertEmpty($config_entity['default_value'], 'Empty default value has been stored successfully'); // Clear field cache in order to avoid stale cache values. \Drupal::service('entity_field.manager')->clearCachedFieldDefinitions(); diff --git a/web/core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php b/web/core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php index d6c4e0cb7728b57d8250380e9c5589ae71890d64..3d323450b8df61c0d0571f9dd3552d6015cfd44a 100644 --- a/web/core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php +++ b/web/core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php @@ -1118,7 +1118,7 @@ public function testDefaultValue() { // Check if default_date has been stored successfully. $config_entity = $this->config('field.field.node.date_content.' . $field_name)->get(); - $this->assertTrue(empty($config_entity['default_value']), 'Empty default value has been stored successfully'); + $this->assertEmpty($config_entity['default_value'], 'Empty default value has been stored successfully'); // Clear field cache in order to avoid stale cache values. \Drupal::service('entity_field.manager')->clearCachedFieldDefinitions(); diff --git a/web/core/modules/field/migrations/d7_field_formatter_settings.yml b/web/core/modules/field/migrations/d7_field_formatter_settings.yml index aba87892bcce42a7823e4ee46eddcf6fb55bd234..2aa348efdc670f92c77cf82e506ee69fb966a7c6 100644 --- a/web/core/modules/field/migrations/d7_field_formatter_settings.yml +++ b/web/core/modules/field/migrations/d7_field_formatter_settings.yml @@ -29,7 +29,7 @@ process: entity_type: entity_type # The bundle needs to be statically mapped in order to support comment types # that might already exist before this migration is run. See - # d7_comment_type.yml or more information. + # d7_comment_type.yml for more information. bundle: - plugin: migration_lookup diff --git a/web/core/modules/field/tests/src/Functional/Views/FieldUITest.php b/web/core/modules/field/tests/src/Functional/Views/FieldUITest.php index 07ab03d177a6b80622e18e6c5776236ee08e0a50..cf4cb50822d19dc7e069510b76691fc3ee731c82 100644 --- a/web/core/modules/field/tests/src/Functional/Views/FieldUITest.php +++ b/web/core/modules/field/tests/src/Functional/Views/FieldUITest.php @@ -7,7 +7,7 @@ use Drupal\views\Views; /** - * Tests the UI of the field field handler. + * Tests the UI of the field handler. * * @group field * @see \Drupal\field\Plugin\views\field\Field diff --git a/web/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceItemTest.php b/web/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceItemTest.php index 027d0eb7640bbdc513254b611d147d40b0db15fa..10fda5adc58467dabae02c7fcdf128f631cfbf97 100644 --- a/web/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceItemTest.php +++ b/web/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceItemTest.php @@ -347,7 +347,7 @@ public function testEntitySaveOrder() { $entity->name->value = $this->randomMachineName(); // Now get the field value. $value = $entity->get('field_test_taxonomy_term'); - $this->assertTrue(empty($value['target_id'])); + $this->assertArrayNotHasKey('target_id', $value); $this->assertNull($entity->field_test_taxonomy_term->target_id); // And then set it. $entity->field_test_taxonomy_term = $value; diff --git a/web/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceSettingsTest.php b/web/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceSettingsTest.php index 715839cacc1d6145dd18cd353c50e5c604533718..6850eeae370b18be01f674b07d41814fb413d9a6 100644 --- a/web/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceSettingsTest.php +++ b/web/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceSettingsTest.php @@ -177,7 +177,7 @@ public function testCustomTargetBundleDeletion() { // 'target_bundles' field setting. $field_config = FieldConfig::loadByName('node', $this->nodeType->id(), $name); $handler_settings = $field_config->getSetting('handler_settings'); - $this->assertTrue(empty($handler_settings['target_bundles'])); + $this->assertEmpty($handler_settings['target_bundles']); } /** diff --git a/web/core/modules/field/tests/src/Kernel/FieldAttachStorageTest.php b/web/core/modules/field/tests/src/Kernel/FieldAttachStorageTest.php index d46815f006d3422c83492d238f909524b8d2dc30..1ae8620840641f3202827273d8469b564ffae92a 100644 --- a/web/core/modules/field/tests/src/Kernel/FieldAttachStorageTest.php +++ b/web/core/modules/field/tests/src/Kernel/FieldAttachStorageTest.php @@ -365,8 +365,8 @@ public function testEntityDeleteBundle() { $controller->resetCache(); $entity = $controller->load($entity->id()); - $this->assertTrue(empty($entity->{$this->fieldTestData->field_name}), 'No data for first field'); - $this->assertTrue(empty($entity->{$field_name}), 'No data for second field'); + $this->assertEmpty($entity->{$this->fieldTestData->field_name}, 'No data for first field'); + $this->assertEmpty($entity->{$field_name}, 'No data for second field'); // Verify that the fields are gone. $this->assertNull(FieldConfig::load('entity_test.' . $this->fieldTestData->field->getTargetBundle() . '.' . $this->fieldTestData->field_name), "First field is deleted"); diff --git a/web/core/modules/field/tests/src/Kernel/FieldImportDeleteTest.php b/web/core/modules/field/tests/src/Kernel/FieldImportDeleteTest.php index 85653e2d7f3dda1cad0b06796c8b6dcae3026a11..10a972abc5ce71ec4ee46edaff6412100dee282b 100644 --- a/web/core/modules/field/tests/src/Kernel/FieldImportDeleteTest.php +++ b/web/core/modules/field/tests/src/Kernel/FieldImportDeleteTest.php @@ -115,7 +115,7 @@ public function testImportDelete() { // completely removed once the data is purged. field_purge_batch(10); $deleted_storages = \Drupal::state()->get('field.storage.deleted', []); - $this->assertTrue(empty($deleted_storages), 'Fields are deleted'); + $this->assertEmpty($deleted_storages, 'Fields are deleted'); } } diff --git a/web/core/modules/field/tests/src/Kernel/FieldStorageCrudTest.php b/web/core/modules/field/tests/src/Kernel/FieldStorageCrudTest.php index a73f22dc72dd892d89bf84ce0c4655e6d23eb50b..266f20910e0703d565eb7bb5da3f59a5caa7c401 100644 --- a/web/core/modules/field/tests/src/Kernel/FieldStorageCrudTest.php +++ b/web/core/modules/field/tests/src/Kernel/FieldStorageCrudTest.php @@ -227,7 +227,7 @@ public function testRead() { $this->assertCount(1, $fields, 'The field was properly read.'); $this->assertArrayHasKey($id, $fields, 'The field has the correct key.'); $fields = $field_storage_config_storage->loadByProperties(['field_name' => $field_storage_definition['field_name'], 'type' => 'foo']); - $this->assertTrue(empty($fields), 'No field was found.'); + $this->assertEmpty($fields, 'No field was found.'); // Create a field from the field storage. $field_definition = [ @@ -337,11 +337,11 @@ public function testDeleteNoData() { // Try to load the storage normally and make sure it does not show up. $field_storage = FieldStorageConfig::load('entity_test.' . $field_storage_definition['field_name']); - $this->assertTrue(empty($field_storage), 'Field storage was deleted'); + $this->assertEmpty($field_storage, 'Field storage was deleted'); // Try to load the field normally and make sure it does not show up. $field = FieldConfig::load('entity_test.' . '.' . $field_definition['bundle'] . '.' . $field_definition['field_name']); - $this->assertTrue(empty($field), 'Field was deleted'); + $this->assertEmpty($field, 'Field was deleted'); // Make sure the other field and its storage are not deleted. $another_field_storage = FieldStorageConfig::load('entity_test.' . $another_field_storage_definition['field_name']); diff --git a/web/core/modules/field/tests/src/Kernel/Number/NumberItemTest.php b/web/core/modules/field/tests/src/Kernel/Number/NumberItemTest.php index b35c2978f1a950c417fbdfca1de063a4f0c7ba79..8e0316425d68c5ec5c7a586d9dc903178048d9ad 100644 --- a/web/core/modules/field/tests/src/Kernel/Number/NumberItemTest.php +++ b/web/core/modules/field/tests/src/Kernel/Number/NumberItemTest.php @@ -95,9 +95,28 @@ public function testNumberItem() { // Test sample item generation. $entity = EntityTest::create(); + + // Make sure that field settings are respected by the generation. + $entity->field_decimal + ->getFieldDefinition() + ->setSetting('min', 99) + ->setSetting('max', 100); + + $entity->field_float + ->getFieldDefinition() + ->setSetting('min', 99) + ->setSetting('max', 100); + + $entity->field_integer + ->getFieldDefinition() + ->setSetting('min', 99) + ->setSetting('max', 100); + + $entity->field_decimal->generateSampleItems(); $entity->field_integer->generateSampleItems(); $entity->field_float->generateSampleItems(); - $entity->field_decimal->generateSampleItems(); + + // Confirm that the generated sample values are within range. $this->entityValidateAndSave($entity); } diff --git a/web/core/modules/field/tests/src/Kernel/ShapeItemTest.php b/web/core/modules/field/tests/src/Kernel/ShapeItemTest.php index cab3873bddf259bf8eac4969c5045f7f31328398..8b3259820684ed1d3bdde56085c8e60be2f05868 100644 --- a/web/core/modules/field/tests/src/Kernel/ShapeItemTest.php +++ b/web/core/modules/field/tests/src/Kernel/ShapeItemTest.php @@ -46,7 +46,7 @@ protected function setUp(): void { } /** - * Tests using entity fields of the field field type. + * Tests using entity fields of the shape field type. */ public function testShapeItem() { // Verify entity creation. diff --git a/web/core/modules/field/tests/src/Kernel/TestItemTest.php b/web/core/modules/field/tests/src/Kernel/TestItemTest.php index 5ca31551a2aef14ac5dfb79ea6ac31860ee525d7..7cbe6ea82cab1e57c2c14befe5980d50ee9bba6d 100644 --- a/web/core/modules/field/tests/src/Kernel/TestItemTest.php +++ b/web/core/modules/field/tests/src/Kernel/TestItemTest.php @@ -47,7 +47,7 @@ protected function setUp(): void { } /** - * Tests using entity fields of the field field type. + * Tests using entity fields of the test field type. */ public function testTestItem() { // Verify entity creation. diff --git a/web/core/modules/field_ui/src/Element/FieldUiTable.php b/web/core/modules/field_ui/src/Element/FieldUiTable.php index 8dee40d7333a8703f7dbbdada0a9ccd2e9253676..f921398d04e07cb087b786b339d6c3a6d1853cb9 100644 --- a/web/core/modules/field_ui/src/Element/FieldUiTable.php +++ b/web/core/modules/field_ui/src/Element/FieldUiTable.php @@ -225,7 +225,7 @@ public static function preRenderRegionRows($elements) { */ public static function reduceOrder($array, $a) { $array = !$array ? [] : $array; - if ($a['name']) { + if (!empty($a['name'])) { $array[] = $a['name']; } if (!empty($a['children'])) { diff --git a/web/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php b/web/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php index 358c1f04e15bb9a2ae1a9f70d19c3fcff99717d0..e4cc74b449d09bb658fa30eb11be5a4653095858 100644 --- a/web/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php +++ b/web/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php @@ -595,7 +595,7 @@ public function testComponentDependencies() { // Reload the form display. $form_display = EntityFormDisplay::load($form_display->id()); // The display exists. - $this->assertFalse(empty($form_display)); + $this->assertNotEmpty($form_display); // The form display should not depend on $role[0] anymore. $this->assertNoDependency('config', $dependencies[0], $form_display); // The form display should depend on 'anonymous' user role. @@ -612,7 +612,7 @@ public function testComponentDependencies() { // Reload the form display. $form_display = EntityFormDisplay::load($form_display->id()); // The display exists. - $this->assertFalse(empty($form_display)); + $this->assertNotEmpty($form_display); // The component is still enabled. $this->assertNotNull($form_display->getComponent($field_name)); // The form display should not depend on 'color' module anymore. @@ -624,7 +624,7 @@ public function testComponentDependencies() { // Reload the form display. $form_display = EntityFormDisplay::load($form_display->id()); // The display exists. - $this->assertFalse(empty($form_display)); + $this->assertNotEmpty($form_display); // The component has been disabled. $this->assertNull($form_display->getComponent($field_name)); $this->assertTrue($form_display->get('hidden')[$field_name]); diff --git a/web/core/modules/field_ui/tests/src/Unit/FieldUiTableTest.php b/web/core/modules/field_ui/tests/src/Unit/FieldUiTableTest.php new file mode 100644 index 0000000000000000000000000000000000000000..ae8d8bff547920eb2433eecfb322d01b90111d14 --- /dev/null +++ b/web/core/modules/field_ui/tests/src/Unit/FieldUiTableTest.php @@ -0,0 +1,90 @@ +<?php + +namespace Drupal\Tests\field_ui\Unit; + +use Drupal\Tests\UnitTestCase; + +/** + * @coversDefaultClass \Drupal\field_ui\Element\FieldUiTable + * + * @group field_ui + */ +class FieldUiTableTest extends UnitTestCase { + + /** + * @covers ::reduceOrder + * + * @dataProvider providerTestReduceOrder + */ + public function testReduceOrder($array, $expected) { + $this->assertSame($expected, array_reduce($array, ['Drupal\field_ui\Element\FieldUiTable', 'reduceOrder'])); + } + + /** + * Provides test data for testReduceOrder(). + */ + public function providerTestReduceOrder() { + return [ + 'Flat' => [ + 'array' => [ + [ + 'name' => 'foo', + ], + [ + 'name' => 'bar', + ], + [ + 'name' => 'baz', + ], + ], + 'expected' => ['foo', 'bar', 'baz'], + ], + 'Nested' => [ + 'array' => [ + [ + 'name' => 'foo', + 'children' => [ + [ + 'name' => 'bar', + 'weight' => 0, + ], + [ + 'name' => 'baz', + 'weight' => -1, + ], + ], + ], + [ + 'name' => 'biz', + ], + ], + 'expected' => ['foo', 'baz', 'bar', 'biz'], + ], + 'Nested no name key' => [ + 'array' => [ + [ + 'children' => [ + [ + 'name' => 'foo', + 'weight' => -1, + ], + [ + 'name' => 'bar', + 'weight' => 1, + ], + [ + 'name' => 'baz', + 'weight' => 0, + ], + ], + ], + [ + 'name' => 'biz', + ], + ], + 'expected' => ['foo', 'baz', 'bar', 'biz'], + ], + ]; + } + +} diff --git a/web/core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php b/web/core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php index 8892797888716b8dfc0a385e2989db4a609ee537..bf6ceb0612558d68e23ee9d1528b5c1be70dcd52 100644 --- a/web/core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php +++ b/web/core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php @@ -503,7 +503,7 @@ public static function processMultiple($element, FormStateInterface $form_state, } /** - * Retrieves the file description from a field field element. + * Retrieves the file description from a field element. * * This helper static method is used by processMultiple() method. * diff --git a/web/core/modules/file/tests/src/Functional/FileFieldWidgetTest.php b/web/core/modules/file/tests/src/Functional/FileFieldWidgetTest.php index bef8026c396e6ba887602a486bae551833ae7d3e..49178c9f4dd8ee8180a81d4d98f9b99118cf09a4 100644 --- a/web/core/modules/file/tests/src/Functional/FileFieldWidgetTest.php +++ b/web/core/modules/file/tests/src/Functional/FileFieldWidgetTest.php @@ -113,7 +113,7 @@ public function testSingleValuedWidget() { // Save the node and ensure it does not have the file. $this->submitForm([], 'Save'); $node = $node_storage->loadUnchanged($nid); - $this->assertTrue(empty($node->{$field_name}->target_id), 'File was successfully removed from the node.'); + $this->assertEmpty($node->{$field_name}->target_id, 'File was successfully removed from the node.'); } /** @@ -204,7 +204,7 @@ public function testMultiValuedWidget() { preg_match('/node\/([0-9])/', $this->getUrl(), $matches); $nid = $matches[1]; $node = $node_storage->loadUnchanged($nid); - $this->assertTrue(empty($node->{$field_name}->target_id), 'Node was successfully saved without any files.'); + $this->assertEmpty($node->{$field_name}->target_id, 'Node was successfully saved without any files.'); // Try to upload more files than allowed on revision. $upload_files_node_revision = [$test_file, $test_file, $test_file, $test_file]; @@ -575,7 +575,7 @@ protected function doTestTemporaryFileRemovalExploit(UserInterface $victim_user, $victim_tmp_file = $this->createTemporaryFile('some text', $victim_user); $victim_tmp_file = File::load($victim_tmp_file->id()); $this->assertTrue($victim_tmp_file->isTemporary(), 'New file saved to disk is temporary.'); - $this->assertFalse(empty($victim_tmp_file->id()), 'New file has an fid.'); + $this->assertNotEmpty($victim_tmp_file->id(), 'New file has an fid.'); $this->assertEquals($victim_user->id(), $victim_tmp_file->getOwnerId(), 'New file belongs to the victim.'); // Have attacker create a new node with a different uploaded file and diff --git a/web/core/modules/file/tests/src/Kernel/DeleteTest.php b/web/core/modules/file/tests/src/Kernel/DeleteTest.php index 59b0ea405388a2aa74e5a92c97950e4c448c11d3..e3ca3f5e3c0a3c8d77162bd5c658a240ba17ea22 100644 --- a/web/core/modules/file/tests/src/Kernel/DeleteTest.php +++ b/web/core/modules/file/tests/src/Kernel/DeleteTest.php @@ -52,7 +52,7 @@ public function testInUse() { $file_usage->delete($file, 'testing', 'test', 1); $usage = $file_usage->listUsage($file); $this->assertFileHooksCalled(['load', 'update']); - $this->assertTrue(empty($usage), 'File usage data was removed.'); + $this->assertEmpty($usage, 'File usage data was removed.'); $this->assertFileExists($file->getFileUri()); $file = File::load($file->id()); $this->assertNotEmpty($file, 'File still exists in the database.'); diff --git a/web/core/modules/filter/src/Plugin/migrate/process/FilterID.php b/web/core/modules/filter/src/Plugin/migrate/process/FilterID.php index d61661df6caae4f9f352e519ca5e104b25b3bd81..14f88408a1c462abc67723e9c38cdea92caca8b6 100644 --- a/web/core/modules/filter/src/Plugin/migrate/process/FilterID.php +++ b/web/core/modules/filter/src/Plugin/migrate/process/FilterID.php @@ -15,10 +15,9 @@ // cspell:ignore abbrfilter adsense autofloat biblio cincopa codefilter // cspell:ignore commonmark deepzoom emogrifier emptyparagraphkiller forena -// cspell:ignore gotwo htmlpurifier htmltidy intlinks intlinks lazyloader -// cspell:ignore linktitle multicolumn multilink mytube openlayers opengraph -// cspell:ignore sanitizable shortcode shortcode spamspan typogrify wordfilter -// cspell:ignore xbbcode +// cspell:ignore gotwo htmlpurifier htmltidy intlinks lazyloader linktitle +// cspell:ignore multicolumn multilink mytube openlayers opengraph sanitizable +// cspell:ignore shortcode spamspan typogrify wordfilter xbbcode /** * @MigrateProcessPlugin( diff --git a/web/core/modules/filter/src/Render/FilteredMarkup.php b/web/core/modules/filter/src/Render/FilteredMarkup.php index bf249835046014e447b4a7e242e1382b09cf73c2..ab8f7168f004871c814681bd744fe2748486af15 100644 --- a/web/core/modules/filter/src/Render/FilteredMarkup.php +++ b/web/core/modules/filter/src/Render/FilteredMarkup.php @@ -14,7 +14,7 @@ * * @internal * This object is marked as internal because it should only be used in the - * Filter module on strings that have already been been filtered and sanitized + * Filter module on strings that have already been filtered and sanitized * in \Drupal\filter\Plugin\FilterInterface. * * @see \Drupal\Core\Render\Markup diff --git a/web/core/modules/forum/tests/src/Functional/ForumIndexTest.php b/web/core/modules/forum/tests/src/Functional/ForumIndexTest.php index d90c73d31ce64e21557c27d24c3ee12e5292b9af..8be1ca651f8b03246c14b675c1fcc8946a469e50 100644 --- a/web/core/modules/forum/tests/src/Functional/ForumIndexTest.php +++ b/web/core/modules/forum/tests/src/Functional/ForumIndexTest.php @@ -59,7 +59,7 @@ public function testForumIndexStatus() { // Check that the node exists in the database. $node = $this->drupalGetNodeByTitle($title); - $this->assertTrue(!empty($node), 'New forum node found in database.'); + $this->assertNotEmpty($node, 'New forum node found in database.'); // Create a child forum. $edit = [ diff --git a/web/core/modules/forum/tests/src/Functional/ForumNodeAccessTest.php b/web/core/modules/forum/tests/src/Functional/ForumNodeAccessTest.php index 1ca15cb687c757e5432b9459fc698fcea771b3ee..bbc0efe1314d934e1676cd1f3c67acb7ffd6c4ed 100644 --- a/web/core/modules/forum/tests/src/Functional/ForumNodeAccessTest.php +++ b/web/core/modules/forum/tests/src/Functional/ForumNodeAccessTest.php @@ -68,7 +68,7 @@ public function testForumNodeAccess() { $this->drupalGet('node/add/forum', ['query' => ['forum_id' => 1]]); $this->submitForm($edit, 'Save'); $private_node = $this->drupalGetNodeByTitle($private_node_title); - $this->assertTrue(!empty($private_node), 'New private forum node found in database.'); + $this->assertNotEmpty($private_node, 'New private forum node found in database.'); // Create a public node. $public_node_title = $this->randomMachineName(20); @@ -79,7 +79,7 @@ public function testForumNodeAccess() { $this->drupalGet('node/add/forum', ['query' => ['forum_id' => 1]]); $this->submitForm($edit, 'Save'); $public_node = $this->drupalGetNodeByTitle($public_node_title); - $this->assertTrue(!empty($public_node), 'New public forum node found in database.'); + $this->assertNotEmpty($public_node, 'New public forum node found in database.'); // Enable the new and active forum blocks. $this->drupalPlaceBlock('forum_active_block'); diff --git a/web/core/modules/forum/tests/src/Functional/ForumTest.php b/web/core/modules/forum/tests/src/Functional/ForumTest.php index 4d1e0767eacb6a18cfb0182276e3ffcba1718060..29135c74837ed545e2fd2b9326274b0ce6952309 100644 --- a/web/core/modules/forum/tests/src/Functional/ForumTest.php +++ b/web/core/modules/forum/tests/src/Functional/ForumTest.php @@ -464,7 +464,7 @@ public function createForum($type, $parent = 0) { 'description__value' => $description, ]); $term = array_shift($term); - $this->assertTrue(!empty($term), 'The ' . $type . ' exists in the database'); + $this->assertNotEmpty($term, "The forum type '$type' should exist in the database."); // Verify forum hierarchy. $tid = $term->id(); diff --git a/web/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php b/web/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php index 515dd92553c6951a40cd581d6f11a72ee306077e..aed0e7169d4987d0d6b4b57e9eaa8ec48e7deebf 100644 --- a/web/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php +++ b/web/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php @@ -67,7 +67,7 @@ class ImageFormatter extends ImageFormatterBase { * @param string $view_mode * The view mode. * @param array $third_party_settings - * Any third party settings settings. + * Any third party settings. * @param \Drupal\Core\Session\AccountInterface $current_user * The current user. * @param \Drupal\Core\Entity\EntityStorageInterface $image_style_storage diff --git a/web/core/modules/image/tests/src/Functional/ImageFieldDefaultImagesTest.php b/web/core/modules/image/tests/src/Functional/ImageFieldDefaultImagesTest.php index 3acf4fa263ee6a84a1a8a26af19d19f30735d6b8..a657d2cacba5f949f9150c2ab75e24d69d48cb3c 100644 --- a/web/core/modules/image/tests/src/Functional/ImageFieldDefaultImagesTest.php +++ b/web/core/modules/image/tests/src/Functional/ImageFieldDefaultImagesTest.php @@ -251,8 +251,7 @@ public function testDefaultImages() { $field->setSetting('default_image', $default_image_settings); $field->save(); - // Confirm the new field field default is used on the article field - // admin form. + // Confirm the new field default is used on the article field admin form. $this->drupalGet("admin/structure/types/manage/article/fields/$field_id"); $this->assertSession()->hiddenFieldValueEquals('settings[default_image][uuid][fids]', $default_images['field_private']->id()); } diff --git a/web/core/modules/jsonapi/src/JsonApiResource/Data.php b/web/core/modules/jsonapi/src/JsonApiResource/Data.php index 0e4006206726ad9da4ac79643fcd00f860a6d0bd..113e3bf559d34ffb6601154e2aab109daea329fe 100644 --- a/web/core/modules/jsonapi/src/JsonApiResource/Data.php +++ b/web/core/modules/jsonapi/src/JsonApiResource/Data.php @@ -146,7 +146,7 @@ public function getCardinality() { * Returns a new Data object containing the entities of $this and $other. * * @param \Drupal\jsonapi\JsonApiResource\Data $a - * A Data object object to be merged. + * A Data object to be merged. * @param \Drupal\jsonapi\JsonApiResource\Data $b * A Data object to be merged. * diff --git a/web/core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalTest.php b/web/core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalTest.php index 272fbdf395c44c073af44b6c21b1292547ac1748..04aa43e3955a9445664d203c00a4f781ae74d2da 100644 --- a/web/core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalTest.php +++ b/web/core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalTest.php @@ -179,9 +179,9 @@ public function testRead() { 'user--user', $first_include['type'] ); - $this->assertFalse(empty($first_include['attributes'])); - $this->assertTrue(empty($first_include['attributes']['mail'])); - $this->assertTrue(empty($first_include['attributes']['pass'])); + $this->assertNotEmpty($first_include['attributes']); + $this->assertArrayNotHasKey('mail', $first_include['attributes']); + $this->assertArrayNotHasKey('pass', $first_include['attributes']); // 12. Collection with one access denied. $this->nodes[1]->set('status', FALSE); $this->nodes[1]->save(); @@ -284,8 +284,8 @@ public function testRead() { $this->assertEquals(200, $response->getStatusCode()); $this->assertEquals('user--user', $single_output['data']['type']); $this->assertEquals($this->user->get('name')->value, $single_output['data']['attributes']['name']); - $this->assertTrue(empty($single_output['data']['attributes']['mail'])); - $this->assertTrue(empty($single_output['data']['attributes']['pass'])); + $this->assertArrayNotHasKey('mail', $single_output['data']['attributes']); + $this->assertArrayNotHasKey('pass', $single_output['data']['attributes']); // 18. Test filtering on the column of a link. $filter = [ 'linkUri' => [ diff --git a/web/core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php b/web/core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php index c9154a6d445f8a4b9d47898696f3e697fe5a704c..b0f4f4ad4991ce8f23fc775a6a29e405a22efdaa 100644 --- a/web/core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php +++ b/web/core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php @@ -299,7 +299,7 @@ public function testNormalize() { 'related' => ['href' => Url::fromUri('internal:/jsonapi/node/article/' . $this->node->uuid() . '/uid', ['query' => ['resourceVersion' => 'id:' . $this->node->getRevisionId()]])->setAbsolute()->toString(TRUE)->getGeneratedUrl()], ], ], $normalized['data']['relationships']['uid']); - $this->assertTrue(empty($normalized['meta']['omitted'])); + $this->assertArrayNotHasKey('meta', $normalized); $this->assertSame($this->user->uuid(), $normalized['included'][0]['id']); $this->assertSame('user--user', $normalized['included'][0]['type']); $this->assertSame('user1', $normalized['included'][0]['attributes']['display_name']); @@ -394,8 +394,8 @@ public function testNormalizeUuid() { $this->assertStringMatchesFormat($this->node->uuid(), $normalized['data']['id']); $this->assertEquals($this->node->type->entity->uuid(), $normalized['data']['relationships']['node_type']['data']['id']); $this->assertEquals($this->user->uuid(), $normalized['data']['relationships']['uid']['data']['id']); - $this->assertFalse(empty($normalized['included'][0]['id'])); - $this->assertTrue(empty($normalized['meta']['omitted'])); + $this->assertNotEmpty($normalized['included'][0]['id']); + $this->assertArrayNotHasKey('meta', $normalized); $this->assertEquals($this->user->uuid(), $normalized['included'][0]['id']); $this->assertCount(1, $normalized['included'][0]['attributes']); $this->assertCount(12, $normalized['included'][1]['attributes']); diff --git a/web/core/modules/jsonapi/tests/src/Unit/Normalizer/HttpExceptionNormalizerTest.php b/web/core/modules/jsonapi/tests/src/Unit/Normalizer/HttpExceptionNormalizerTest.php index 1e43522591e2d06d6f75d68d6d5e60c71901d47f..928fdf8514aefe5c75275c52e78a1546ab3f23d0 100644 --- a/web/core/modules/jsonapi/tests/src/Unit/Normalizer/HttpExceptionNormalizerTest.php +++ b/web/core/modules/jsonapi/tests/src/Unit/Normalizer/HttpExceptionNormalizerTest.php @@ -49,8 +49,8 @@ public function testNormalize() { $normalized = $normalizer->normalize($exception, 'api_json'); $normalized = $normalized->getNormalization(); $error = $normalized[0]; - $this->assertTrue(empty($error['meta'])); - $this->assertTrue(empty($error['source'])); + $this->assertArrayNotHasKey('meta', $error); + $this->assertArrayNotHasKey('source', $error); } } diff --git a/web/core/modules/language/tests/src/Functional/LanguageConfigSchemaTest.php b/web/core/modules/language/tests/src/Functional/LanguageConfigSchemaTest.php index af801d8ca87fbb9f039ef946dbb5e998aa3b9bdf..7145d7c30c804c20db690629e45085265023c7cc 100644 --- a/web/core/modules/language/tests/src/Functional/LanguageConfigSchemaTest.php +++ b/web/core/modules/language/tests/src/Functional/LanguageConfigSchemaTest.php @@ -50,7 +50,7 @@ protected function setUp(): void { public function testValidLanguageConfigSchema() { // Make sure no language configuration available by default. $config_data = $this->config('language.settings')->get(); - $this->assertTrue(empty($config_data)); + $this->assertEmpty($config_data); $settings_path = 'admin/config/regional/content-language'; diff --git a/web/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php b/web/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php index 8c6816d8dedec802ec74c524f09be4a6364ebb0a..3d6d80f622b2720c939ef71406ddf0332e8e3c47 100644 --- a/web/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php +++ b/web/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php @@ -229,6 +229,20 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen $element['uri']['#description'] = $this->t('This must be an external URL such as %url.', ['%url' => 'http://example.com']); } + // Make uri required on the front-end when title filled-in. + if (!$this->isDefaultValueWidget($form_state) && $this->getFieldSetting('title') !== DRUPAL_DISABLED && !$element['uri']['#required']) { + $parents = $element['#field_parents']; + $parents[] = $this->fieldDefinition->getName(); + $selector = $root = array_shift($parents); + if ($parents) { + $selector = $root . '[' . implode('][', $parents) . ']'; + } + + $element['uri']['#states']['required'] = [ + ':input[name="' . $selector . '[' . $delta . '][title]"]' => ['filled' => TRUE], + ]; + } + $element['title'] = [ '#type' => 'textfield', '#title' => $this->t('Link text'), @@ -250,10 +264,9 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen if (!$element['title']['#required']) { // Make title required on the front-end when URI filled-in. - $field_name = $this->fieldDefinition->getName(); $parents = $element['#field_parents']; - $parents[] = $field_name; + $parents[] = $this->fieldDefinition->getName(); $selector = $root = array_shift($parents); if ($parents) { $selector = $root . '[' . implode('][', $parents) . ']'; diff --git a/web/core/modules/link/tests/src/FunctionalJavascript/LinkFieldFormStatesTest.php b/web/core/modules/link/tests/src/FunctionalJavascript/LinkFieldFormStatesTest.php new file mode 100644 index 0000000000000000000000000000000000000000..a7e99f06f7c34d1864ff50db4ae39649492ba489 --- /dev/null +++ b/web/core/modules/link/tests/src/FunctionalJavascript/LinkFieldFormStatesTest.php @@ -0,0 +1,80 @@ +<?php + +declare(strict_types=1); + +namespace Drupal\Tests\link\FunctionalJavascript; + +use Drupal\FunctionalJavascriptTests\WebDriverTestBase; + +/** + * Tests link field form states functionality. + * + * @group link + */ +class LinkFieldFormStatesTest extends WebDriverTestBase { + + /** + * {@inheritdoc} + */ + protected static $modules = [ + 'entity_test', + 'link', + 'node', + 'link_test_base_field', + ]; + + /** + * {@inheritdoc} + */ + protected $defaultTheme = 'stark'; + + /** + * {@inheritdoc} + */ + protected function setUp(): void { + parent::setUp(); + $this->drupalLogin($this->drupalCreateUser([ + 'administer entity_test content', + ])); + } + + /** + * @dataProvider linkFieldFormStatesData + */ + public function testLinkFieldFormStates(string $uri, string $title) { + $this->drupalGet('entity_test/add'); + $session = $this->assertSession(); + $session->elementNotExists('css', '#edit-links-0-uri[required]'); + $session->elementNotExists('css', '#edit-links-0-title[required]'); + + $page = $this->getSession()->getPage(); + + if ($uri !== '') { + $page->fillField('links[0][uri]', $uri); + $session->elementNotExists('css', '#edit-links-0-uri[required]'); + $session->elementExists('css', '#edit-links-0-title[required]'); + } + else { + $page->fillField('links[0][title]', $title); + $session->elementExists('css', '#edit-links-0-uri[required]'); + $session->elementNotExists('css', '#edit-links-0-title[required]'); + } + } + + /** + * Provides data for ::testLinkFieldJSFormStates. + */ + public function linkFieldFormStatesData() { + return [ + 'Fill uri, keep title empty' => [ + 'https://drupal.org', + '', + ], + 'Fill title, keep uri empty' => [ + '', + 'https://drupal.org', + ], + ]; + } + +} diff --git a/web/core/modules/locale/tests/src/Functional/LocaleContentTest.php b/web/core/modules/locale/tests/src/Functional/LocaleContentTest.php index 1f67248703c9cd7fac9c8e5d404556e398722575..9b4c3b51ea6d760fea3391de28d49b81de8007cc 100644 --- a/web/core/modules/locale/tests/src/Functional/LocaleContentTest.php +++ b/web/core/modules/locale/tests/src/Functional/LocaleContentTest.php @@ -215,25 +215,25 @@ public function testContentTypeDirLang() { // Check if English node does not have lang tag. $this->drupalGet('node/' . $nodes['en']->id()); $element = $this->cssSelect('article.node[lang="en"]'); - $this->assertTrue(empty($element), 'The lang tag has not been assigned to the English node.'); + $this->assertEmpty($element, 'The lang tag has not been assigned to the English node.'); // Check if English node does not have dir tag. $element = $this->cssSelect('article.node[dir="ltr"]'); - $this->assertTrue(empty($element), 'The dir tag has not been assigned to the English node.'); + $this->assertEmpty($element, 'The dir tag has not been assigned to the English node.'); // Check if Arabic node has lang="ar" & dir="rtl" tags. $this->drupalGet('node/' . $nodes['ar']->id()); $element = $this->cssSelect('article.node[lang="ar"][dir="rtl"]'); - $this->assertTrue(!empty($element), 'The lang and dir tags have been assigned correctly to the Arabic node.'); + $this->assertNotEmpty($element, 'The lang and dir tags have been assigned correctly to the Arabic node.'); // Check if Spanish node has lang="es" tag. $this->drupalGet('node/' . $nodes['es']->id()); $element = $this->cssSelect('article.node[lang="es"]'); - $this->assertTrue(!empty($element), 'The lang tag has been assigned correctly to the Spanish node.'); + $this->assertNotEmpty($element, 'The lang tag has been assigned correctly to the Spanish node.'); // Check if Spanish node does not have dir="ltr" tag. $element = $this->cssSelect('article.node[lang="es"][dir="ltr"]'); - $this->assertTrue(empty($element), 'The dir tag has not been assigned to the Spanish node.'); + $this->assertEmpty($element, 'The dir tag has not been assigned to the Spanish node.'); } } diff --git a/web/core/modules/media/src/Plugin/Field/FieldFormatter/MediaThumbnailFormatter.php b/web/core/modules/media/src/Plugin/Field/FieldFormatter/MediaThumbnailFormatter.php index 238545678ac72dee698a150a30f5f177e1b16f0b..6dcd7cc59edd05e3674b50358ecbf784d8f7e30c 100644 --- a/web/core/modules/media/src/Plugin/Field/FieldFormatter/MediaThumbnailFormatter.php +++ b/web/core/modules/media/src/Plugin/Field/FieldFormatter/MediaThumbnailFormatter.php @@ -50,7 +50,7 @@ class MediaThumbnailFormatter extends ImageFormatter { * @param string $view_mode * The view mode. * @param array $third_party_settings - * Any third party settings settings. + * Any third party settings. * @param \Drupal\Core\Session\AccountInterface $current_user * The current user. * @param \Drupal\image\ImageStyleStorageInterface $image_style_storage diff --git a/web/core/modules/media/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php b/web/core/modules/media/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php index 5785a13a680d4a2f6ea27272610300efa644a254..d4e23b3e7385fd04e39290a5485a262e26c9ef81 100644 --- a/web/core/modules/media/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php +++ b/web/core/modules/media/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php @@ -713,9 +713,9 @@ public function testAlt() { $assert_session->fieldValueEquals('attributes[alt]', $cobra_commander_bio); // Test that setting alt value to two double quotes will signal to the - // MediaEmbed filter to unset the attribute on the media image field. - // We intentionally add a space space after the two double quotes to test - // the string is trimmed to two quotes. + // MediaEmbed filter to unset the attribute on the media image field. We + // intentionally add a space after the two double quotes to test the string + // is trimmed to two quotes. $page->fillField('attributes[alt]', '"" '); $this->submitDialog(); $this->getSession()->switchToIFrame('ckeditor'); diff --git a/web/core/modules/media_library/media_library.module b/web/core/modules/media_library/media_library.module index 7e6539a51543aefa5df085118f492826b999943b..24a534ce809e50924de352d9c24c49820f688dc3 100644 --- a/web/core/modules/media_library/media_library.module +++ b/web/core/modules/media_library/media_library.module @@ -479,8 +479,8 @@ function _media_library_configure_view_display(MediaTypeInterface $type) { * Implements hook_form_FORM_ID_alter(). */ function media_library_form_filter_format_edit_form_alter(array &$form, FormStateInterface $form_state, $form_id) { - // Add an additional validate callback so so we can ensure the media_embed - // filter is enabled when the DrupalMediaLibrary button is enabled. + // Add an additional validate callback so we can ensure the media_embed filter + // is enabled when the DrupalMediaLibrary button is enabled. $form['#validate'][] = 'media_library_filter_format_edit_form_validate'; } @@ -488,8 +488,8 @@ function media_library_form_filter_format_edit_form_alter(array &$form, FormStat * Implements hook_form_FORM_ID_alter(). */ function media_library_form_filter_format_add_form_alter(array &$form, FormStateInterface $form_state, $form_id) { - // Add an additional validate callback so so we can ensure the media_embed - // filter is enabled when the DrupalMediaLibrary button is enabled. + // Add an additional validate callback so we can ensure the media_embed filter + // is enabled when the DrupalMediaLibrary button is enabled. $form['#validate'][] = 'media_library_filter_format_edit_form_validate'; } diff --git a/web/core/modules/media_library/src/Plugin/Field/FieldWidget/MediaLibraryWidget.php b/web/core/modules/media_library/src/Plugin/Field/FieldWidget/MediaLibraryWidget.php index 017c99e65be043970ad1e5bd349edf922f169ade..3f341f54b06c4f22c9aa13921d9c7c0d254b5121 100644 --- a/web/core/modules/media_library/src/Plugin/Field/FieldWidget/MediaLibraryWidget.php +++ b/web/core/modules/media_library/src/Plugin/Field/FieldWidget/MediaLibraryWidget.php @@ -305,7 +305,8 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen $element += [ '#type' => 'fieldset', '#cardinality' => $this->fieldDefinition->getFieldStorageDefinition()->getCardinality(), - '#target_bundles' => $settings['target_bundles'] ?? FALSE, + // If no target bundles are specified, all target bundles are allowed. + '#target_bundles' => $settings['target_bundles'] ?? [], '#attributes' => [ 'id' => $wrapper_id, 'class' => ['js-media-library-widget'], diff --git a/web/core/modules/media_library/tests/src/FunctionalJavascript/EntityReferenceWidgetTest.php b/web/core/modules/media_library/tests/src/FunctionalJavascript/EntityReferenceWidgetTest.php index 53400620ec168d60ab292b0fee2cb09feb5fd3ef..5ec06908ffecefa93899b6cd1586149327345546 100644 --- a/web/core/modules/media_library/tests/src/FunctionalJavascript/EntityReferenceWidgetTest.php +++ b/web/core/modules/media_library/tests/src/FunctionalJavascript/EntityReferenceWidgetTest.php @@ -140,7 +140,12 @@ public function testWidget() { $this->assertTrue($menu->hasLink('Type Three')); $this->assertTrue($menu->hasLink('Type Four')); $this->assertTrue($menu->hasLink('Type Five')); - $assert_session->elementExists('css', '.ui-dialog-titlebar-close')->click(); + + // Insert media to test validation with null target_bundles. + $this->switchToMediaType('One'); + $this->assertNotEmpty($assert_session->waitForText('Showing Type One media.')); + $this->selectMediaItem(0); + $this->pressInsertSelected('Added one media item.'); // Assert that the media type menu is not available when only 1 type is // configured for the field. 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 d565e532036783f43e131f4e799a6cf675f6e8d6..497f7f9a8d2ffe5b9c1a1126f9b100ffd00446c3 100644 --- a/web/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php +++ b/web/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php @@ -801,7 +801,7 @@ public function verifyMenuLink(MenuLinkContent $item, $item_node, MenuLinkConten $title = $parent->getTitle(); $this->assertSession()->linkExists($title, 0, 'Parent menu link was displayed'); - // Verify menu link link. + // Verify menu link. $this->clickLink($title); $title = $parent_node->label(); $this->assertSession()->titleEquals("$title | Drupal"); @@ -811,7 +811,7 @@ public function verifyMenuLink(MenuLinkContent $item, $item_node, MenuLinkConten $title = $item->getTitle(); $this->assertSession()->linkExists($title, 0, 'Menu link was displayed'); - // Verify menu link link. + // Verify menu link. $this->clickLink($title); $title = $item_node->label(); $this->assertSession()->titleEquals("$title | Drupal"); diff --git a/web/core/modules/migrate/src/Plugin/MigrateDestinationInterface.php b/web/core/modules/migrate/src/Plugin/MigrateDestinationInterface.php index 789c280e51a9b25316576bb07ce7bfba22d9ef76..d2c7fb7ee9947571214d39999fe0e1a60dff5ec7 100644 --- a/web/core/modules/migrate/src/Plugin/MigrateDestinationInterface.php +++ b/web/core/modules/migrate/src/Plugin/MigrateDestinationInterface.php @@ -105,6 +105,14 @@ public function fields(); * plugin's getIds() method if the plugin wants to save the IDs to the ID * map, TRUE to indicate success without saving IDs to the ID map, or * FALSE to indicate a failure. + * + * @throws \Drupal\migrate\MigrateException + * Throws an exception if there is a problem importing the row. By default, + * this causes the migration system to treat this row as having failed; + * however, any \Drupal\migrate\Plugin\MigrateIdMapInterface status constant + * can be set using the $status parameter of + * \Drupal\migrate\MigrateException, such as + * \Drupal\migrate\Plugin\MigrateIdMapInterface::STATUS_IGNORED. */ public function import(Row $row, array $old_destination_id_values = []); diff --git a/web/core/modules/migrate/src/Row.php b/web/core/modules/migrate/src/Row.php index 6b6f1ad9d04b420c40a85985c02c1847f6c801bd..3d961902bcdec3018b251dcc3c45dd72119c0d5a 100644 --- a/web/core/modules/migrate/src/Row.php +++ b/web/core/modules/migrate/src/Row.php @@ -157,10 +157,11 @@ public function getSourceProperty($property) { } /** - * Returns the whole source array. + * Retrieves all source properties. * * @return array - * An array of source plugins. + * An array containing all source property values, keyed by the property + * name. */ public function getSource() { return $this->source; diff --git a/web/core/modules/migrate_drupal/src/MigrationConfigurationTrait.php b/web/core/modules/migrate_drupal/src/MigrationConfigurationTrait.php index 6a40fd10b35af655fcf85fb9f2d040b02b87b670..795c45554a58aa115440746302c8737a25b84523 100644 --- a/web/core/modules/migrate_drupal/src/MigrationConfigurationTrait.php +++ b/web/core/modules/migrate_drupal/src/MigrationConfigurationTrait.php @@ -220,7 +220,7 @@ public static function getLegacyDrupalVersion(Connection $connection) { } } } - catch (\PDOException $e) { + catch (DatabaseExceptionWrapper $e) { $version_string = FALSE; } } diff --git a/web/core/modules/migrate_drupal/tests/src/Unit/MigrationConfigurationTraitTest.php b/web/core/modules/migrate_drupal/tests/src/Unit/MigrationConfigurationTraitTest.php new file mode 100644 index 0000000000000000000000000000000000000000..4ebbfc47d19682e759233bb54ebab91900ffe2d6 --- /dev/null +++ b/web/core/modules/migrate_drupal/tests/src/Unit/MigrationConfigurationTraitTest.php @@ -0,0 +1,152 @@ +<?php + +namespace Drupal\Tests\migrate_drupal\Unit; + +use Drupal\Core\Database\DatabaseExceptionWrapper; +use Drupal\migrate_drupal\MigrationConfigurationTrait; +use Drupal\Tests\UnitTestCase; + +/** + * @coversDefaultClass \Drupal\migrate_drupal\MigrationConfigurationTrait + * @group migrate_drupal + */ +class MigrationConfigurationTraitTest extends UnitTestCase { + + /** + * @covers ::getLegacyDrupalVersion + * @dataProvider providerTestGetLegacyDrupalVersion + */ + public function testGetLegacyDrupalVersion($expected_version_string, $schema_version, $exception, $table_map) { + if ($schema_version) { + $statement = $this->createMock('\Drupal\Core\Database\StatementInterface'); + $statement->expects($this->any()) + ->method('fetchField') + ->willReturn($schema_version); + } + + $schema = $this->createMock('\Drupal\Core\Database\Schema'); + $schema->expects($this->any()) + ->method('tableExists') + ->willReturnMap($table_map); + + $connection = $this->getMockBuilder('Drupal\Core\Database\Connection') + ->disableOriginalConstructor() + ->getMock(); + + if ($exception) { + $connection->expects($this->any()) + ->method('query') + ->willThrowException($exception); + } + else { + $connection->expects($this->any()) + ->method('query') + ->willReturn($statement); + } + + $connection->expects($this->any()) + ->method('schema') + ->willReturn($schema); + + $actual_version_string = TestMigrationConfigurationTrait::getLegacyDrupalVersion($connection); + $this->assertSame($expected_version_string, $actual_version_string); + } + + /** + * Provides data for testGetLegacyDrupalVersion. + */ + public function providerTestGetLegacyDrupalVersion() { + return [ + 'D5' => [ + 'expected_version_string' => '5', + 'schema_version' => '1678', + 'exception' => NULL, + 'table_map' => [ + ['system', TRUE], + ['key_value', FALSE], + ], + ], + 'D6' => [ + 'expected_version_string' => '6', + 'schema_version' => '6057', + 'exception' => NULL, + 'table_map' => [ + ['system', TRUE], + ['key_value', FALSE], + ], + ], + 'D7' => [ + 'expected_version_string' => '7', + 'schema_version' => '7065', + 'exception' => NULL, + 'table_map' => [ + ['system', TRUE], + ['key_value', FALSE], + ], + ], + 'D8' => [ + 'expected_version_string' => '8', + 'schema_version' => serialize('8976'), + 'exception' => NULL, + 'table_map' => [ + ['system', FALSE], + ['key_value', TRUE], + ], + ], + 'D9' => [ + 'expected_version_string' => '9', + 'schema_version' => serialize('9270'), + 'exception' => NULL, + 'table_map' => [ + ['system', FALSE], + ['key_value', TRUE], + ], + ], + 'Not drupal' => [ + 'expected_version_string' => FALSE, + 'schema_version' => "not drupal I guess", + 'exception' => NULL, + 'table_map' => [ + ['system', FALSE], + ['key_value', FALSE], + ], + ], + 'D5 almost' => [ + 'expected_version_string' => FALSE, + 'schema_version' => '123', + 'exception' => NULL, + 'table_map' => [ + ['system', TRUE], + ['key_value', FALSE], + ], + ], + 'D5/6/7 Exception' => [ + 'expected_version_string' => FALSE, + 'schema_version' => NULL, + 'exception' => new DatabaseExceptionWrapper(), + 'table_map' => [ + ['system', TRUE], + ['key_value', FALSE], + ], + ], + 'D8/9 Exception' => [ + 'expected_version_string' => FALSE, + 'schema_version' => NULL, + 'exception' => new DatabaseExceptionWrapper(), + 'table_map' => [ + ['system', FALSE], + ['key_value', TRUE], + ], + ], + ]; + } + +} + +/** + * Test class that uses the trait we are testing. + */ +class TestMigrationConfigurationTrait { + use MigrationConfigurationTrait; + +} diff --git a/web/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeExecuteTestBase.php b/web/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeExecuteTestBase.php index 9b61a8bd7e51eea7f8883ff24374af0b82c7571d..5cb39158179e326988c1bd37a9aab02ab56e6933 100644 --- a/web/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeExecuteTestBase.php +++ b/web/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeExecuteTestBase.php @@ -36,6 +36,7 @@ public function doUpgradeAndIncremental() { // Test the review form. $this->assertReviewForm(); + $this->useTestMailCollector(); $this->submitForm([], 'Perform upgrade'); $this->assertUpgrade($this->getEntityCounts()); @@ -57,4 +58,16 @@ public function doUpgradeAndIncremental() { $this->assertUpgrade($this->getEntityCountsIncremental()); } + /** + * Helper to set the test mail collector in settings.php. + */ + public function useTestMailCollector() { + // Set up an override. + $settings['config']['system.mail']['interface']['default'] = (object) [ + 'value' => 'test_mail_collector', + 'required' => TRUE, + ]; + $this->writeSettings($settings); + } + } diff --git a/web/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php b/web/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php index 9da21be807cc6ac6e4b2ff85000f361209f3c8c8..1c61113ad3c7b1437e237562413024c367dff307 100644 --- a/web/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php +++ b/web/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php @@ -357,4 +357,14 @@ protected function assertFileMigrations() { } } + /** + * Confirm emails were sent. + */ + protected function assertEmailsSent() { + // There should be one user activation email. + $captured_emails = \Drupal::state()->get('system.test_mail_collector', []); + $this->assertCount(1, $captured_emails); + $this->assertEquals('user_status_activated', $captured_emails[0]['id']); + } + } diff --git a/web/core/modules/migrate_drupal_ui/tests/src/Functional/d6/Upgrade6Test.php b/web/core/modules/migrate_drupal_ui/tests/src/Functional/d6/Upgrade6Test.php index 4ee6cda5a7f6224d1ca91c09378110b4b8bff28e..323f8f387a2ee02cafcdc04776d71792da38ae18 100644 --- a/web/core/modules/migrate_drupal_ui/tests/src/Functional/d6/Upgrade6Test.php +++ b/web/core/modules/migrate_drupal_ui/tests/src/Functional/d6/Upgrade6Test.php @@ -206,6 +206,8 @@ public function testUpgradeAndIncremental() { $this->assertUserLogIn(2, 'john.doe_pass'); $this->assertFollowUpMigrationResults(); + + $this->assertEmailsSent(); } /** diff --git a/web/core/modules/migrate_drupal_ui/tests/src/Functional/d7/DoubleSlashTest.php b/web/core/modules/migrate_drupal_ui/tests/src/Functional/d7/DoubleSlashTest.php index 330f46cc8422c576e51a9bd33c66a1bf39f7e923..b0813c9dd1c69a5137fa279c8e16294642cac825 100644 --- a/web/core/modules/migrate_drupal_ui/tests/src/Functional/d7/DoubleSlashTest.php +++ b/web/core/modules/migrate_drupal_ui/tests/src/Functional/d7/DoubleSlashTest.php @@ -61,6 +61,7 @@ public function testMigrateUpgradeExecute() { $this->submitForm([], 'Continue'); $this->submitForm($edits, 'Review upgrade'); $this->submitForm([], 'I acknowledge I may lose data. Continue anyway.'); + $this->useTestMailCollector(); $this->submitForm([], 'Perform upgrade'); // Tests the migration log contains an error message. diff --git a/web/core/modules/migrate_drupal_ui/tests/src/Functional/d7/Upgrade7Test.php b/web/core/modules/migrate_drupal_ui/tests/src/Functional/d7/Upgrade7Test.php index 864c5dd8e4779e0cc3db1d787dd7c52a381ea330..1a30e1cc07ab26bd423cb2ed70ce1453250aafb9 100644 --- a/web/core/modules/migrate_drupal_ui/tests/src/Functional/d7/Upgrade7Test.php +++ b/web/core/modules/migrate_drupal_ui/tests/src/Functional/d7/Upgrade7Test.php @@ -230,6 +230,8 @@ public function testUpgradeAndIncremental() { $this->assertUserLogIn(2, 'a password'); $this->assertFollowUpMigrationResults(); + + $this->assertEmailsSent(); } /** diff --git a/web/core/modules/node/tests/modules/node_access_test/node_access_test.module b/web/core/modules/node/tests/modules/node_access_test/node_access_test.module index 36219a13394fc276cb12ce45e0dfcbb5e73adbfa..de51ddf57edc02908a4de357f48904e40efc70b6 100644 --- a/web/core/modules/node/tests/modules/node_access_test/node_access_test.module +++ b/web/core/modules/node/tests/modules/node_access_test/node_access_test.module @@ -99,7 +99,7 @@ function node_access_test_node_access_records(NodeInterface $node) { 'priority' => 0, ]; // For the author realm, the group ID is equivalent to a user ID, which - // means there are many many groups of just 1 user. + // means there are many groups of just 1 user. $grants[] = [ 'realm' => 'node_access_test_author', 'gid' => $node->getOwnerId(), diff --git a/web/core/modules/node/tests/src/Functional/NodeRevisionsTest.php b/web/core/modules/node/tests/src/Functional/NodeRevisionsTest.php index e3bcc483002badc9e93f3f841758d4ecf1b77520..f22cc669128be0edb96f0ea9dca61005bc2319c0 100644 --- a/web/core/modules/node/tests/src/Functional/NodeRevisionsTest.php +++ b/web/core/modules/node/tests/src/Functional/NodeRevisionsTest.php @@ -358,7 +358,7 @@ public function testNodeRevisionWithoutLogMessage() { $this->assertSession()->pageTextContains($new_title); $node_storage->resetCache([$node->id()]); $node_revision = $node_storage->load($node->id()); - $this->assertTrue(empty($node_revision->revision_log->value), 'After a new node revision is saved with an empty log message, the log message for the node is empty.'); + $this->assertEmpty($node_revision->revision_log->value, 'After a new node revision is saved with an empty log message, the log message for the node is empty.'); } /** diff --git a/web/core/modules/node/tests/src/Functional/PagePreviewTest.php b/web/core/modules/node/tests/src/Functional/PagePreviewTest.php index 4eca2c42b381b8ae096df23e67f5069a03b91d80..9f188c0010143306d41337030db9c1c87aaae4cb 100644 --- a/web/core/modules/node/tests/src/Functional/PagePreviewTest.php +++ b/web/core/modules/node/tests/src/Functional/PagePreviewTest.php @@ -213,7 +213,7 @@ public function testPagePreview() { // 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')]"); - $this->assertTrue(!empty($body_class_element), 'Node type body class found.'); + $this->assertNotEmpty($body_class_element, 'Node type body class found.'); // Get the UUID. $url = parse_url($this->getUrl()); diff --git a/web/core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareCombinationTest.php b/web/core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareCombinationTest.php index 2a71d6446f3b73705561819c08bae555d2a87f1c..dc1966815f5ff4ffb87311de99f7a10673613dcf 100644 --- a/web/core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareCombinationTest.php +++ b/web/core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareCombinationTest.php @@ -309,7 +309,7 @@ public function testNodeAccessLanguageAwareCombination() { $nids = $select->execute()->fetchAllAssoc('nid'); // There are no nodes with German translations, so no results are returned. - $this->assertTrue(empty($nids), 'Query returns an empty result.'); + $this->assertEmpty($nids, 'Query returns an empty result.'); // Query the nodes table as admin user (full access) with the node access // tag and no specific langcode. diff --git a/web/core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareTest.php b/web/core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareTest.php index 7fb4067586294e2f2a9c06a96721a9446ea96560..e4ec70f980f9eb4f43a9697e529d5e5078fbfb39 100644 --- a/web/core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareTest.php +++ b/web/core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareTest.php @@ -247,7 +247,7 @@ public function testNodeAccessLanguageAware() { $nids = $select->execute()->fetchAllAssoc('nid'); // There are no nodes with German translations, so no results are returned. - $this->assertTrue(empty($nids), 'Query returns an empty result when the de langcode is specified.'); + $this->assertEmpty($nids, 'Query returns an empty result when the de langcode is specified.'); // Query the nodes table as admin user (full access) with the node access // tag and no specific langcode. diff --git a/web/core/modules/node/tests/src/Kernel/NodeAccessLanguageTest.php b/web/core/modules/node/tests/src/Kernel/NodeAccessLanguageTest.php index a7a66057af98d767fc20ca21f7aa0b6980d4eaa3..7e9f8873006a2134828d3628a2f7a8f5455cfe23 100644 --- a/web/core/modules/node/tests/src/Kernel/NodeAccessLanguageTest.php +++ b/web/core/modules/node/tests/src/Kernel/NodeAccessLanguageTest.php @@ -231,7 +231,7 @@ public function testNodeAccessQueryTag() { $nids = $select->execute()->fetchAllAssoc('nid'); // Because no nodes are created in German, no nodes are returned. - $this->assertTrue(empty($nids), 'Query returns an empty result.'); + $this->assertEmpty($nids, 'Query returns an empty result.'); // Query the nodes table as admin user (full access) with the node access // tag and no specific langcode. diff --git a/web/core/modules/options/tests/src/Kernel/OptionsFieldTest.php b/web/core/modules/options/tests/src/Kernel/OptionsFieldTest.php index d80be94be79982c518665a0a8510b78d0ef77ed8..001a04e1719723744106992fe555cde7a8f4f1ca 100644 --- a/web/core/modules/options/tests/src/Kernel/OptionsFieldTest.php +++ b/web/core/modules/options/tests/src/Kernel/OptionsFieldTest.php @@ -28,9 +28,9 @@ public function testUpdateAllowedValues() { // All three options appear. $entity = EntityTest::create(); $form = \Drupal::service('entity.form_builder')->getForm($entity); - $this->assertTrue(!empty($form[$this->fieldName]['widget'][1]), 'Option 1 exists'); - $this->assertTrue(!empty($form[$this->fieldName]['widget'][2]), 'Option 2 exists'); - $this->assertTrue(!empty($form[$this->fieldName]['widget'][3]), 'Option 3 exists'); + $this->assertArrayHasKey(1, $form[$this->fieldName]['widget'], 'Option 1 exists'); + $this->assertArrayHasKey(2, $form[$this->fieldName]['widget'], 'Option 2 exists'); + $this->assertArrayHasKey(3, $form[$this->fieldName]['widget'], 'Option 3 exists'); // Use one of the values in an actual entity, and check that this value // cannot be removed from the list. @@ -54,9 +54,9 @@ public function testUpdateAllowedValues() { $this->fieldStorage->save(); $entity = EntityTest::create(); $form = \Drupal::service('entity.form_builder')->getForm($entity); - $this->assertTrue(empty($form[$this->fieldName]['widget'][1]), 'Option 1 does not exist'); - $this->assertTrue(!empty($form[$this->fieldName]['widget'][2]), 'Option 2 exists'); - $this->assertTrue(empty($form[$this->fieldName]['widget'][3]), 'Option 3 does not exist'); + $this->assertArrayNotHasKey(1, $form[$this->fieldName]['widget'], 'Option 1 does not exist'); + $this->assertArrayHasKey(2, $form[$this->fieldName]['widget'], 'Option 2 exists'); + $this->assertArrayNotHasKey(3, $form[$this->fieldName]['widget'], 'Option 3 does not exist'); // Completely new options appear. $this->fieldStorage->setSetting('allowed_values', [10 => 'Update', 20 => 'Twenty']); @@ -65,11 +65,11 @@ public function testUpdateAllowedValues() { // setting, so we need to reinitialize the entity object. $entity = EntityTest::create(); $form = \Drupal::service('entity.form_builder')->getForm($entity); - $this->assertTrue(empty($form[$this->fieldName]['widget'][1]), 'Option 1 does not exist'); - $this->assertTrue(empty($form[$this->fieldName]['widget'][2]), 'Option 2 does not exist'); - $this->assertTrue(empty($form[$this->fieldName]['widget'][3]), 'Option 3 does not exist'); - $this->assertTrue(!empty($form[$this->fieldName]['widget'][10]), 'Option 10 exists'); - $this->assertTrue(!empty($form[$this->fieldName]['widget'][20]), 'Option 20 exists'); + $this->assertArrayNotHasKey(1, $form[$this->fieldName]['widget'], 'Option 1 does not exist'); + $this->assertArrayNotHasKey(2, $form[$this->fieldName]['widget'], 'Option 2 does not exist'); + $this->assertArrayNotHasKey(3, $form[$this->fieldName]['widget'], 'Option 3 does not exist'); + $this->assertArrayHasKey(10, $form[$this->fieldName]['widget'], 'Option 10 exists'); + $this->assertArrayHasKey(20, $form[$this->fieldName]['widget'], 'Option 20 exists'); // Options are reset when a new field with the same name is created. $this->fieldStorage->delete(); @@ -88,9 +88,9 @@ public function testUpdateAllowedValues() { ->save(); $entity = EntityTest::create(); $form = \Drupal::service('entity.form_builder')->getForm($entity); - $this->assertTrue(!empty($form[$this->fieldName]['widget'][1]), 'Option 1 exists'); - $this->assertTrue(!empty($form[$this->fieldName]['widget'][2]), 'Option 2 exists'); - $this->assertTrue(!empty($form[$this->fieldName]['widget'][3]), 'Option 3 exists'); + $this->assertArrayHasKey(1, $form[$this->fieldName]['widget'], 'Option 1 exists'); + $this->assertArrayHasKey(2, $form[$this->fieldName]['widget'], 'Option 2 exists'); + $this->assertArrayHasKey(3, $form[$this->fieldName]['widget'], 'Option 3 exists'); // Test the generateSampleValue() method. $entity = EntityTest::create(); diff --git a/web/core/modules/path/tests/src/Functional/PathAliasTest.php b/web/core/modules/path/tests/src/Functional/PathAliasTest.php index 04acb78a1b20e7fa853fb4065aec0a36b3ef44e1..013ceebdc3d13cd36ecaccb22afae0cc971b2c07 100644 --- a/web/core/modules/path/tests/src/Functional/PathAliasTest.php +++ b/web/core/modules/path/tests/src/Functional/PathAliasTest.php @@ -267,9 +267,9 @@ public function testNodeAlias() { // Confirm the 'canonical' and 'shortlink' URLs. $elements = $this->xpath("//link[contains(@rel, 'canonical') and contains(@href, '" . $edit['path[0][alias]'] . "')]"); - $this->assertTrue(!empty($elements), 'Page contains canonical link URL.'); + $this->assertNotEmpty($elements, 'Page contains canonical link URL.'); $elements = $this->xpath("//link[contains(@rel, 'shortlink') and contains(@href, 'node/" . $node1->id() . "')]"); - $this->assertTrue(!empty($elements), 'Page contains shortlink URL.'); + $this->assertNotEmpty($elements, 'Page contains shortlink URL.'); $previous = $edit['path[0][alias]']; // Change alias to one containing "exotic" characters. diff --git a/web/core/modules/path/tests/src/Functional/PathTaxonomyTermTest.php b/web/core/modules/path/tests/src/Functional/PathTaxonomyTermTest.php index 821727d1993afe0e5a2380640c64c0d93e8558de..b578e92640ecbd8ed46a01b4601295f5db1a8322 100644 --- a/web/core/modules/path/tests/src/Functional/PathTaxonomyTermTest.php +++ b/web/core/modules/path/tests/src/Functional/PathTaxonomyTermTest.php @@ -69,9 +69,9 @@ public function testTermAlias() { // Confirm the 'canonical' and 'shortlink' URLs. $elements = $this->xpath("//link[contains(@rel, 'canonical') and contains(@href, '" . $edit['path[0][alias]'] . "')]"); - $this->assertTrue(!empty($elements), 'Term page contains canonical link URL.'); + $this->assertNotEmpty($elements, 'Term page contains canonical link URL.'); $elements = $this->xpath("//link[contains(@rel, 'shortlink') and contains(@href, 'taxonomy/term/" . $tid . "')]"); - $this->assertTrue(!empty($elements), 'Term page contains shortlink URL.'); + $this->assertNotEmpty($elements, 'Term page contains shortlink URL.'); // Change the term's URL alias. $edit2 = []; diff --git a/web/core/modules/quickedit/tests/src/Kernel/QuickEditLoadingTest.php b/web/core/modules/quickedit/tests/src/Kernel/QuickEditLoadingTest.php index d034d2c9e140a1158d6ab8dacb44767f250815c3..0066ca9495e9a623cb6c464ad0e45de8e31c8524 100644 --- a/web/core/modules/quickedit/tests/src/Kernel/QuickEditLoadingTest.php +++ b/web/core/modules/quickedit/tests/src/Kernel/QuickEditLoadingTest.php @@ -77,12 +77,12 @@ public function testDisplayOptions() { $build = $node->body->view(['label' => 'inline']); $this->setRawContent($renderer->renderRoot($build)); $elements = $this->xpath('//div[@data-quickedit-field-id]'); - $this->assertFalse(!empty($elements), 'data-quickedit-field-id attribute not added when rendering field using dynamic display options.'); + $this->assertEmpty($elements, 'data-quickedit-field-id attribute not added when rendering field using dynamic display options.'); $build = $node->body->view('default'); $this->setRawContent($renderer->renderRoot($build)); $elements = $this->xpath('//div[@data-quickedit-field-id="node/1/body/en/default"]'); - $this->assertTrue(!empty($elements), 'Body with data-quickedit-field-id attribute found.'); + $this->assertNotEmpty($elements, 'Body with data-quickedit-field-id attribute found.'); } } diff --git a/web/core/modules/search/migrations/d7_search_page.yml b/web/core/modules/search/migrations/d7_search_page.yml index 033bd409d62b9b0c4327d6829928971397099e20..cb30ed1347048fdf67f5ef912809afb6fd6bc9e9 100644 --- a/web/core/modules/search/migrations/d7_search_page.yml +++ b/web/core/modules/search/migrations/d7_search_page.yml @@ -41,6 +41,9 @@ process: - module - 'constants/suffix' path: module + configuration: + plugin: default_value + default_value: [ ] 'configuration/rankings': plugin: search_configuration_rankings destination: diff --git a/web/core/modules/search/migrations/search_page.yml b/web/core/modules/search/migrations/search_page.yml index 2847a191ff4a0a0e714948a157da6911113f1e26..9ab1858c40a6ce04085a74f8721d0432bfce2cc6 100644 --- a/web/core/modules/search/migrations/search_page.yml +++ b/web/core/modules/search/migrations/search_page.yml @@ -21,6 +21,9 @@ process: id: 'constants/id' path: 'constants/path' plugin: 'constants/plugin' + configuration: + plugin: default_value + default_value: [ ] 'configuration/rankings': plugin: search_configuration_rankings destination: diff --git a/web/core/modules/search/tests/src/Functional/SearchBlockTest.php b/web/core/modules/search/tests/src/Functional/SearchBlockTest.php index c1c18c7b919bd30a4d831a2330ec8c25fa34e16e..7cf659ba49487e3ed0b0e052a87da6597b934a01 100644 --- a/web/core/modules/search/tests/src/Functional/SearchBlockTest.php +++ b/web/core/modules/search/tests/src/Functional/SearchBlockTest.php @@ -64,7 +64,7 @@ public function testSearchFormBlock() { // Check that name attribute is not empty. $pattern = "//input[@type='submit' and @name='']"; $elements = $this->xpath($pattern); - $this->assertTrue(empty($elements), 'The search input field does not have empty name attribute.'); + $this->assertEmpty($elements, 'The search input field does not have empty name attribute.'); // Test a normal search via the block form, from the front page. $terms = ['keys' => 'test']; diff --git a/web/core/modules/search/tests/src/Kernel/Migrate/d6/MigrateSearchPageTest.php b/web/core/modules/search/tests/src/Kernel/Migrate/d6/MigrateSearchPageTest.php index 1321943b5e18aca3b24e4efe8e946bcaafe32017..e98da3bac609ce1536cab9055bffdc29c9e7f3ab 100644 --- a/web/core/modules/search/tests/src/Kernel/Migrate/d6/MigrateSearchPageTest.php +++ b/web/core/modules/search/tests/src/Kernel/Migrate/d6/MigrateSearchPageTest.php @@ -60,6 +60,20 @@ public function testSearchPage() { $configuration = SearchPage::load($id)->getPlugin()->getConfiguration(); $this->assertSame(4, $configuration['rankings']['comments']); + + // Test that a configurable search without a configuration imports. Do this + // by removing the node rankings from the source database. + Database::getConnection('default', 'migrate') + ->delete('variable') + ->condition('name', 'node_rank_%', 'LIKE') + ->execute(); + + $migration = $this->getMigration('search_page'); + $migration->getIdMap()->prepareUpdate(); + $this->executeMigration($migration); + + $configuration = SearchPage::load($id)->getPlugin()->getConfiguration(); + $this->assertSame([], $configuration['rankings']); } } diff --git a/web/core/modules/search/tests/src/Kernel/Migrate/d7/MigrateSearchPageTest.php b/web/core/modules/search/tests/src/Kernel/Migrate/d7/MigrateSearchPageTest.php index d3e8ee38ea987cb5107807bc934b5c8cc61a3feb..8d353e0a76eb2cc729a81a6141e44a93884864db 100644 --- a/web/core/modules/search/tests/src/Kernel/Migrate/d7/MigrateSearchPageTest.php +++ b/web/core/modules/search/tests/src/Kernel/Migrate/d7/MigrateSearchPageTest.php @@ -79,6 +79,19 @@ public function testSearchPage() { $this->executeMigration($migration); $configuration['rankings']['comments'] = 4; $this->assertEntity('node_search', 'node', TRUE, $configuration); + + // Test that a configurable search without a configuration imports. Do this + // by removing the node rankings from the source database. + Database::getConnection('default', 'migrate') + ->delete('variable') + ->condition('name', 'node_rank_%', 'LIKE') + ->execute(); + + $migration = $this->getMigration('d7_search_page'); + $migration->getIdMap()->prepareUpdate(); + $this->executeMigration($migration); + $configuration = ['rankings' => []]; + $this->assertEntity('node_search', 'node', TRUE, $configuration); } /** diff --git a/web/core/modules/search/tests/src/Kernel/SearchExcerptTest.php b/web/core/modules/search/tests/src/Kernel/SearchExcerptTest.php index 7ef4044eab25080ab12912b1a420d75e98f8d949..3d740bb586d2e89942f5193dc5d9a0062403388f 100644 --- a/web/core/modules/search/tests/src/Kernel/SearchExcerptTest.php +++ b/web/core/modules/search/tests/src/Kernel/SearchExcerptTest.php @@ -64,7 +64,7 @@ public function testSearchExcerpt() { // 123456789 HTMLTest +123456789+‘ +‘ +‘ +‘ +12345678 +‘ +‘ +‘ ‘ $text = "<div class=\"field field--name-body field--type-text-with-summary field--label-hidden\"><div class=\"field__items\"><div class=\"field__item even\" property=\"content:encoded\"><p>123456789 HTMLTest +123456789+‘ +‘ +‘ +‘ +12345678 +‘ +‘ +‘ ‘</p>\n</div></div></div> "; $result = $this->doSearchExcerpt('HTMLTest', $text); - $this->assertFalse(empty($result), 'Rendered Multi-byte HTML encodings are not corrupted in search excerpts'); + $this->assertNotEmpty($result, 'Rendered Multi-byte HTML encodings are not corrupted in search excerpts'); } /** diff --git a/web/core/modules/shortcut/migrations/d7_shortcut_set_users.yml b/web/core/modules/shortcut/migrations/d7_shortcut_set_users.yml index 9797c0a26fbda5b68758534f3ce7e6e2c5fc1696..54e9e1281dd5794289b91247f60bc827bca7cdf8 100644 --- a/web/core/modules/shortcut/migrations/d7_shortcut_set_users.yml +++ b/web/core/modules/shortcut/migrations/d7_shortcut_set_users.yml @@ -1,5 +1,6 @@ id: d7_shortcut_set_users label: Shortcut set user mapping +# This configuration migration depends on the d7_user content migration. migration_tags: - Drupal 7 - Configuration diff --git a/web/core/modules/system/src/Controller/DbUpdateController.php b/web/core/modules/system/src/Controller/DbUpdateController.php index 417fa6a5f560a3b9d9d8a46ce75f00b2ed9b6110..f7dc4a3555419f719849e9ce61f5bd0eac35b740 100644 --- a/web/core/modules/system/src/Controller/DbUpdateController.php +++ b/web/core/modules/system/src/Controller/DbUpdateController.php @@ -138,7 +138,7 @@ public static function create(ContainerInterface $container) { * The current request object. * * @return \Symfony\Component\HttpFoundation\Response - * A response object object. + * A response object. */ public function handle($op, Request $request) { require_once $this->root . '/core/includes/install.inc'; diff --git a/web/core/modules/system/system.install b/web/core/modules/system/system.install index 88d30e538711170c8b5132026eae1b4046643b8f..f07133bcd4277f1fb1537265efbae8cb2f829671 100644 --- a/web/core/modules/system/system.install +++ b/web/core/modules/system/system.install @@ -953,7 +953,7 @@ function system_requirements($phase) { // Check for an incompatible version. $required_file = $files[$required_module]; $required_name = $required_file->info['name']; - $version = str_replace(\Drupal::CORE_COMPATIBILITY . '-', '', $required_file->info['version']); + $version = str_replace(\Drupal::CORE_COMPATIBILITY . '-', '', $required_file->info['version'] ?? ''); if (!$requirement->isCompatible($version)) { $requirements["$extension_name-$required_module"] = [ 'title' => t('Unresolved dependency'), diff --git a/web/core/modules/system/system.post_update.php b/web/core/modules/system/system.post_update.php index 0cc50521c1a4738cf4b4f784be406507dd3944f3..7ddcda6476b2b169cac1092db963ddb97f0831af 100644 --- a/web/core/modules/system/system.post_update.php +++ b/web/core/modules/system/system.post_update.php @@ -5,6 +5,7 @@ * Post update functions for System. */ +use Drupal\Core\Site\Settings; use Drupal\Core\Config\Entity\ConfigEntityUpdater; use Drupal\Core\Entity\Display\EntityDisplayInterface; use Drupal\Core\Entity\Display\EntityViewDisplayInterface; @@ -208,9 +209,27 @@ function system_post_update_delete_authorize_settings() { /** * Sort all configuration according to its schema. */ -function system_post_update_sort_all_config() { +function system_post_update_sort_all_config(&$sandbox) { $factory = \Drupal::configFactory(); - foreach ($factory->listAll() as $name) { - $factory->getEditable($name)->save(); + $iteration_size = Settings::get('entity_update_batch_size', 50); + + if (empty($sandbox['progress'])) { + $sandbox['progress'] = 0; + $sandbox['all_config_names'] = $factory->listAll(); + $sandbox['max'] = count($sandbox['all_config_names']); + } + + $start = $sandbox['progress']; + $end = min($sandbox['max'], $start + $iteration_size); + for ($i = $start; $i < $end; $i++) { + $factory->getEditable($sandbox['all_config_names'][$i])->save(); + } + + if ($sandbox['max'] > 0 && $end < $sandbox['max']) { + $sandbox['progress'] = $end; + $sandbox['#finished'] = ($end - 1) / $sandbox['max']; + } + else { + $sandbox['#finished'] = 1; } } diff --git a/web/core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/EntityTestEntityLevel.php b/web/core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/EntityTestEntityLevel.php index 247b8b670f549fdb1ac27f62559f8e70e45735ed..54b96f7b8d845096bc20895b2b63ec02758e9ced 100644 --- a/web/core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/EntityTestEntityLevel.php +++ b/web/core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/EntityTestEntityLevel.php @@ -5,7 +5,7 @@ use Symfony\Component\Validator\Constraint; /** - * Constraint on entity entity level. + * Constraint on entity level. * * @Constraint( * id = "EntityTestEntityLevel", diff --git a/web/core/modules/system/tests/modules/js_message_test/src/Controller/JSMessageTestController.php b/web/core/modules/system/tests/modules/js_message_test/src/Controller/JSMessageTestController.php index b637833771aaa387cfecab627dea89785cac7580..c6cd8b4670f69a0e6f468676668cb7cedb76d9ae 100644 --- a/web/core/modules/system/tests/modules/js_message_test/src/Controller/JSMessageTestController.php +++ b/web/core/modules/system/tests/modules/js_message_test/src/Controller/JSMessageTestController.php @@ -21,7 +21,7 @@ public static function getTypes() { * Gets the test messages selectors. * * @return string[] - * The test test messages selectors. + * The test messages selectors. * * @see core/modules/system/tests/themes/test_messages/templates/status-messages.html.twig */ diff --git a/web/core/modules/system/tests/src/Functional/Common/NoJavaScriptAnonymousTest.php b/web/core/modules/system/tests/src/Functional/Common/NoJavaScriptAnonymousTest.php index 4e064969f8fd58200c273319ff214313591c064f..110fc1516f9f6331d4ef673d082f91c4720ac7ee 100644 --- a/web/core/modules/system/tests/src/Functional/Common/NoJavaScriptAnonymousTest.php +++ b/web/core/modules/system/tests/src/Functional/Common/NoJavaScriptAnonymousTest.php @@ -53,7 +53,7 @@ public function testNoJavaScript() { protected function assertNoJavaScript(): void { // Ensure drupalSettings is not set. $settings = $this->getDrupalSettings(); - $this->assertTrue(empty($settings), 'drupalSettings is not set.'); + $this->assertEmpty($settings, 'drupalSettings is not set.'); $this->assertSession()->responseNotMatches('/\.js/'); } 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 7c4eddd2fd38f7f331b52c35c9f3bdd553600b40..d1b00eea3650a0791b0c1bcfbf8c1f88ba49c340 100644 --- a/web/core/modules/system/tests/src/Functional/Form/FormTest.php +++ b/web/core/modules/system/tests/src/Functional/Form/FormTest.php @@ -147,7 +147,7 @@ public function testRequiredFields() { else { // Make sure there is *no* form error for this element. We're // not using assertEmpty() because the array key might not exist. - $this->assertTrue(empty($errors[$element]), "Optional '$type' field '$element' has no errors with empty input"); + $this->assertArrayNotHasKey($element, $errors, "Optional '$type' field '$element' should have no errors with empty input."); } } } diff --git a/web/core/modules/system/tests/src/Functional/Form/StorageTest.php b/web/core/modules/system/tests/src/Functional/Form/StorageTest.php index 847a6b460899d90baca55ee9f4a3370a1ab466f0..385ca20392a84a324da3f345cee70bb678ac28cd 100644 --- a/web/core/modules/system/tests/src/Functional/Form/StorageTest.php +++ b/web/core/modules/system/tests/src/Functional/Form/StorageTest.php @@ -211,8 +211,8 @@ public function testImmutableFormLegacyProtection() { $original = json_decode($response, TRUE); $this->assertEquals($original['form']['#build_id_old'], $build_id, 'Original build_id was recorded'); $this->assertNotEquals($original['form']['#build_id'], $build_id, 'New build_id was generated'); - $this->assertTrue(empty($original['form']['#poisoned']), 'Original form structure was preserved'); - $this->assertTrue(empty($original['form_state']['poisoned']), 'Original form state was preserved'); + $this->assertArrayNotHasKey('#poisoned', $original['form'], 'Original form structure was preserved'); + $this->assertArrayNotHasKey('poisoned', $original['form_state'], 'Original form state was preserved'); } } diff --git a/web/core/modules/system/tests/src/Functional/Menu/AssertBreadcrumbTrait.php b/web/core/modules/system/tests/src/Functional/Menu/AssertBreadcrumbTrait.php index c7544febcc217f6767261e487101e13cbec558cb..18be52036923aeb456876d3c4378cead3e7eeee9 100644 --- a/web/core/modules/system/tests/src/Functional/Menu/AssertBreadcrumbTrait.php +++ b/web/core/modules/system/tests/src/Functional/Menu/AssertBreadcrumbTrait.php @@ -100,7 +100,7 @@ protected function assertBreadcrumbParts($trail) { */ protected function getBreadcrumbParts() { $parts = []; - $elements = $this->xpath('//nav[@class="breadcrumb"]/ol/li/a'); + $elements = $this->xpath('//nav[@aria-labelledby="system-breadcrumb"]/ol/li/a'); if (!empty($elements)) { foreach ($elements as $element) { $parts[] = [ diff --git a/web/core/modules/system/tests/src/Functional/Menu/AssertMenuActiveTrailTrait.php b/web/core/modules/system/tests/src/Functional/Menu/AssertMenuActiveTrailTrait.php index f525f86441939df6f8bfc3d658f6026243cac69b..1f70d519533e310be730bc5a0037c266e3cd96af 100644 --- a/web/core/modules/system/tests/src/Functional/Menu/AssertMenuActiveTrailTrait.php +++ b/web/core/modules/system/tests/src/Functional/Menu/AssertMenuActiveTrailTrait.php @@ -2,7 +2,6 @@ namespace Drupal\Tests\system\Functional\Menu; -use Drupal\Component\Render\FormattableMarkup; use Drupal\Core\Url; /** @@ -40,7 +39,7 @@ protected function assertMenuActiveTrail($tree, $last_active) { $i++; } $elements = $this->xpath($xpath); - $this->assertTrue(!empty($elements), 'Active trail to current page was found in menu tree.'); + $this->assertNotEmpty($elements, 'Active trail to current page should be visible in menu tree.'); // Append prefix for active link asserted below. $xpath .= '/following-sibling::ul/descendant::'; @@ -57,10 +56,7 @@ protected function assertMenuActiveTrail($tree, $last_active) { ':title' => $active_link_title, ]; $elements = $this->xpath($xpath, $args); - $this->assertTrue(!empty($elements), new FormattableMarkup('Active link %title was found in menu tree, including active trail links %tree.', [ - '%title' => $active_link_title, - '%tree' => implode(' » ', $tree), - ])); + $this->assertNotEmpty($elements, sprintf('Active link %s should be visible in menu tree, including active trail links %s.', $active_link_title, implode(' » ', $tree))); } } 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 9c2ed52147742b3c4daa4ba53f27e9f175409b35..d8ad8a6090aeabbbb6ee6691351d5b6c3eb2f9db 100644 --- a/web/core/modules/system/tests/src/Functional/Menu/LocalTasksTest.php +++ b/web/core/modules/system/tests/src/Functional/Menu/LocalTasksTest.php @@ -176,7 +176,7 @@ public function testPluginLocalTask() { $this->assertEquals('menu_test', $definitions['menu_test.local_task_test_tasks_settings_sub2']['provider']); $this->assertEquals('menu_test', $definitions['menu_test.local_task_test_tasks_settings_sub3']['provider']); - // Test that we we correctly apply the active class to tabs where one of the + // Test that we correctly apply the active class to tabs where one of the // request attributes is upcast to an entity object. $entity = \Drupal::entityTypeManager()->getStorage('entity_test')->create(['bundle' => 'test']); $entity->save(); diff --git a/web/core/modules/system/tests/src/Functional/Module/DependencyTest.php b/web/core/modules/system/tests/src/Functional/Module/DependencyTest.php index 7ec785f3f5919e688d1931ae4e8672497d1def4b..54e4e0d82d131912aa0656f90f0265d12d0fc34d 100644 --- a/web/core/modules/system/tests/src/Functional/Module/DependencyTest.php +++ b/web/core/modules/system/tests/src/Functional/Module/DependencyTest.php @@ -2,6 +2,7 @@ namespace Drupal\Tests\system\Functional\Module; +use Drupal\Component\Serialization\Yaml; use Drupal\Component\Utility\Unicode; /** @@ -96,6 +97,48 @@ public function testIncompatibleCoreVersionDependency() { $this->assertSession()->fieldDisabled('modules[system_incompatible_core_version_dependencies_test][enable]'); } + /** + * Tests visiting admin/modules when a module outside of core has no version. + */ + public function testNoVersionInfo() { + // Create a module for testing. We set core_version_requirement to '*' for + // the test so that it does not need to be updated between major versions. + $info = [ + 'type' => 'module', + 'core_version_requirement' => '*', + 'name' => 'System no module version dependency test', + ]; + $path = $this->siteDirectory . '/modules/system_no_module_version_dependency_test'; + mkdir($path, 0777, TRUE); + file_put_contents("$path/system_no_module_version_dependency_test.info.yml", Yaml::encode($info)); + + $info = [ + 'type' => 'module', + 'core_version_requirement' => '*', + 'name' => 'System no module version test', + 'dependencies' => ['system_no_module_version_dependency_test'], + ]; + $path = $this->siteDirectory . '/modules/system_no_module_version_test'; + mkdir($path, 0777, TRUE); + file_put_contents("$path/system_no_module_version_test.info.yml", Yaml::encode($info)); + + $this->drupalGet('admin/modules'); + $this->assertSession()->pageTextContains('System no module version dependency test'); + $this->assertSession()->pageTextContains('System no module version test'); + + // Ensure the modules can actually be installed. + $edit['modules[system_no_module_version_test][enable]'] = 'system_no_module_version_test'; + $edit['modules[system_no_module_version_dependency_test][enable]'] = 'system_no_module_version_dependency_test'; + $this->drupalGet('admin/modules'); + $this->submitForm($edit, 'Install'); + $this->assertSession()->pageTextContains('2 modules have been enabled: System no module version dependency test, System no module version test.'); + + // Ensure status report is working. + $this->drupalLogin($this->createUser(['administer site configuration'])); + $this->drupalGet('admin/reports/status'); + $this->assertSession()->statusCodeEquals(200); + } + /** * Tests failing PHP version requirements. */ diff --git a/web/core/modules/system/tests/src/Functional/Session/SessionTest.php b/web/core/modules/system/tests/src/Functional/Session/SessionTest.php index 10c8f55b4704148a8f289c0b32af1da98dccfe08..4b696ea2d5b80ce0542d63b8ff5cd50cf2301f02 100644 --- a/web/core/modules/system/tests/src/Functional/Session/SessionTest.php +++ b/web/core/modules/system/tests/src/Functional/Session/SessionTest.php @@ -60,7 +60,7 @@ public function testSessionSaveRegenerate() { $this->drupalGet('session-test/id'); $matches = []; preg_match('/\s*session_id:(.*)\n/', $this->getSession()->getPage()->getContent(), $matches); - $this->assertTrue(!empty($matches[1]), 'Found session ID before logging in.'); + $this->assertNotEmpty($matches[1], 'Found session ID before logging in.'); $original_session = $matches[1]; // We cannot use $this->drupalLogin($user); because we exit in @@ -77,7 +77,7 @@ public function testSessionSaveRegenerate() { $this->drupalGet('session-test/id'); $matches = []; preg_match('/\s*session_id:(.*)\n/', $this->getSession()->getPage()->getContent(), $matches); - $this->assertTrue(!empty($matches[1]), 'Found session ID after logging in.'); + $this->assertNotEmpty($matches[1], 'Found session ID after logging in.'); $this->assertNotSame($original_session, $matches[1], 'Session ID changed after login.'); } diff --git a/web/core/modules/system/tests/src/Functional/Theme/EngineTwigTest.php b/web/core/modules/system/tests/src/Functional/Theme/EngineTwigTest.php index da8fe199b8bc3c67c4b9e8728979633e72b04f11..c358a92f74e4b77715d60bb4ceb7ee363bb838a6 100644 --- a/web/core/modules/system/tests/src/Functional/Theme/EngineTwigTest.php +++ b/web/core/modules/system/tests/src/Functional/Theme/EngineTwigTest.php @@ -69,7 +69,7 @@ public function testTwigUrlGenerator() { // Make sure we got something. $content = $this->getSession()->getPage()->getContent(); - $this->assertFalse(empty($content), 'Page content is not empty'); + $this->assertNotEmpty($content, 'Page content is not empty'); foreach ($expected as $string) { $this->assertSession()->responseContains('<div>' . $string . '</div>'); } @@ -103,7 +103,7 @@ public function testTwigLinkGenerator() { $this->assertCacheContext('url.site'); $content = $this->getSession()->getPage()->getContent(); - $this->assertFalse(empty($content), 'Page content is not empty'); + $this->assertNotEmpty($content, 'Page content is not empty'); foreach ($expected as $string) { $this->assertSession()->responseContains('<div>' . $string . '</div>'); } @@ -122,7 +122,7 @@ public function testTwigUrlToString() { ]; $content = $this->getSession()->getPage()->getContent(); - $this->assertFalse(empty($content), 'Page content is not empty'); + $this->assertNotEmpty($content, 'Page content is not empty'); foreach ($expected as $string) { $this->assertSession()->responseContains('<div>' . $string . '</div>'); } diff --git a/web/core/modules/system/tests/src/Kernel/Action/ActionTest.php b/web/core/modules/system/tests/src/Kernel/Action/ActionTest.php index 2dac37555cec52d73f7476076ab4dd4176800d53..becf628e64b7446a8c0ac0a62ca996fab0242c01 100644 --- a/web/core/modules/system/tests/src/Kernel/Action/ActionTest.php +++ b/web/core/modules/system/tests/src/Kernel/Action/ActionTest.php @@ -45,13 +45,13 @@ public function testOperations() { $definitions = $this->actionManager->getDefinitions(); // Verify that the action definitions are found. $this->assertGreaterThan(1, count($definitions)); - $this->assertTrue(!empty($definitions['action_test_no_type']), 'The test action is among the definitions found.'); + $this->assertNotEmpty($definitions['action_test_no_type'], 'The test action is among the definitions found.'); $definition = $this->actionManager->getDefinition('action_test_no_type'); - $this->assertTrue(!empty($definition), 'The test action definition is found.'); + $this->assertNotEmpty($definition, 'The test action definition is found.'); $definitions = $this->actionManager->getDefinitionsByType('user'); - $this->assertTrue(empty($definitions['action_test_no_type']), 'An action with no type is not found.'); + $this->assertArrayNotHasKey('action_test_no_type', $definitions, 'An action with no type is not found.'); // Create an instance of the 'save entity' action. $action = $this->actionManager->createInstance('action_test_save_entity'); diff --git a/web/core/modules/system/tests/src/Kernel/Entity/EntityReferenceSelectionReferenceableTest.php b/web/core/modules/system/tests/src/Kernel/Entity/EntityReferenceSelectionReferenceableTest.php index bab37c3981dde82392e77bbedf5601a15f20a03b..a0e5bc68749f03ccdc88177ede4ade47b91d9f48 100644 --- a/web/core/modules/system/tests/src/Kernel/Entity/EntityReferenceSelectionReferenceableTest.php +++ b/web/core/modules/system/tests/src/Kernel/Entity/EntityReferenceSelectionReferenceableTest.php @@ -113,7 +113,7 @@ public function testReferenceablesWithNoLabelKey($match, $match_operator, $limit // Number of returned items. if (empty($count_limited)) { - $this->assertTrue(empty($referenceables[$this->bundle])); + $this->assertArrayNotHasKey($this->bundle, $referenceables); } else { $this->assertCount($count_limited, $referenceables[$this->bundle]); diff --git a/web/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php b/web/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php index 8ca75e1065829d2ab4a1bd16195bbd072c12d4da..42278b772ec084abe5458116a3a90ad11e4dc205 100644 --- a/web/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php +++ b/web/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php @@ -26,7 +26,11 @@ class ModuleHandlerTest extends KernelTestBase { */ public function testModuleList() { $module_list = ['system']; - + $database_module = \Drupal::database()->getProvider(); + if ($database_module !== 'core') { + $module_list[] = $database_module; + } + sort($module_list); $this->assertModuleList($module_list, 'Initial'); // Try to install a new module. @@ -297,7 +301,7 @@ public function testModuleMetaData() { // Generate the list of available modules. $modules = $this->container->get('extension.list.module')->getList(); // Check that the mtime field exists for the system module. - $this->assertTrue(!empty($modules['system']->info['mtime']), 'The system.info.yml file modification time field is present.'); + $this->assertNotEmpty($modules['system']->info['mtime'], 'The system.info.yml file modification time field is present.'); // Use 0 if mtime isn't present, to avoid an array index notice. $test_mtime = !empty($modules['system']->info['mtime']) ? $modules['system']->info['mtime'] : 0; // Ensure the mtime field contains a number that is greater than zero. @@ -329,7 +333,7 @@ public function testThemeMetaData() { // Generate the list of available themes. $themes = \Drupal::service('theme_handler')->rebuildThemeData(); // Check that the mtime field exists for the bartik theme. - $this->assertTrue(!empty($themes['bartik']->info['mtime']), 'The bartik.info.yml file modification time field is present.'); + $this->assertNotEmpty($themes['bartik']->info['mtime'], 'The bartik.info.yml file modification time field is present.'); // Use 0 if mtime isn't present, to avoid an array index notice. $test_mtime = !empty($themes['bartik']->info['mtime']) ? $themes['bartik']->info['mtime'] : 0; // Ensure the mtime field contains a number that is greater than zero. diff --git a/web/core/modules/taxonomy/src/TermStorageInterface.php b/web/core/modules/taxonomy/src/TermStorageInterface.php index 4271805ac574d4456fb6025ff99b72759145f51c..610ede6fbe6432958d5f626daf7ed5d72af0eb6f 100644 --- a/web/core/modules/taxonomy/src/TermStorageInterface.php +++ b/web/core/modules/taxonomy/src/TermStorageInterface.php @@ -29,7 +29,7 @@ public function deleteTermHierarchy($tids); * Term entity that needs to be added to term hierarchy information. * * @todo remove this method Drupal 9.0.x. Now the parent references are - * automatically updates when when a taxonomy term is added/updated. + * automatically updates when a taxonomy term is added/updated. * https://www.drupal.org/node/2785693 */ public function updateTermHierarchy(EntityInterface $term); diff --git a/web/core/modules/taxonomy/tests/src/Functional/TaxonomyTermIndentationTest.php b/web/core/modules/taxonomy/tests/src/Functional/TaxonomyTermIndentationTest.php index 30d27000f3e1838a5b5ffa1af0f84cfeda5d66c9..85b25ffe9b65c613eaf0985058ba2cd6140a41c9 100644 --- a/web/core/modules/taxonomy/tests/src/Functional/TaxonomyTermIndentationTest.php +++ b/web/core/modules/taxonomy/tests/src/Functional/TaxonomyTermIndentationTest.php @@ -97,7 +97,7 @@ public function testTermIndentation() { // Check explicitly that term 2 has no parents. \Drupal::entityTypeManager()->getStorage('taxonomy_term')->resetCache(); $parents = $taxonomy_storage->loadParents($term2->id()); - $this->assertTrue(empty($parents), 'Term 2 has no parents now'); + $this->assertEmpty($parents, 'Term 2 has no parents now'); } } diff --git a/web/core/modules/taxonomy/tests/src/Functional/TermAutocompleteTest.php b/web/core/modules/taxonomy/tests/src/Functional/TermAutocompleteTest.php index ab39d7babc96bcd7e1d09c3319aa495607e822d3..f64a0af32f711dd615fc81a1713026b2ac1ba2c2 100644 --- a/web/core/modules/taxonomy/tests/src/Functional/TermAutocompleteTest.php +++ b/web/core/modules/taxonomy/tests/src/Functional/TermAutocompleteTest.php @@ -172,7 +172,7 @@ public function testAutocompleteCountResults() { $this->autocompleteUrl, ['query' => ['q' => 'zzz']] ); - $this->assertTrue(empty($data), 'Autocomplete returned no results'); + $this->assertEmpty($data, 'Autocomplete returned no results'); // Test that only one matching term found, when only one matches. $data = $this->drupalGetJson( diff --git a/web/core/modules/taxonomy/tests/src/Functional/TermTest.php b/web/core/modules/taxonomy/tests/src/Functional/TermTest.php index 99d4a1e74957c3c949ca1ebe2093dfc66450c33e..4ec62e5bdfa369a01e3c3a425534870c06cf5f04 100644 --- a/web/core/modules/taxonomy/tests/src/Functional/TermTest.php +++ b/web/core/modules/taxonomy/tests/src/Functional/TermTest.php @@ -275,7 +275,7 @@ public function testNodeTermCreationAndDeletion() { $this->assertSession()->pageTextContains($term); } $tree = $this->container->get('entity_type.manager')->getStorage('taxonomy_term')->loadTree($this->vocabulary->id()); - $this->assertTrue(empty($tree), 'The terms are not created on preview.'); + $this->assertEmpty($tree, 'The terms are not created on preview.'); // Save, creating the terms. $this->drupalGet('node/add/article'); diff --git a/web/core/modules/taxonomy/tests/src/Kernel/TermKernelTest.php b/web/core/modules/taxonomy/tests/src/Kernel/TermKernelTest.php index 3f85b2f81940291b26b6fe5329d67a79664bb055..29e43b72bf56f8ac7e3f0811748c0d08f0f96024 100644 --- a/web/core/modules/taxonomy/tests/src/Kernel/TermKernelTest.php +++ b/web/core/modules/taxonomy/tests/src/Kernel/TermKernelTest.php @@ -38,7 +38,7 @@ public function testTermDelete() { // Delete a valid term. $valid_term->delete(); $terms = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadByProperties(['vid' => $vocabulary->id()]); - $this->assertTrue(empty($terms), 'Vocabulary is empty after deletion'); + $this->assertEmpty($terms, 'Vocabulary is empty after deletion'); } /** @@ -57,12 +57,12 @@ public function testMultipleParentDelete() { $term_storage = $this->container->get('entity_type.manager')->getStorage('taxonomy_term'); $term_storage->resetCache([$child_term_id]); $child_term = Term::load($child_term_id); - $this->assertTrue(!empty($child_term), 'Child term is not deleted if only one of its parents is removed.'); + $this->assertNotEmpty($child_term, 'Child term is not deleted if only one of its parents is removed.'); $parent_term2->delete(); $term_storage->resetCache([$child_term_id]); $child_term = Term::load($child_term_id); - $this->assertTrue(empty($child_term), 'Child term is deleted if all of its parents are removed.'); + $this->assertEmpty($child_term, 'Child term is deleted if all of its parents are removed.'); } /** @@ -161,11 +161,11 @@ public function testTermPreview() { // Confirm we can get the view of unsaved term. $render_array = $entity_manager->getViewBuilder('taxonomy_term') ->view($term); - $this->assertTrue(!empty($render_array), 'Term view builder is built.'); + $this->assertNotEmpty($render_array, 'Term view builder is built.'); // Confirm we can render said view. $rendered = \Drupal::service('renderer')->renderPlain($render_array); - $this->assertTrue(!empty(trim($rendered)), 'Term is able to be rendered.'); + $this->assertNotEmpty(trim($rendered), 'Term is able to be rendered.'); } } diff --git a/web/core/modules/text/tests/src/Kernel/TextSummaryTest.php b/web/core/modules/text/tests/src/Kernel/TextSummaryTest.php index 5537e74acc0cd7d2ae0376c50c5c9ac8e480963c..acac900bfcea184aa7f24595358747a8434a9098 100644 --- a/web/core/modules/text/tests/src/Kernel/TextSummaryTest.php +++ b/web/core/modules/text/tests/src/Kernel/TextSummaryTest.php @@ -297,8 +297,8 @@ public function testRequiredSummary() { 'test_textwithsummary' => ['value' => $this->randomMachineName()], ]); $form = \Drupal::service('entity.form_builder')->getForm($entity); - $this->assertTrue(!empty($form['test_textwithsummary']['widget'][0]['summary']), 'Summary field is shown'); - $this->assertTrue(!empty($form['test_textwithsummary']['widget'][0]['summary']['#required']), 'Summary field is required'); + $this->assertNotEmpty($form['test_textwithsummary']['widget'][0]['summary'], 'Summary field is shown'); + $this->assertNotEmpty($form['test_textwithsummary']['widget'][0]['summary']['#required'], 'Summary field is required'); // Test validation. /** @var \Symfony\Component\Validator\ConstraintViolation[] $violations */ diff --git a/web/core/modules/tour/tests/src/Functional/TourTestBase.php b/web/core/modules/tour/tests/src/Functional/TourTestBase.php index 23f2190f42376d3a568698e338728f9aff48c45d..21b6f3fe169b2a82be359fcad30cde33f6b8497b 100644 --- a/web/core/modules/tour/tests/src/Functional/TourTestBase.php +++ b/web/core/modules/tour/tests/src/Functional/TourTestBase.php @@ -59,7 +59,7 @@ public function assertTourTips($tips = []) { } elseif (!empty($tip['data-class'])) { $elements = $this->getSession()->getPage()->findAll('css', '.' . $tip['data-class']); - $this->assertFalse(empty($elements), new FormattableMarkup('Found corresponding page element for tour tip with class .%data-class', ['%data-class' => $tip['data-class']])); + $this->assertNotEmpty($elements, sprintf("Page element for tour tip with class .%s should be present", $tip['data-class'])); } else { // It's a modal. diff --git a/web/core/modules/update/tests/src/Functional/FileTransferAuthorizeFormTest.php b/web/core/modules/update/tests/src/Functional/FileTransferAuthorizeFormTest.php index 58fda4cf9e8e1e110904df5b91551f29ba1df4f1..1d75ab8eadd1241cab66808bfd0834f7f9e7e0f1 100644 --- a/web/core/modules/update/tests/src/Functional/FileTransferAuthorizeFormTest.php +++ b/web/core/modules/update/tests/src/Functional/FileTransferAuthorizeFormTest.php @@ -26,7 +26,6 @@ protected function setUp(): void { $admin_user = $this->drupalCreateUser([ 'administer modules', 'administer software updates', - 'administer site configuration', ]); $this->drupalLogin($admin_user); diff --git a/web/core/modules/update/tests/src/Functional/UpdateContribTest.php b/web/core/modules/update/tests/src/Functional/UpdateContribTest.php index 30898f0c2d9d6851cbb68d9ba56c058a5a65b909..f00934dd9fd185a1820c6ae8fcc094f54be37368 100644 --- a/web/core/modules/update/tests/src/Functional/UpdateContribTest.php +++ b/web/core/modules/update/tests/src/Functional/UpdateContribTest.php @@ -63,7 +63,6 @@ public function testNoReleasesAvailable() { ]; $this->config('update_test.settings')->set('system_info', $system_info)->save(); $this->refreshUpdateStatus(['drupal' => '0.0', 'aaa_update_test' => 'no-releases']); - $this->drupalGet('admin/reports/updates'); // Cannot use $this->standardTests() because we need to check for the // 'No available releases found' string. $this->assertSession()->responseContains('<h3>Drupal core</h3>'); @@ -277,9 +276,6 @@ public function testNormalUpdateAvailable() { 'aaa_update_test' => str_replace('.', '_', $version) . $extra_version, ]); $this->standardTests(); - $this->drupalGet('admin/reports/updates'); - $this->clickLink('Check manually'); - $this->checkForMetaRefresh(); $assert_session->pageTextNotContains('Security update required!'); // The XML test fixtures for this method all contain the '8.x-3.0' // release but because '8.x-3.0' is not in a supported branch it will @@ -446,7 +442,7 @@ public function testUpdateHiddenBaseTheme() { $project_info = new ProjectInfo(); $project_info->processInfoList($projects, $theme_data, 'theme', TRUE); - $this->assertTrue(!empty($projects['update_test_basetheme']), 'Valid base theme (update_test_basetheme) was found.'); + $this->assertNotEmpty($projects['update_test_basetheme'], 'Valid base theme (update_test_basetheme) was found.'); } /** @@ -550,7 +546,6 @@ public function testHookUpdateStatusAlter() { 'aaa_update_test' => '1_0', ] ); - $this->drupalGet('admin/reports/updates'); $this->assertSession()->responseContains('<h3>Modules</h3>'); $this->assertSession()->pageTextContains('Security update required!'); $this->assertSession()->linkExists('AAA Update test'); diff --git a/web/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php b/web/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php index 64b371c5736903f3b7a9e1990b8adb0a2a50e96d..974b6eb48624a0cb37175c5922c66f18438b6a0e 100644 --- a/web/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php +++ b/web/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php @@ -344,6 +344,10 @@ public function testModulePageUpToDate() { * Checks the messages at admin/modules when an update is missing. */ public function testModulePageRegularUpdate() { + $this->drupalLogin($this->drupalCreateUser([ + 'administer site configuration', + 'administer modules', + ])); $this->setProjectInstalledVersion('8.0.0'); // Instead of using refreshUpdateStatus(), set these manually. $this->config('update.settings') @@ -366,6 +370,11 @@ public function testModulePageRegularUpdate() { * Checks the messages at admin/modules when a security update is missing. */ public function testModulePageSecurityUpdate() { + $this->drupalLogin($this->drupalCreateUser([ + 'administer site configuration', + 'administer modules', + 'administer themes', + ])); $this->setProjectInstalledVersion('8.0.0'); // Instead of using refreshUpdateStatus(), set these manually. $this->config('update.settings') diff --git a/web/core/modules/update/tests/src/Functional/UpdateSemverTestBase.php b/web/core/modules/update/tests/src/Functional/UpdateSemverTestBase.php index 348927bf8a0f6ca442721b35f928aac0dbb44538..f16e4f13498e9a3f35857a4cd93bb7938fec22b7 100644 --- a/web/core/modules/update/tests/src/Functional/UpdateSemverTestBase.php +++ b/web/core/modules/update/tests/src/Functional/UpdateSemverTestBase.php @@ -41,9 +41,7 @@ protected function setUp(): void { parent::setUp(); $admin_user = $this->drupalCreateUser([ 'administer site configuration', - 'administer modules', - 'administer themes', - ]); + ]); $this->drupalLogin($admin_user); $this->drupalPlaceBlock('local_actions_block'); } @@ -93,9 +91,6 @@ public function testNormalUpdateAvailable() { $full_version = "8.$minor_version.1$extra_version"; $this->refreshUpdateStatus([$this->updateProject => "$minor_version.1" . $extra_version]); $this->standardTests(); - $this->drupalGet('admin/reports/updates'); - $this->clickLink('Check manually'); - $this->checkForMetaRefresh(); $this->assertUpdateTableTextNotContains('Security update required!'); // The XML test fixtures for this method all contain the '8.2.0' release // but because '8.2.0' is not in a supported branch it will not be in @@ -158,9 +153,6 @@ public function testMajorUpdateAvailable() { $this->setProjectInstalledVersion("8.$minor_version.$patch_version" . $extra_version); $this->refreshUpdateStatus([$this->updateProject => '9']); $this->standardTests(); - $this->drupalGet('admin/reports/updates'); - $this->clickLink('Check manually'); - $this->checkForMetaRefresh(); $this->assertUpdateTableTextNotContains('Security update required!'); $this->assertUpdateTableElementContains(Link::fromTextAndUrl('9.0.0', Url::fromUri("http://example.com/{$this->updateProject}-9-0-0-release"))->toString()); $this->assertUpdateTableElementContains(Link::fromTextAndUrl('Download', Url::fromUri("http://example.com/{$this->updateProject}-9-0-0.tar.gz"))->toString()); diff --git a/web/core/modules/update/update.authorize.inc b/web/core/modules/update/update.authorize.inc index 13d5906942c157e1f52bc24a5856fdf3b15fc813..88fe7f95f6c9defc912fd2abf479de6edce8824f 100644 --- a/web/core/modules/update/update.authorize.inc +++ b/web/core/modules/update/update.authorize.inc @@ -68,7 +68,7 @@ function update_authorize_run_update($filetransfer, $projects) { * Callback for system_authorized_init() in * update_manager_install_form_submit(). * - * @param FileTransfer $filetransfer + * @param \Drupal\Core\FileTransfer\FileTransfer $filetransfer * The FileTransfer object created by authorize.php for use during this * operation. * @param string $project @@ -123,7 +123,7 @@ function update_authorize_run_install($filetransfer, $project, $updater_name, $l * @param string $local_url * The URL to the locally installed temp directory where the project has * already been downloaded and extracted into. - * @param FileTransfer $filetransfer + * @param \Drupal\Core\FileTransfer\FileTransfer $filetransfer * The FileTransfer object to use for performing this operation. * @param array $context * Reference to an array used for Batch API storage. diff --git a/web/core/modules/user/src/Authentication/Provider/Cookie.php b/web/core/modules/user/src/Authentication/Provider/Cookie.php index 0fcac24a0d09a44e14659241604ea6eda3350228..aea58f67ea80405e73b6ff153f2651c466faeb4e 100644 --- a/web/core/modules/user/src/Authentication/Provider/Cookie.php +++ b/web/core/modules/user/src/Authentication/Provider/Cookie.php @@ -6,6 +6,7 @@ use Drupal\Core\Authentication\AuthenticationProviderInterface; use Drupal\Core\Database\Connection; use Drupal\Core\Messenger\MessengerInterface; +use Drupal\Core\Routing\TrustedRedirectResponse; use Drupal\Core\Session\AccountInterface; use Drupal\Core\Session\UserSession; use Drupal\Core\Session\SessionConfigurationInterface; @@ -136,6 +137,12 @@ public function addCheckToUrl(ResponseEvent $event) { if (!empty($options['#fragment'])) { $url .= '#' . $options['#fragment']; } + // In the case of trusted redirect, we have to update the list of + // trusted URLs because here we've just modified its target URL + // which is in the list. + if ($response instanceof TrustedRedirectResponse) { + $response->setTrustedTargetUrl($url); + } $response->setTargetUrl($url); } } diff --git a/web/core/modules/user/tests/src/Functional/RestRegisterUserTest.php b/web/core/modules/user/tests/src/Functional/RestRegisterUserTest.php index 302944f924ed12822ff47c60f067dc0257c47a5f..14629c6776d326d41fa512f330bff276246f6296 100644 --- a/web/core/modules/user/tests/src/Functional/RestRegisterUserTest.php +++ b/web/core/modules/user/tests/src/Functional/RestRegisterUserTest.php @@ -81,7 +81,7 @@ public function testRegisterUser() { $config->save(); $user = $this->registerUser('Palmer.Eldritch'); $this->assertFalse($user->isBlocked()); - $this->assertFalse(empty($user->getPassword())); + $this->assertNotEmpty($user->getPassword()); $email_count = count($this->drupalGetMails()); $this->assertEquals(0, $email_count); @@ -103,7 +103,7 @@ public function testRegisterUser() { $config->save(); $name = 'Jason.Taverner'; $user = $this->registerUser($name, FALSE); - $this->assertTrue(empty($user->getPassword())); + $this->assertEmpty($user->getPassword()); $this->assertTrue($user->isBlocked()); $this->resetAll(); @@ -116,7 +116,7 @@ public function testRegisterUser() { $name = 'Argaven'; $user = $this->registerUser($name); $this->resetAll(); - $this->assertFalse(empty($user->getPassword())); + $this->assertNotEmpty($user->getPassword()); $this->assertTrue($user->isBlocked()); $this->assertMailString('body', 'Your application for an account is', 2); $this->assertMailString('body', 'Argaven has applied for an account', 2); @@ -128,7 +128,7 @@ public function testRegisterUser() { $name = 'Bob.Arctor'; $user = $this->registerUser($name, FALSE); $this->resetAll(); - $this->assertTrue(empty($user->getPassword())); + $this->assertEmpty($user->getPassword()); $this->assertTrue($user->isBlocked()); $this->assertMailString('body', 'Your application for an account is', 2); @@ -210,7 +210,7 @@ protected function registerUser($name, $include_password = TRUE, $include_email $response = $this->registerRequest($name, $include_password, $include_email); $this->assertResourceResponse(200, FALSE, $response); $user = user_load_by_name($name); - $this->assertFalse(empty($user), 'User was create as expected'); + $this->assertNotEmpty($user, 'User was create as expected'); return $user; } diff --git a/web/core/modules/user/tests/src/Functional/UserCancelTest.php b/web/core/modules/user/tests/src/Functional/UserCancelTest.php index 897113f406e4de407de9e0afdc3232fbae2d9251..6ce17ab974303bfc76165471d590b54a15dd0943 100644 --- a/web/core/modules/user/tests/src/Functional/UserCancelTest.php +++ b/web/core/modules/user/tests/src/Functional/UserCancelTest.php @@ -662,7 +662,7 @@ public function testUserDeleteWithContentAndNodeAccess() { $node = $this->drupalCreateNode(['type' => 'page', 'uid' => $account->id()]); $account->delete(); $load2 = \Drupal::entityTypeManager()->getStorage('node')->load($node->id()); - $this->assertTrue(empty($load2)); + $this->assertEmpty($load2); } } diff --git a/web/core/modules/user/tests/src/Unit/UserAuthTest.php b/web/core/modules/user/tests/src/Unit/UserAuthTest.php index 2ac6d0c05c1135d9c9688af988a9dd6f6a2b84a3..10526a40392753aa755a5acb587f2b89784f889c 100644 --- a/web/core/modules/user/tests/src/Unit/UserAuthTest.php +++ b/web/core/modules/user/tests/src/Unit/UserAuthTest.php @@ -3,8 +3,15 @@ namespace Drupal\Tests\user\Unit; use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\Core\Routing\RequestContext; +use Drupal\Core\Routing\TrustedRedirectResponse; use Drupal\Tests\UnitTestCase; +use Drupal\user\Authentication\Provider\Cookie; use Drupal\user\UserAuth; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Session\SessionInterface; +use Symfony\Component\HttpKernel\Event\ResponseEvent; /** * @coversDefaultClass \Drupal\user\UserAuth @@ -220,4 +227,57 @@ public function testAuthenticateWithCorrectPasswordAndNewPasswordHash() { $this->assertSame(1, $this->userAuth->authenticate($this->username, $this->password)); } + /** + * Tests the auth that ends in a redirect from subdomain to TLD. + */ + public function testAddCheckToUrlForTrustedRedirectResponse(): void { + $site_domain = 'site.com'; + $frontend_url = "https://$site_domain"; + $backend_url = "https://api.$site_domain"; + $request = Request::create($backend_url); + $response = new TrustedRedirectResponse($frontend_url); + + $request_context = $this->createMock(RequestContext::class); + $request_context + ->method('getCompleteBaseUrl') + ->willReturn($backend_url); + + $container = new ContainerBuilder(); + $container->set('router.request_context', $request_context); + \Drupal::setContainer($container); + + $session_mock = $this->createMock(SessionInterface::class); + $session_mock + ->expects($this->once()) + ->method('has') + ->with('check_logged_in') + ->willReturn(TRUE); + $session_mock + ->expects($this->once()) + ->method('remove') + ->with('check_logged_in'); + + $event_mock = $this->createMock(ResponseEvent::class); + $event_mock + ->expects($this->once()) + ->method('getResponse') + ->willReturn($response); + $event_mock + ->expects($this->exactly(3)) + ->method('getRequest') + ->willReturn($request); + + $request + ->setSession($session_mock); + + $this + ->getMockBuilder(Cookie::class) + ->disableOriginalConstructor() + ->onlyMethods([]) + ->getMock() + ->addCheckToUrl($event_mock); + + $this->assertSame("$frontend_url?check_logged_in=1", $response->getTargetUrl()); + } + } diff --git a/web/core/modules/views/src/Plugin/views/argument_default/ArgumentDefaultPluginBase.php b/web/core/modules/views/src/Plugin/views/argument_default/ArgumentDefaultPluginBase.php index a3336458d8daf7ef5bdc81c0979dcc1b16336fd4..4f91e6a160afbf654368952dc58024e84301bb48 100644 --- a/web/core/modules/views/src/Plugin/views/argument_default/ArgumentDefaultPluginBase.php +++ b/web/core/modules/views/src/Plugin/views/argument_default/ArgumentDefaultPluginBase.php @@ -67,12 +67,12 @@ protected function defineOptions() { public function buildOptionsForm(&$form, FormStateInterface $form_state) {} /** - * Provide the default form form for validating options. + * Provide the default form for validating options. */ public function validateOptionsForm(&$form, FormStateInterface $form_state) {} /** - * Provide the default form form for submitting options. + * Provide the default form for submitting options. */ public function submitOptionsForm(&$form, FormStateInterface $form_state, &$options = []) {} diff --git a/web/core/modules/views/src/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php b/web/core/modules/views/src/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php index 6e797b49b1beb0114e0390123c2c5eb86d742121..c89479f9dc699d7b5f99998ca95ae395adf1420e 100644 --- a/web/core/modules/views/src/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php +++ b/web/core/modules/views/src/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php @@ -14,9 +14,9 @@ * Views argument validator plugins validate arguments (contextual filters) on * views. They can ensure arguments are valid, and even do transformations on * the arguments. They can also provide replacement patterns for the view title. - * For example, the 'content' validator verifies verifies that the argument - * value corresponds to a node, loads that node, and provides the node title - * as a replacement pattern for the view title. + * For example, the 'content' validator verifies that the argument value + * corresponds to a node, loads that node, and provides the node title as a + * replacement pattern for the view title. * * Argument validator plugins extend * \Drupal\views\Plugin\views\argument_validator\ArgumentValidatorPluginBase. diff --git a/web/core/modules/views/src/Plugin/views/field/EntityField.php b/web/core/modules/views/src/Plugin/views/field/EntityField.php index 7d38ab2ae839d8cf359c8f79deec265c7a684266..d697d52031915160c967b53e4142e24c0a8ec034 100644 --- a/web/core/modules/views/src/Plugin/views/field/EntityField.php +++ b/web/core/modules/views/src/Plugin/views/field/EntityField.php @@ -860,7 +860,7 @@ public function getItems(ResultRow $values) { } if ($this->options['field_api_classes']) { - return [['rendered' => $this->renderer->render($build_list)]]; + return [['rendered' => $build_list]]; } // Render using the formatted data itself. diff --git a/web/core/modules/views/src/Plugin/views/pager/PagerPluginBase.php b/web/core/modules/views/src/Plugin/views/pager/PagerPluginBase.php index 5227a6ac430624db295a4079cd0825b278517fbe..d02f67034417598829cf41ee2f144092df29bac4 100644 --- a/web/core/modules/views/src/Plugin/views/pager/PagerPluginBase.php +++ b/web/core/modules/views/src/Plugin/views/pager/PagerPluginBase.php @@ -112,12 +112,12 @@ public function getPagerId() { } /** - * Provide the default form form for validating options. + * Provide the default form for validating options. */ public function validateOptionsForm(&$form, FormStateInterface $form_state) {} /** - * Provide the default form form for submitting options. + * Provide the default form for submitting options. */ public function submitOptionsForm(&$form, FormStateInterface $form_state) {} diff --git a/web/core/modules/views/src/Plugin/views/query/SqliteDateSql.php b/web/core/modules/views/src/Plugin/views/query/SqliteDateSql.php index d6006ac71f9753fa6981428eeb17ea81793cc87d..a98477482dc49384fa463a4bd5627e04db168704 100644 --- a/web/core/modules/views/src/Plugin/views/query/SqliteDateSql.php +++ b/web/core/modules/views/src/Plugin/views/query/SqliteDateSql.php @@ -49,7 +49,7 @@ class SqliteDateSql implements DateSqlInterface { 'j' => '%d', 'W' => '%W', 'H' => '%H', - // No format for 12 hour hour with leading zeros. + // No format for 12 hour with leading zeros. 'h' => '%H', 'i' => '%M', 's' => '%S', 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 faacdf8e51a29fc230801a3d216395312a3ae6fd..33c8af36ece106dea40a22090f14d2076308c18f 100644 --- a/web/core/modules/views/src/Plugin/views/style/StylePluginBase.php +++ b/web/core/modules/views/src/Plugin/views/style/StylePluginBase.php @@ -601,7 +601,8 @@ public function renderGrouping($records, $groupings = [], $group_rendered = NULL if (isset($this->view->field[$field])) { $group_content = $this->getField($index, $field); if ($this->view->field[$field]->options['label']) { - $group_content = $this->view->field[$field]->options['label'] . ': ' . $group_content; + $delimiter = $this->view->field[$field]->options['element_label_colon'] ? ': ' : ' '; + $group_content = $this->view->field[$field]->options['label'] . $delimiter . $group_content; } if ($rendered) { $grouping = (string) $group_content; diff --git a/web/core/modules/views/src/Tests/AssertViewsCacheTagsTrait.php b/web/core/modules/views/src/Tests/AssertViewsCacheTagsTrait.php index d443e3ba277065f9f328a19829569f0d46866970..e40fbb959c59351f0c3baad2569daee46e7588bb 100644 --- a/web/core/modules/views/src/Tests/AssertViewsCacheTagsTrait.php +++ b/web/core/modules/views/src/Tests/AssertViewsCacheTagsTrait.php @@ -138,7 +138,7 @@ protected function assertViewsCacheTagsFromStaticRenderArray(ViewExecutable $vie $render_cache_item = $render_cache->get($original); if ($views_caching_is_enabled) { - $this->assertTrue(!empty($render_cache_item), 'Render cache item found.'); + $this->assertNotEmpty($render_cache_item, 'Render cache item found.'); if ($render_cache_item) { $this->assertEqualsCanonicalizing($expected_render_array_cache_tags, $render_cache_item['#cache']['tags']); } 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 3baa6f3943f00101b2ba91e0d5627cf48a2e8f2d..1526897664f292d806102d03cfc75bd1899fca5b 100644 --- a/web/core/modules/views/tests/src/Functional/Handler/FieldWebTest.php +++ b/web/core/modules/views/tests/src/Functional/Handler/FieldWebTest.php @@ -473,7 +473,7 @@ public function testFieldClasses() { // Tests the element classes/element. - // Set some common element element types and see whether they appear with and without a custom class set. + // Set some common element types and see whether they appear with and without a custom class set. foreach (['h1', 'span', 'p', 'div'] as $element_type) { $id_field->options['element_type'] = $element_type; diff --git a/web/core/modules/views/tests/src/Functional/Handler/HandlerTest.php b/web/core/modules/views/tests/src/Functional/Handler/HandlerTest.php index 2ac51567d82e8d5b06bf55b0e86a22d9697ea1b0..dde6c344f9bac5c0a6856c09730ebcc3f3b93f50 100644 --- a/web/core/modules/views/tests/src/Functional/Handler/HandlerTest.php +++ b/web/core/modules/views/tests/src/Functional/Handler/HandlerTest.php @@ -304,7 +304,7 @@ public function testSetRelationship() { $field->options['relationship'] = 'valid_relationship'; $field->setRelationship(); - $this->assertFalse(!empty($field->relationship), 'Make sure that the relationship alias was not set without building a views query before.'); + $this->assertEmpty($field->relationship, 'Make sure that the relationship alias was not set without building a views query before.'); // Remove the invalid relationship. unset($view->relationship['broken_relationship']); diff --git a/web/core/modules/views/tests/src/Functional/Plugin/DisplayFeedTest.php b/web/core/modules/views/tests/src/Functional/Plugin/DisplayFeedTest.php index 8eea7fb9faa658b98eaac1fba920db65c4ac4991..21c3ad29be7a6b7b86fe20429db90ed098911c75 100644 --- a/web/core/modules/views/tests/src/Functional/Plugin/DisplayFeedTest.php +++ b/web/core/modules/views/tests/src/Functional/Plugin/DisplayFeedTest.php @@ -176,7 +176,7 @@ public function testDisabledFeed() { // Ensure there is no link rel present on the page. $this->drupalGet('/test-attached-disabled'); $result = $this->xpath('//link[@rel="alternate"]'); - $this->assertTrue(empty($result), 'Page display does not contain a feed header.'); + $this->assertEmpty($result, 'Page display does not contain a feed header.'); // Ensure the feed attachment returns 'Not found'. $this->drupalGet('/test-attached-disabled.xml'); 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 087d21a5b695ff0d7b1cf6520c5ad34bc578cd2e..5769c697d1fdcaddfe3cc9e349b84d3bc0d052d8 100644 --- a/web/core/modules/views/tests/src/Functional/Plugin/DisplayTest.php +++ b/web/core/modules/views/tests/src/Functional/Plugin/DisplayTest.php @@ -179,14 +179,14 @@ public function testReadMoreNoDisplay() { $view = Views::getView('test_display_more'); // Confirm that the view validates when there is a page display. $errors = $view->validate(); - $this->assertTrue(empty($errors), 'More link validation has no errors.'); + $this->assertEmpty($errors, 'More link validation has no errors.'); // Confirm that the view does not validate when the page display is disabled. $view->setDisplay('page_1'); $view->display_handler->setOption('enabled', FALSE); $view->setDisplay('default'); $errors = $view->validate(); - $this->assertTrue(!empty($errors), 'More link validation has some errors.'); + $this->assertNotEmpty($errors, 'More link validation has some errors.'); $this->assertEquals('Display "Default" uses a "more" link but there are no displays it can link to. You need to specify a custom URL.', $errors['default'][0], 'More link validation has the right error.'); // Confirm that the view does not validate when the page display does not exist. @@ -194,7 +194,7 @@ public function testReadMoreNoDisplay() { $view->setDisplay('default'); $view->display_handler->setOption('use_more', 1); $errors = $view->validate(); - $this->assertTrue(!empty($errors), 'More link validation has some errors.'); + $this->assertNotEmpty($errors, 'More link validation has some errors.'); $this->assertEquals('Display "Default" uses a "more" link but there are no displays it can link to. You need to specify a custom URL.', $errors['default'][0], 'More link validation has the right error.'); } @@ -352,7 +352,7 @@ public function testMissingRelationship() { $view->removeHandler('default', 'relationship', 'uid_1'); $errors = $view->validate(); // Check that no error message is shown. - $this->assertTrue(empty($errors['default']), 'No errors found when removing unused relationship.'); + $this->assertArrayNotHasKey('default', $errors, 'No errors found when removing unused relationship.'); // Unset cached relationships (see DisplayPluginBase::getHandlers()) unset($view->display_handler->handlers['relationship']); diff --git a/web/core/modules/views/tests/src/Functional/Plugin/FilterTest.php b/web/core/modules/views/tests/src/Functional/Plugin/FilterTest.php index c1a933d83d4dd201b423b64e08492be522e12b56..8283e14f5af7e4a66203f38dec52bb55c1ff2ae1 100644 --- a/web/core/modules/views/tests/src/Functional/Plugin/FilterTest.php +++ b/web/core/modules/views/tests/src/Functional/Plugin/FilterTest.php @@ -81,7 +81,7 @@ public function testFilterQuery() { $this->executeView($view); // Make sure the query have where data. - $this->assertTrue(!empty($view->query->where)); + $this->assertNotEmpty($view->query->where); // Check the data added. $where = $view->query->where; diff --git a/web/core/modules/views/tests/src/Functional/Wizard/BasicTest.php b/web/core/modules/views/tests/src/Functional/Wizard/BasicTest.php index 75812cecf54d7afad04faf5418624a1b26e68591..6486e6c4e07d1c6ff5ad451a5fdf20aff7b23234 100644 --- a/web/core/modules/views/tests/src/Functional/Wizard/BasicTest.php +++ b/web/core/modules/views/tests/src/Functional/Wizard/BasicTest.php @@ -3,7 +3,6 @@ namespace Drupal\Tests\views\Functional\Wizard; use Drupal\Component\Serialization\Json; -use Drupal\Component\Render\FormattableMarkup; use Drupal\Core\Url; use Drupal\views\Views; @@ -221,7 +220,7 @@ public function testWizardDefaultValues() { foreach ($displays as $display) { foreach (['query', 'exposed_form', 'pager', 'style', 'row'] as $type) { - $this->assertFalse(empty($display['display_options'][$type]['options']), new FormattableMarkup('Default options found for @plugin.', ['@plugin' => $type])); + $this->assertNotEmpty($display['display_options'][$type]['options'], "There should be default options available for '$type'."); } } } diff --git a/web/core/modules/views/tests/src/Functional/Wizard/PagerTest.php b/web/core/modules/views/tests/src/Functional/Wizard/PagerTest.php index 90945038bcaf5fccd7188f899c7e92471c42cf23..fa8355a7d060ec91577d0d8c0c17efc259aae54c 100644 --- a/web/core/modules/views/tests/src/Functional/Wizard/PagerTest.php +++ b/web/core/modules/views/tests/src/Functional/Wizard/PagerTest.php @@ -33,14 +33,14 @@ public function testPager() { // This technique for finding the existence of a pager // matches that used in Drupal\views_ui\Tests\PreviewTest.php. $elements = $this->xpath('//ul[contains(@class, :class)]/li', [':class' => 'pager__items']); - $this->assertTrue(!empty($elements), 'Full pager found.'); + $this->assertNotEmpty($elements, 'Full pager found.'); // Make a View that does not have a pager. $path_with_no_pager = 'test-view-without-pager'; $this->createViewAtPath($path_with_no_pager, FALSE); $this->drupalGet($path_with_no_pager); $elements = $this->xpath('//ul[contains(@class, :class)]/li', [':class' => 'pager__items']); - $this->assertTrue(empty($elements), 'Full pager not found.'); + $this->assertEmpty($elements, 'Full pager not found.'); } /** diff --git a/web/core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FieldTest.php b/web/core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FieldTest.php index 9d1d3befe6d8f41e8602068901b6cb43f588d408..d5744dbdc2a420f05a2c98804c9e61f4ec97c327 100644 --- a/web/core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FieldTest.php +++ b/web/core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FieldTest.php @@ -9,7 +9,7 @@ use Drupal\views\Tests\ViewTestData; /** - * Tests the field field handler UI. + * Tests the field handler UI. * * @group views */ @@ -85,7 +85,7 @@ public function testFormatterChanging() { $web_assert->assertWaitOnAjaxRequest(); $page->fillField('options[settings][trim_length]', '700'); $apply_button = $page->find('css', '.views-ui-dialog button.button--primary'); - $this->assertTrue(!empty($apply_button)); + $this->assertNotEmpty($apply_button); $apply_button->press(); $web_assert->assertWaitOnAjaxRequest(); diff --git a/web/core/modules/views/tests/src/Kernel/FieldApiDataTest.php b/web/core/modules/views/tests/src/Kernel/FieldApiDataTest.php index 1df711aaeb29bd9d2cc6802516b961d9b2fa693c..c3c178707d4b4f2e3e4fe0af4471aedb0ebbfc2b 100644 --- a/web/core/modules/views/tests/src/Kernel/FieldApiDataTest.php +++ b/web/core/modules/views/tests/src/Kernel/FieldApiDataTest.php @@ -139,7 +139,7 @@ public function testViewsData() { // Test click sortable for string field. $this->assertTrue($data[$current_table][$field_storage_string->getName()]['field']['click sortable']); // Click sort should only be on the primary field. - $this->assertTrue(empty($data[$revision_table][$field_storage_string->getName()]['field']['click sortable'])); + $this->assertArrayNotHasKey($field_storage_string->getName(), $data[$revision_table]); // Test click sortable for long text field. $data_long = $this->getViewsData('field_string_long'); $current_table_long = $table_mapping->getDedicatedDataTableName($field_storage_string_long); diff --git a/web/core/modules/views/tests/src/Kernel/Handler/AreaEntityTest.php b/web/core/modules/views/tests/src/Kernel/Handler/AreaEntityTest.php index 6f488ff6fed8cee30fbd9c34d4aa31ad92fbae63..f81def4de0d44a1375a577f77501f71dc2108f50 100644 --- a/web/core/modules/views/tests/src/Kernel/Handler/AreaEntityTest.php +++ b/web/core/modules/views/tests/src/Kernel/Handler/AreaEntityTest.php @@ -71,7 +71,7 @@ public function testEntityAreaData() { // Test that all expected entity types have data. foreach (array_keys($expected_entities) as $entity) { - $this->assertTrue(!empty($data['entity_' . $entity]), new FormattableMarkup('Views entity area data found for @entity', ['@entity' => $entity])); + $this->assertNotEmpty($data['entity_' . $entity], "Views entity '$entity' should have a data area."); // Test that entity_type is set correctly in the area data. $this->assertEquals($data['entity_' . $entity]['area']['entity_type'], $entity, new FormattableMarkup('Correct entity_type set for @entity', ['@entity' => $entity])); } @@ -82,7 +82,7 @@ public function testEntityAreaData() { // Test that no configuration entity types have data. foreach (array_keys($expected_entities) as $entity) { - $this->assertTrue(empty($data['entity_' . $entity]), new FormattableMarkup('Views config entity area data not found for @entity', ['@entity' => $entity])); + $this->assertArrayNotHasKey('entity_' . $entity, $data, "Views config entity '$entity' should not have a data area."); } } diff --git a/web/core/modules/views/tests/src/Kernel/Handler/FieldFieldTest.php b/web/core/modules/views/tests/src/Kernel/Handler/FieldFieldTest.php index 15748947e81527dd283c5ee7290eb90ad0a0dfa3..27428107d75906d52561f21ecb7fd41714a3eac1 100644 --- a/web/core/modules/views/tests/src/Kernel/Handler/FieldFieldTest.php +++ b/web/core/modules/views/tests/src/Kernel/Handler/FieldFieldTest.php @@ -339,6 +339,27 @@ public function testFieldAliasRender() { } } + /** + * Tests the result of a view field with field_api_classes enabled. + */ + public function testFieldApiClassesRender() { + /** @var \Drupal\Core\Render\RendererInterface $renderer */ + $renderer = $this->container->get('renderer'); + $executable = Views::getView('test_field_field_test'); + $executable->initHandlers(); + + // Enable field_api_classes for the id field. + $id_field = $executable->field['id']; + $id_field->options['field_api_classes'] = TRUE; + + // Test that the ID field renders with multiple divs from field template. + $output = $executable->preview(); + $output = $renderer->renderRoot($output); + $this->setRawContent($output); + $field_values = $this->xpath('//div[contains(@class, "views-field-id")]/span[contains(@class, :class)]/div', [':class' => 'field-content']); + $this->assertNotEmpty($field_values); + } + /** * Tests the result of a view with complex field configuration. * diff --git a/web/core/modules/views/tests/src/Kernel/Plugin/CacheTest.php b/web/core/modules/views/tests/src/Kernel/Plugin/CacheTest.php index b3630ce9de50df4ab900d8781171d3ca11763398..7bab5e5c506996760ac24e9cbff318a2449c2897 100644 --- a/web/core/modules/views/tests/src/Kernel/Plugin/CacheTest.php +++ b/web/core/modules/views/tests/src/Kernel/Plugin/CacheTest.php @@ -296,7 +296,7 @@ public function testHeaderStorage() { // Note: views_test_data_views_pre_render() adds some cache tags. $this->assertEquals(['config:views.view.test_cache_header_storage', 'views_test_data:1'], $output['#cache']['tags']); $this->assertEquals(['non-existing-placeholder-just-for-testing-purposes' => ['#lazy_builder' => ['Drupal\views_test_data\Controller\ViewsTestDataController::placeholderLazyBuilder', ['bar']]]], $output['#attached']['placeholders']); - $this->assertFalse(!empty($view->build_info['pre_render_called']), 'Make sure hook_views_pre_render is not called for the cached view.'); + $this->assertArrayNotHasKey('pre_render_called', $view->build_info, 'Make sure hook_views_pre_render is not called for the cached view.'); } /** diff --git a/web/core/modules/views/tests/src/Kernel/Plugin/DisplayPageTest.php b/web/core/modules/views/tests/src/Kernel/Plugin/DisplayPageTest.php index ba1a7a4da22bf1a15c2270e0320378f9b32f872d..841c204418728a01c80bf771b453e91529fc4fac 100644 --- a/web/core/modules/views/tests/src/Kernel/Plugin/DisplayPageTest.php +++ b/web/core/modules/views/tests/src/Kernel/Plugin/DisplayPageTest.php @@ -196,7 +196,7 @@ public function testReadMore() { $output = $renderer->renderRoot($output); $this->setRawContent($output); $result = $this->xpath('//div[@class=:class]/a', [':class' => 'more-link']); - $this->assertTrue(empty($result), 'The more link is not shown.'); + $this->assertEmpty($result, 'The more link is not shown.'); $view = Views::getView('test_display_more'); $view->setDisplay(); @@ -214,7 +214,7 @@ public function testReadMore() { $output = $renderer->renderRoot($output); $this->setRawContent($output); $result = $this->xpath('//div[@class=:class]/a', [':class' => 'more-link']); - $this->assertTrue(empty($result), 'The more link is not shown when view has more records.'); + $this->assertEmpty($result, 'The more link is not shown when view has more records.'); // Test the default value of use_more_always. $view = View::create()->getExecutable(); diff --git a/web/core/modules/views/tests/src/Kernel/Plugin/StyleTest.php b/web/core/modules/views/tests/src/Kernel/Plugin/StyleTest.php index cfc2e38db25da21dcdcdc508372ee4a065bc463c..364fdc75289b7b2f56ccef13f5e79288c8ded73a 100644 --- a/web/core/modules/views/tests/src/Kernel/Plugin/StyleTest.php +++ b/web/core/modules/views/tests/src/Kernel/Plugin/StyleTest.php @@ -227,15 +227,49 @@ protected function doTestGrouping($stripped = FALSE) { } $sets_new_rendered = $view->style_plugin->renderGrouping($view->result, $view->style_plugin->options['grouping'], TRUE); - + $no_label_expected = $expected; // Remove labels from expected results. - foreach ($expected as $job => $data) { - unset($expected[$job]); + foreach ($no_label_expected as $job => $data) { + unset($no_label_expected[$job]); $job = str_replace('Job: ', '', $job); $data['group'] = $job; - $expected[$job] = $data; + $no_label_expected[$job] = $data; } - $this->assertEquals($expected, $sets_new_rendered); + $this->assertEquals($no_label_expected, $sets_new_rendered); + + // Test that grouping works on fields having no colon after the label. + $fields['job']['label'] = 'Job'; + $fields['job']['element_label_colon'] = FALSE; + $view->destroy(); + $view->setDisplay(); + $view->initStyle(); + $view->displayHandlers->get('default')->overrideOption('fields', $fields); + $view->style_plugin->options['grouping'] = [ + ['field' => 'job'], + ['field' => 'age'], + ]; + + $this->executeView($view); + + if ($stripped) { + $view->result[0]->views_test_data_job .= $rand1; + $view->result[1]->views_test_data_job .= $rand2; + $view->result[2]->views_test_data_job .= $rand3; + $view->style_plugin->options['grouping'][0] = ['field' => 'job', 'rendered' => TRUE, 'rendered_strip' => TRUE]; + $view->style_plugin->options['grouping'][1] = ['field' => 'age', 'rendered' => TRUE, 'rendered_strip' => TRUE]; + } + + $sets_new_rendered = $view->style_plugin->renderGrouping($view->result, $view->style_plugin->options['grouping'], TRUE); + + // Remove colons from expected results. + $no_colon_expected = $expected; + foreach ($no_colon_expected as $job => $data) { + unset($no_colon_expected[$job]); + $job = str_replace('Job: ', 'Job ', $job); + $data['group'] = $job; + $no_colon_expected[$job] = $data; + } + $this->assertEquals($no_colon_expected, $sets_new_rendered); } /** diff --git a/web/core/modules/views/tests/src/Kernel/PluginInstanceTest.php b/web/core/modules/views/tests/src/Kernel/PluginInstanceTest.php index 315fae720372ba56fa4c1cb3e02ec7f93948224b..d5d1dd6004d6459c128f0e0cd6e967044150db4d 100644 --- a/web/core/modules/views/tests/src/Kernel/PluginInstanceTest.php +++ b/web/core/modules/views/tests/src/Kernel/PluginInstanceTest.php @@ -75,7 +75,7 @@ public function testPluginData() { // Tests that the plugin list has not missed any types. $diff = array_diff(array_keys($this->definitions), $this->pluginTypes); - $this->assertTrue(empty($diff), 'All plugins were found and matched.'); + $this->assertEmpty($diff, 'All plugins were found and matched.'); } /** diff --git a/web/core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php b/web/core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php index de5e12ef28d3e85a55faab29acad1e5451502dbe..651310dd9e4431e2a4b3cff783128e620dda498f 100644 --- a/web/core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php +++ b/web/core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php @@ -159,7 +159,7 @@ public function testGetDerivativeDefinitionsWithLocalTask() { $this->assertEquals(12, $definitions['view.example_view.page_1']['weight']); $this->assertEquals('Example title', $definitions['view.example_view.page_1']['title']); $this->assertEquals($this->baseDefinition['class'], $definitions['view.example_view.page_1']['class']); - $this->assertTrue(empty($definitions['view.example_view.page_1']['base_route'])); + $this->assertArrayNotHasKey('base_route', $definitions['view.example_view.page_1']); } /** diff --git a/web/core/modules/views/tests/src/Unit/PluginTypeListTest.php b/web/core/modules/views/tests/src/Unit/PluginTypeListTest.php index 29da6b3aff4d39d0bc049c0a09e6eca7d814c416..ee84e531271738d1e3234f7fcf7b93e6752fb27a 100644 --- a/web/core/modules/views/tests/src/Unit/PluginTypeListTest.php +++ b/web/core/modules/views/tests/src/Unit/PluginTypeListTest.php @@ -39,7 +39,7 @@ public function testPluginList() { ]; $diff = array_diff($plugin_list, ViewExecutable::getPluginTypes()); - $this->assertTrue(empty($diff), 'The plugin list is correct'); + $this->assertEmpty($diff); } } diff --git a/web/core/modules/views/views.api.php b/web/core/modules/views/views.api.php index 8e8d89d08e4d6f81f2d953b4b9f562ea68d488ba..50dd4946a6f8b41a609740311aa83e867e632148 100644 --- a/web/core/modules/views/views.api.php +++ b/web/core/modules/views/views.api.php @@ -820,36 +820,37 @@ function hook_views_pre_render(ViewExecutable $view) { } /** - * Post-process any rendered data. + * Post-process any render data. * - * This can be valuable to be able to cache a view and still have some level of - * dynamic output. In an ideal world, the actual output will include HTML - * comment-based tokens, and then the post process can replace those tokens. - * This hook can be used by themes. + * The module or theme may add, modify or remove elements in $output after + * rendering. * - * Example usage. If it is known that the view is a node view and that the - * primary field will be a nid, you can do something like this: + * If a module wishes to act on the rendered HTML of the view rather than the + * structured content array, it may use this hook to add a #post_render + * callback: * @code - * <!--post-FIELD-NID--> + * // The object must implement \Drupal\Core\Security\TrustedCallbackInterface. + * $output['#post_render'][] = '\Drupal\my_module\View::postRender'; * @endcode - * And then in the post-render, create an array with the text that should - * go there: - * @code - * strtr($output, array('<!--post-FIELD-1-->' => 'output for FIELD of nid 1'); - * @endcode - * All of the cached result data will be available in $view->result, as well, - * so all ids used in the query should be discoverable. + * + * See \Drupal\Core\Render\RendererInterface::render() for #post_render + * documentation. + * + * Alternatively, it could also implement hook_preprocess_HOOK() for + * the particular view template, if there is one. * * @param \Drupal\views\ViewExecutable $view - * The view object about to be processed. - * @param string $output - * A flat string with the rendered output of the view. + * The view object being processed. + * @param array $output + * A structured content array representing the view output. The given array + * depends on the style plugin and can be either a render array or an array of + * render arrays. * @param \Drupal\views\Plugin\views\cache\CachePluginBase $cache * The cache settings. * * @see \Drupal\views\ViewExecutable */ -function hook_views_post_render(ViewExecutable $view, &$output, CachePluginBase $cache) { +function hook_views_post_render(ViewExecutable $view, array &$output, CachePluginBase $cache) { // When using full pager, disable any time-based caching if there are fewer // than 10 results. if ($view->pager instanceof Drupal\views\Plugin\views\pager\Full && $cache instanceof Drupal\views\Plugin\views\cache\Time && count($view->result) < 10) { diff --git a/web/core/modules/views_ui/js/views-admin.es6.js b/web/core/modules/views_ui/js/views-admin.es6.js index 3af166d7c7a2b4df1f44fc789de62467d5630e6b..f91f29e8d9ba27152279fa832e4b4dc88fbfa2df 100644 --- a/web/core/modules/views_ui/js/views-admin.es6.js +++ b/web/core/modules/views_ui/js/views-admin.es6.js @@ -266,7 +266,7 @@ $form = $context.find('form[id^="views-ui-add-handler-form"]'); } if (once('views-ui-add-handler-form', $form).length) { - // If we we have an unprocessed views-ui-add-handler-form, let's + // If we have an unprocessed views-ui-add-handler-form, let's // instantiate. new Drupal.viewsUi.AddItemForm($form); } 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 6be6c457802e4072db2b6e79a23aed9f1ee6dc5e..722a2a332c668b2ad6bd937408af9d94d0f31220 100644 --- a/web/core/modules/views_ui/tests/src/Functional/ViewEditTest.php +++ b/web/core/modules/views_ui/tests/src/Functional/ViewEditTest.php @@ -67,7 +67,7 @@ public function testOtherOptions() { $this->submitForm([], 'Save'); $view = \Drupal::entityTypeManager()->getStorage('view')->load('test_view'); $displays = $view->get('display'); - $this->assertTrue(!empty($displays['test_1']), 'Display data found for new display ID key.'); + $this->assertNotEmpty($displays['test_1'], 'Display data found for new display ID key.'); $this->assertSame('test_1', $displays['test_1']['id'], 'New display ID matches the display ID key.'); $this->assertArrayNotHasKey('attachment_1', $displays); diff --git a/web/core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php b/web/core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php index 9ca8b80a65e2094a482a8deb4fbc6fe77bf6e838..7b8f01b0cd7e2d0ae9056def3fd7709c4bcd9285 100644 --- a/web/core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php +++ b/web/core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php @@ -134,7 +134,7 @@ public function testPreviewWithPagersUI() { // Test that the pager is present and rendered. $elements = $this->xpath('//ul[contains(@class, :class)]/li', [':class' => 'pager__items']); - $this->assertTrue(!empty($elements), 'Full pager found.'); + $this->assertNotEmpty($elements, 'Full pager found.'); // Verify elements and links to pages. // We expect to find 5 elements: current page == 1, links to pages 2 and @@ -160,7 +160,7 @@ public function testPreviewWithPagersUI() { // Test that the pager is present and rendered. $elements = $this->xpath('//ul[contains(@class, :class)]/li', [':class' => 'pager__items']); - $this->assertTrue(!empty($elements), 'Full pager found.'); + $this->assertNotEmpty($elements, 'Full pager found.'); // Verify elements and links to pages. // We expect to find 7 elements: links to '<< first' and '< previous' @@ -192,7 +192,7 @@ public function testPreviewWithPagersUI() { // Test that the pager is present and rendered. $elements = $this->xpath('//ul[contains(@class, :class)]/li', [':class' => 'pager__items']); - $this->assertTrue(!empty($elements), 'Mini pager found.'); + $this->assertNotEmpty($elements, 'Mini pager found.'); // Verify elements and links to pages. // We expect to find current pages element with no link, next page element @@ -208,7 +208,7 @@ public function testPreviewWithPagersUI() { // Test that the pager is present and rendered. $elements = $this->xpath('//ul[contains(@class, :class)]/li', [':class' => 'pager__items']); - $this->assertTrue(!empty($elements), 'Mini pager found.'); + $this->assertNotEmpty($elements, 'Mini pager found.'); // Verify elements and links to pages. // We expect to find 3 elements: previous page with a link, current diff --git a/web/core/modules/workspaces/workspaces.install b/web/core/modules/workspaces/workspaces.install index 31bc8e88959c164324efc4cc9d4953a84d68da24..2c37233f92f82c8b508005a8d659f2694900e095 100644 --- a/web/core/modules/workspaces/workspaces.install +++ b/web/core/modules/workspaces/workspaces.install @@ -50,8 +50,8 @@ function workspaces_module_preinstall($module) { * Implements hook_install(). */ function workspaces_install() { - // Set the owner of these default workspaces to be first user which which has - // the 'administrator' role. This way we avoid hard coding user ID 1 for sites + // Set the owner of these default workspaces to be first user which has the + // 'administrator' role. This way we avoid hard coding user ID 1 for sites // that prefer to not give it any special meaning. $admin_roles = \Drupal::entityTypeManager()->getStorage('user_role')->getQuery() ->condition('is_admin', TRUE) diff --git a/web/core/tests/Drupal/FunctionalJavascriptTests/Ajax/DialogTest.php b/web/core/tests/Drupal/FunctionalJavascriptTests/Ajax/DialogTest.php index 0036e88a8f0dbe3ad09de8dd5ca599d30e8dd49f..de6cd41365a46c4535251b84dfd6acec6d3cc4e2 100644 --- a/web/core/tests/Drupal/FunctionalJavascriptTests/Ajax/DialogTest.php +++ b/web/core/tests/Drupal/FunctionalJavascriptTests/Ajax/DialogTest.php @@ -173,7 +173,7 @@ public function testDialog() { // Check we get a chunk of the code, we can't test the whole form as form // build id and token with be different. $contact_form = $this->xpath("//form[@id='contact-form-add-form']"); - $this->assertTrue(!empty($contact_form), 'Non-JS entity form page present.'); + $this->assertNotEmpty($contact_form, 'Non-JS entity form page present.'); // Reset: Return to the dialog links page. $this->drupalGet('ajax-test/dialog'); diff --git a/web/core/tests/Drupal/FunctionalTests/Image/ToolkitTestBase.php b/web/core/tests/Drupal/FunctionalTests/Image/ToolkitTestBase.php index 2d86844f048325b55f240ade41c6695ec207e96b..b26bf668f9a48c8409a58bd730df227b5e4ccdec 100644 --- a/web/core/tests/Drupal/FunctionalTests/Image/ToolkitTestBase.php +++ b/web/core/tests/Drupal/FunctionalTests/Image/ToolkitTestBase.php @@ -83,7 +83,7 @@ protected function getImage() { /** * Assert that all of the specified image toolkit operations were called - * exactly once once, other values result in failure. + * exactly once, other values result in failure. * * @param $expected * Array with string containing with the operation name, e.g. 'load', diff --git a/web/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoSystemSiteTest.php b/web/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoSystemSiteTest.php index 96499dc3364ecc1bd2fadab542cade0892339413..4796bf23f32b21640d554a8173ed64fadf3e115d 100644 --- a/web/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoSystemSiteTest.php +++ b/web/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoSystemSiteTest.php @@ -22,7 +22,7 @@ protected function prepareEnvironment() { * {@inheritdoc} */ public function setUpSite() { - // There are are errors. Therefore, there is nothing to do here. + // There are errors. Therefore, there is nothing to do here. } /** diff --git a/web/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigTestBase.php b/web/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigTestBase.php index fdd63a95b3a3b4b14fcdcc2a692a8a87a10cc1c3..8a6a9308fcaad1fe3ede391d071a966b9f2b5f61 100644 --- a/web/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigTestBase.php +++ b/web/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigTestBase.php @@ -4,6 +4,7 @@ use Drupal\Component\Serialization\Yaml; use Drupal\Core\Archiver\ArchiveTar; +use Drupal\Core\Database\Database; use Drupal\Core\Installer\Form\SelectProfileForm; /** @@ -69,6 +70,18 @@ protected function prepareEnvironment() { } $archiver->extractList($files, $config_sync_directory); } + + // Add the module that is providing the database driver to the list of + // modules that can not be uninstalled in the core.extension configuration. + if (file_exists($config_sync_directory . '/core.extension.yml')) { + $core_extension = Yaml::decode(file_get_contents($config_sync_directory . '/core.extension.yml')); + $module = Database::getConnection()->getProvider(); + if ($module !== 'core') { + $core_extension['module'][$module] = 0; + $core_extension['module'] = module_config_sort($core_extension['module']); + file_put_contents($config_sync_directory . '/core.extension.yml', Yaml::encode($core_extension)); + } + } } /** diff --git a/web/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationQueryTest.php b/web/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationQueryTest.php index be24236edeebaf995a56f281bd0e25f1a8298704..fe9da09502595ee5400d9b3fa09c2d2df5ab76a1 100644 --- a/web/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationQueryTest.php +++ b/web/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationQueryTest.php @@ -49,8 +49,8 @@ protected function visitInstaller() { * {@inheritdoc} */ protected function setUpLanguage() { - // The language was was preset by passing a query parameter in the URL, so - // no explicit language selection is necessary. + // The language was preset by passing a query parameter in the URL, so no + // explicit language selection is necessary. } /** diff --git a/web/core/tests/Drupal/KernelTests/Core/Asset/ResolvedLibraryDefinitionsFilesMatchTest.php b/web/core/tests/Drupal/KernelTests/Core/Asset/ResolvedLibraryDefinitionsFilesMatchTest.php index 32040acaccbca7ad55b3f9b6dd89fc5f112b013a..1626e5b219dfec22a63692c8cb209479adf25ba0 100644 --- a/web/core/tests/Drupal/KernelTests/Core/Asset/ResolvedLibraryDefinitionsFilesMatchTest.php +++ b/web/core/tests/Drupal/KernelTests/Core/Asset/ResolvedLibraryDefinitionsFilesMatchTest.php @@ -125,6 +125,10 @@ protected function setUp(): void { $this->allModules[] = 'system'; $this->allModules[] = 'user'; $this->allModules[] = 'path_alias'; + $database_module = \Drupal::database()->getProvider(); + if ($database_module !== 'core') { + $this->allModules[] = $database_module; + } sort($this->allModules); $this->container->get('module_installer')->install($this->allModules); diff --git a/web/core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php b/web/core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php index 147c898567585a3c7efc71742e20846aa13c9407..8380cf43339bfccf9a0ec31a79813416407c677e 100644 --- a/web/core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php +++ b/web/core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php @@ -375,7 +375,7 @@ public function testGetMultiple() { $cids = ['key:key' => $long_cid]; $return = $backend->getMultiple($cids); $this->assertEquals(300, $return[$long_cid]->data); - $this->assertTrue(empty($cids)); + $this->assertEmpty($cids); } /** diff --git a/web/core/tests/Drupal/KernelTests/Core/Common/DrupalFlushAllCachesTest.php b/web/core/tests/Drupal/KernelTests/Core/Common/DrupalFlushAllCachesTest.php index 9cb1dc2defc7f768212592830f23d692d958147b..6d699cb26ed0e389aec9eb11ddd5c465ff51e4eb 100644 --- a/web/core/tests/Drupal/KernelTests/Core/Common/DrupalFlushAllCachesTest.php +++ b/web/core/tests/Drupal/KernelTests/Core/Common/DrupalFlushAllCachesTest.php @@ -34,14 +34,29 @@ public function testDrupalFlushAllCachesModuleList() { $core_extension->set('module', module_config_sort($module))->save(); $this->containerBuilds = 0; drupal_flush_all_caches(); - $this->assertSame(['system_test', 'system'], array_keys($this->container->getParameter('container.modules'))); + $module_list = ['system_test', 'system']; + $database_module = \Drupal::database()->getProvider(); + if ($database_module !== 'core') { + $module_list[] = $database_module; + } + sort($module_list); + $container_modules = array_keys($this->container->getParameter('container.modules')); + sort($container_modules); + $this->assertSame($module_list, $container_modules); $this->assertSame(1, $this->containerBuilds); $this->assertTrue(function_exists('system_test_help')); $core_extension->clear('module.system_test')->save(); $this->containerBuilds = 0; drupal_flush_all_caches(); - $this->assertSame(['system'], array_keys($this->container->getParameter('container.modules'))); + $module_list = ['system']; + if ($database_module !== 'core') { + $module_list[] = $database_module; + } + sort($module_list); + $container_modules = array_keys($this->container->getParameter('container.modules')); + sort($container_modules); + $this->assertSame($module_list, $container_modules); $this->assertSame(1, $this->containerBuilds); } diff --git a/web/core/tests/Drupal/KernelTests/Core/Config/ConfigCRUDTest.php b/web/core/tests/Drupal/KernelTests/Core/Config/ConfigCRUDTest.php index 9994e9db6fde12497c5232b5c8adaec69464b7b1..6b0ba0ae16150c9063ec9cd7153ccbc4f6f894fd 100644 --- a/web/core/tests/Drupal/KernelTests/Core/Config/ConfigCRUDTest.php +++ b/web/core/tests/Drupal/KernelTests/Core/Config/ConfigCRUDTest.php @@ -3,7 +3,6 @@ namespace Drupal\KernelTests\Core\Config; use Drupal\Component\Utility\Crypt; -use Drupal\Component\Render\FormattableMarkup; use Drupal\Core\Config\Config; use Drupal\Core\Config\ConfigNameException; use Drupal\Core\Config\ConfigValueException; @@ -222,9 +221,7 @@ public function testNameValidation() { unset($test_characters[$i]); } } - $this->assertTrue(empty($test_characters), new FormattableMarkup('Expected ConfigNameException was thrown for all invalid name characters: @characters', [ - '@characters' => implode(' ', $characters), - ])); + $this->assertEmpty($test_characters, sprintf('Expected ConfigNameException was thrown for all invalid name characters: %s', implode(' ', $characters))); // Verify that a valid config object name can be saved. $name = 'namespace.object'; diff --git a/web/core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php b/web/core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php index 22e610afec236f5dadcb06f41d21122b9a52a131..e53b30472ec1ec40f560fd764725ffb7f8892f52 100644 --- a/web/core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php +++ b/web/core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php @@ -67,7 +67,7 @@ public function testDependencyManagement() { // the dependencies array. $raw_config = $this->config('config_test.dynamic.entity1'); $root_module_dependencies = $raw_config->get('dependencies.module'); - $this->assertTrue(empty($root_module_dependencies), 'Node module is not written to the root dependencies array as it is enforced.'); + $this->assertEmpty($root_module_dependencies, 'Node module is not written to the root dependencies array as it is enforced.'); // Create additional entities to test dependencies on config entities. $entity2 = $storage->create(['id' => 'entity2', 'dependencies' => ['enforced' => ['config' => [$entity1->getConfigDependencyName()]]]]); @@ -516,8 +516,8 @@ public function testConfigEntityDelete() { // \Drupal\Core\Config\ConfigManager::getConfigEntitiesToChangeOnDependencyRemoval(). $config_entities = $config_manager->getConfigEntitiesToChangeOnDependencyRemoval('config', [$entity1->getConfigDependencyName()]); $this->assertEquals($entity2->uuid(), reset($config_entities['delete'])->uuid(), 'Entity 2 will be deleted.'); - $this->assertTrue(empty($config_entities['update']), 'No dependent configuration entities will be updated.'); - $this->assertTrue(empty($config_entities['unchanged']), 'No dependent configuration entities will be unchanged.'); + $this->assertEmpty($config_entities['update'], 'No dependent configuration entities will be updated.'); + $this->assertEmpty($config_entities['unchanged'], 'No dependent configuration entities will be unchanged.'); // Test that doing a delete of entity1 deletes entity2 since it is dependent // on entity1. @@ -568,7 +568,7 @@ public function testConfigEntityDelete() { // Do a dry run using // \Drupal\Core\Config\ConfigManager::getConfigEntitiesToChangeOnDependencyRemoval(). $config_entities = $config_manager->getConfigEntitiesToChangeOnDependencyRemoval('config', [$entity1->getConfigDependencyName()]); - $this->assertTrue(empty($config_entities['delete']), 'No dependent configuration entities will be deleted.'); + $this->assertEmpty($config_entities['delete'], 'No dependent configuration entities will be deleted.'); $this->assertEquals($entity2->uuid(), reset($config_entities['update'])->uuid(), 'Entity 2 will be updated.'); $this->assertEquals($entity3->uuid(), reset($config_entities['unchanged'])->uuid(), 'Entity 3 is not changed.'); @@ -634,8 +634,8 @@ public function testContentEntityDelete() { $config_entities = $config_manager->getConfigEntitiesToChangeOnDependencyRemoval('content', [$content_entity->getConfigDependencyName()]); $this->assertEquals($entity1->uuid(), $config_entities['delete'][1]->uuid(), 'Entity 1 will be deleted.'); $this->assertEquals($entity2->uuid(), $config_entities['delete'][0]->uuid(), 'Entity 2 will be deleted.'); - $this->assertTrue(empty($config_entities['update']), 'No dependencies of the content entity will be updated.'); - $this->assertTrue(empty($config_entities['unchanged']), 'No dependencies of the content entity will be unchanged.'); + $this->assertEmpty($config_entities['update'], 'No dependencies of the content entity will be updated.'); + $this->assertEmpty($config_entities['unchanged'], 'No dependencies of the content entity will be unchanged.'); } /** diff --git a/web/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php b/web/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php index a07a3fd7cf63105bc2b009e2ea255440157af41a..602ca3624e3f1ff7a48914614e604cbaaaf5fad7 100644 --- a/web/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php +++ b/web/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php @@ -319,7 +319,7 @@ public function testSchemaData() { $this->assertInstanceOf(StringInterface::class, $property); $this->assertEquals('/user/login', $property->getValue(), 'Got the right value for page.front data.'); $definition = $property->getDataDefinition(); - $this->assertTrue(empty($definition['translatable']), 'Got the right translatability setting for page.front data.'); + $this->assertEmpty($definition['translatable'], 'Got the right translatability setting for page.front data.'); // Check nested array of properties. $list = $meta->get('page')->getElements(); diff --git a/web/core/tests/Drupal/KernelTests/Core/Database/SchemaTest.php b/web/core/tests/Drupal/KernelTests/Core/Database/SchemaTest.php index bf73ba4609c8da877bd9f43b2a05dfdbea419ba5..27e3bf0c39d391d2dec1e21ad4239aa2c218c9b3 100644 --- a/web/core/tests/Drupal/KernelTests/Core/Database/SchemaTest.php +++ b/web/core/tests/Drupal/KernelTests/Core/Database/SchemaTest.php @@ -105,8 +105,8 @@ public function testSchema() { $string_ascii_check = ($column->Collation == 'ascii_general_ci'); } } - $this->assertTrue(!empty($string_check), 'string field has the right collation.'); - $this->assertTrue(!empty($string_ascii_check), 'ASCII string field has the right collation.'); + $this->assertNotEmpty($string_check, 'string field has the right collation.'); + $this->assertNotEmpty($string_ascii_check, 'ASCII string field has the right collation.'); } // An insert without a value for the column 'test_table' should fail. diff --git a/web/core/tests/Drupal/KernelTests/Core/Database/SelectSubqueryTest.php b/web/core/tests/Drupal/KernelTests/Core/Database/SelectSubqueryTest.php index 496887da35601e3c467d1eb2435d527708957a72..6e14f6d4aa63725063fde3b534fad40b926ae0f6 100644 --- a/web/core/tests/Drupal/KernelTests/Core/Database/SelectSubqueryTest.php +++ b/web/core/tests/Drupal/KernelTests/Core/Database/SelectSubqueryTest.php @@ -232,7 +232,7 @@ public function testExistsSubquerySelect() { // Subquery to {test_people}. $subquery = $this->connection->select('test_people', 'tp') ->fields('tp', ['name']) - ->where('[tp].[name] = [t].[name]'); + ->where('[tp].[age] = [t].[age]'); $query->exists($subquery); $result = $query->execute(); @@ -263,7 +263,7 @@ public function testNotExistsSubquerySelect() { // Subquery to {test_people}. $subquery = $this->connection->select('test_people', 'tp') ->fields('tp', ['name']) - ->where('[tp].[name] = [t].[name]'); + ->where('[tp].[age] = [t].[age]'); $query->notExists($subquery); // Ensure that we got the right number of records. diff --git a/web/core/tests/Drupal/KernelTests/Core/Entity/EntityApiTest.php b/web/core/tests/Drupal/KernelTests/Core/Entity/EntityApiTest.php index ccc1f537affe801aa95b294bf63934f4d3bac35b..e1f3497cba5debf1dd861ee0e848c618e97c4de2 100644 --- a/web/core/tests/Drupal/KernelTests/Core/Entity/EntityApiTest.php +++ b/web/core/tests/Drupal/KernelTests/Core/Entity/EntityApiTest.php @@ -94,7 +94,7 @@ protected function assertCRUD(string $entity_type, UserInterface $user1): void { $storage->delete($entities); $all = $storage->loadMultiple(); - $this->assertTrue(empty($all), new FormattableMarkup('%entity_type: Deleted all entities.', ['%entity_type' => $entity_type])); + $this->assertEmpty($all, "All entities of type '$entity_type' should have been deleted."); // Verify that all data got deleted. $definition = \Drupal::entityTypeManager()->getDefinition($entity_type); @@ -124,7 +124,7 @@ protected function assertCRUD(string $entity_type, UserInterface $user1): void { // Verify that entities got deleted. $all = $storage->loadMultiple(); - $this->assertTrue(empty($all), new FormattableMarkup('%entity_type: Deleted all entities.', ['%entity_type' => $entity_type])); + $this->assertEmpty($all, "All entities of type '$entity_type' should have been deleted."); // Verify that all data got deleted from the tables. $definition = \Drupal::entityTypeManager()->getDefinition($entity_type); diff --git a/web/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php b/web/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php index f0f5211a0bda9b1613ec938fac763973bd49664c..e55211d347d01a02e6eeb800987db971a80b607d 100644 --- a/web/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php +++ b/web/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php @@ -195,14 +195,14 @@ protected function doTestReadWrite($entity_type) { unset($entity->name->value); $this->assertFalse(isset($entity->name->value), new FormattableMarkup('%entity_type: Name is not set.', ['%entity_type' => $entity_type])); $this->assertFalse(isset($entity->name[0]->value), new FormattableMarkup('%entity_type: Name is not set.', ['%entity_type' => $entity_type])); - $this->assertTrue(empty($entity->name->value), new FormattableMarkup('%entity_type: Name is empty.', ['%entity_type' => $entity_type])); - $this->assertTrue(empty($entity->name[0]->value), new FormattableMarkup('%entity_type: Name is empty.', ['%entity_type' => $entity_type])); + $this->assertEmpty($entity->name->value, new FormattableMarkup('%entity_type: Name is empty.', ['%entity_type' => $entity_type])); + $this->assertEmpty($entity->name[0]->value, new FormattableMarkup('%entity_type: Name is empty.', ['%entity_type' => $entity_type])); $entity->name->value = 'a value'; $this->assertTrue(isset($entity->name->value), new FormattableMarkup('%entity_type: Name is set.', ['%entity_type' => $entity_type])); $this->assertTrue(isset($entity->name[0]->value), new FormattableMarkup('%entity_type: Name is set.', ['%entity_type' => $entity_type])); - $this->assertFalse(empty($entity->name->value), new FormattableMarkup('%entity_type: Name is not empty.', ['%entity_type' => $entity_type])); - $this->assertFalse(empty($entity->name[0]->value), new FormattableMarkup('%entity_type: Name is not empty.', ['%entity_type' => $entity_type])); + $this->assertNotEmpty($entity->name->value, new FormattableMarkup('%entity_type: Name is not empty.', ['%entity_type' => $entity_type])); + $this->assertNotEmpty($entity->name[0]->value, new FormattableMarkup('%entity_type: Name is not empty.', ['%entity_type' => $entity_type])); $this->assertTrue(isset($entity->name[0]), new FormattableMarkup('%entity_type: Name string item is set.', ['%entity_type' => $entity_type])); $this->assertFalse(isset($entity->name[1]), new FormattableMarkup('%entity_type: Second name string item is not set as it does not exist', ['%entity_type' => $entity_type])); $this->assertTrue(isset($entity->name), new FormattableMarkup('%entity_type: Name field is set.', ['%entity_type' => $entity_type])); diff --git a/web/core/tests/Drupal/KernelTests/Core/Field/FieldItemTest.php b/web/core/tests/Drupal/KernelTests/Core/Field/FieldItemTest.php index 36f1f9cc83977440c549a0bc2dda78d5b27175b6..7eb64d6f3808e2bf7d20bc85c788386b961383b3 100644 --- a/web/core/tests/Drupal/KernelTests/Core/Field/FieldItemTest.php +++ b/web/core/tests/Drupal/KernelTests/Core/Field/FieldItemTest.php @@ -51,7 +51,7 @@ protected function setUp(): void { $this->entityTypeManager->clearCachedDefinitions(); $definitions = \Drupal::service('entity_field.manager')->getFieldStorageDefinitions($entity_type_id); - $this->assertTrue(!empty($definitions[$this->fieldName])); + $this->assertNotEmpty($definitions[$this->fieldName]); } /** diff --git a/web/core/tests/Drupal/KernelTests/Core/File/ScanDirectoryTest.php b/web/core/tests/Drupal/KernelTests/Core/File/ScanDirectoryTest.php index 970ca6909fceb6d78037ca0c93daecf9a8ce299a..a703fe9aa2900f66df91579033d0e2577bde1510 100644 --- a/web/core/tests/Drupal/KernelTests/Core/File/ScanDirectoryTest.php +++ b/web/core/tests/Drupal/KernelTests/Core/File/ScanDirectoryTest.php @@ -146,7 +146,7 @@ public function testOptionKey() { */ public function testOptionRecurse() { $files = $this->fileSystem->scanDirectory($this->path . '/..', '/^javascript-/', ['recurse' => FALSE]); - $this->assertTrue(empty($files), "Without recursion couldn't find javascript files."); + $this->assertEmpty($files, "Without recursion couldn't find javascript files."); $files = $this->fileSystem->scanDirectory($this->path . '/..', '/^javascript-/', ['recurse' => TRUE]); $this->assertCount(2, $files, 'With recursion we found the expected javascript files.'); @@ -163,7 +163,7 @@ public function testOptionMinDepth() { $this->assertCount(2, $files, 'No minimum-depth gets files in current directory.'); $files = $this->fileSystem->scanDirectory($this->path, '/^javascript-/', ['min_depth' => 1]); - $this->assertTrue(empty($files), 'Minimum-depth of 1 successfully excludes files from current directory.'); + $this->assertEmpty($files, 'Minimum-depth of 1 successfully excludes files from current directory.'); } /** diff --git a/web/core/tests/Drupal/KernelTests/Core/Form/FormCacheTest.php b/web/core/tests/Drupal/KernelTests/Core/Form/FormCacheTest.php index 2e7ad83046f8b1ab4e2b747ee0fa03095bd80030..6b8fd87dff31ade4ad788d6901d6c9f74072746a 100644 --- a/web/core/tests/Drupal/KernelTests/Core/Form/FormCacheTest.php +++ b/web/core/tests/Drupal/KernelTests/Core/Form/FormCacheTest.php @@ -94,7 +94,7 @@ public function testNoCacheToken() { $cached_form_state = new FormState(); $cached_form = \Drupal::formBuilder()->getCache($this->formBuildId, $cached_form_state); $this->assertEquals($this->form['#property'], $cached_form['#property']); - $this->assertTrue(empty($cached_form['#cache_token']), 'Form has no cache token'); + $this->assertArrayNotHasKey('#cache_token', $cached_form, 'Form has no cache token'); $this->assertEquals($this->formState->get('example'), $cached_form_state->get('example')); // Restore user account. diff --git a/web/core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageExpirableTest.php b/web/core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageExpirableTest.php index 5b7bd8f5146a5b258dd32d3c97b9253da63cf1c5..9f52371007d4e08195fe4fa3a394fdacbe03bdbd 100644 --- a/web/core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageExpirableTest.php +++ b/web/core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageExpirableTest.php @@ -148,7 +148,7 @@ public function testExpiration() { $all = $stores[0]->getAll(); $this->assertCount(2, $all); foreach (['troubles', 'still'] as $key) { - $this->assertTrue(!empty($all[$key])); + $this->assertArrayHasKey($key, $all); } // Test DatabaseStorageExpirable::setWithExpireIfNotExists() will overwrite diff --git a/web/core/tests/Drupal/KernelTests/Core/Plugin/ContextPluginTest.php b/web/core/tests/Drupal/KernelTests/Core/Plugin/ContextPluginTest.php index e394a2d2da198a90021a25bc19674c599b51102b..aa506632c66f02d8adb003478dc351fd6eec5f78 100644 --- a/web/core/tests/Drupal/KernelTests/Core/Plugin/ContextPluginTest.php +++ b/web/core/tests/Drupal/KernelTests/Core/Plugin/ContextPluginTest.php @@ -72,7 +72,7 @@ public function testContext() { // Try to pass the wrong class type as a context value. $plugin->setContextValue('user', $node); $violations = $plugin->validateContexts(); - $this->assertTrue(!empty($violations), 'The provided context value does not pass validation.'); + $this->assertNotEmpty($violations, 'The provided context value does not pass validation.'); // Set an appropriate context value and check to make sure its methods work // as expected. diff --git a/web/core/tests/Drupal/KernelTests/Core/Theme/BaseThemeRequiredTest.php b/web/core/tests/Drupal/KernelTests/Core/Theme/BaseThemeRequiredTest.php index 13734db774c75e0eafae448c7b09049b2c566e69..3bfd15948c0aaf11b5e8961a4c4f967d17117626 100644 --- a/web/core/tests/Drupal/KernelTests/Core/Theme/BaseThemeRequiredTest.php +++ b/web/core/tests/Drupal/KernelTests/Core/Theme/BaseThemeRequiredTest.php @@ -49,7 +49,7 @@ public function testWildWest() { $theme = $this->themeManager->getActiveTheme(); /** @var \Drupal\Core\Theme\ActiveTheme $base_theme */ $base_themes = $theme->getBaseThemeExtensions(); - $this->assertTrue(empty($base_themes), 'No base theme is set when a theme has opted out of using Stable.'); + $this->assertEmpty($base_themes, 'No base theme is set when a theme has opted out of using Stable.'); } } diff --git a/web/core/tests/Drupal/KernelTests/Core/Theme/Stable9LibraryOverrideTest.php b/web/core/tests/Drupal/KernelTests/Core/Theme/Stable9LibraryOverrideTest.php index 251612a401d847a54c13a8a8db582965cb57e8c1..04521c0df9c96f4b0f20e71477266ff1c190f3a6 100644 --- a/web/core/tests/Drupal/KernelTests/Core/Theme/Stable9LibraryOverrideTest.php +++ b/web/core/tests/Drupal/KernelTests/Core/Theme/Stable9LibraryOverrideTest.php @@ -74,6 +74,10 @@ protected function setUp(): void { $this->allModules[] = 'system'; $this->allModules[] = 'user'; $this->allModules[] = 'path_alias'; + $database_module = \Drupal::database()->getProvider(); + if ($database_module !== 'core') { + $this->allModules[] = $database_module; + } sort($this->allModules); $this->container->get('module_installer')->install($this->allModules); diff --git a/web/core/tests/Drupal/KernelTests/Core/Theme/StableLibraryOverrideTest.php b/web/core/tests/Drupal/KernelTests/Core/Theme/StableLibraryOverrideTest.php index b2baf2beab9a6f2996391c832906344533717e3c..38cf0759763b7a4542135b9e5cbfd00118e5a8c6 100644 --- a/web/core/tests/Drupal/KernelTests/Core/Theme/StableLibraryOverrideTest.php +++ b/web/core/tests/Drupal/KernelTests/Core/Theme/StableLibraryOverrideTest.php @@ -74,6 +74,10 @@ protected function setUp(): void { $this->allModules[] = 'system'; $this->allModules[] = 'user'; $this->allModules[] = 'path_alias'; + $database_module = \Drupal::database()->getProvider(); + if ($database_module !== 'core') { + $this->allModules[] = $database_module; + } sort($this->allModules); $this->container->get('module_installer')->install($this->allModules); diff --git a/web/core/tests/Drupal/KernelTests/KernelTestBaseTest.php b/web/core/tests/Drupal/KernelTests/KernelTestBaseTest.php index 7ca986ef35099a2bcf993efae3e2b102e9e22318..e17d56200127c7d9045d0583701e95fcc4574157 100644 --- a/web/core/tests/Drupal/KernelTests/KernelTestBaseTest.php +++ b/web/core/tests/Drupal/KernelTests/KernelTestBaseTest.php @@ -320,11 +320,11 @@ protected function tearDown(): void { ':table_name' => '%', ':pattern' => 'sqlite_%', ])->fetchAllKeyed(0, 0); - $this->assertTrue(empty($result), 'All test tables have been removed.'); + $this->assertEmpty($result, 'All test tables have been removed.'); } else { $tables = $connection->schema()->findTables($this->databasePrefix . '%'); - $this->assertTrue(empty($tables), 'All test tables have been removed.'); + $this->assertEmpty($tables, 'All test tables have been removed.'); } } diff --git a/web/core/tests/Drupal/Tests/BrowserHtmlDebugTrait.php b/web/core/tests/Drupal/Tests/BrowserHtmlDebugTrait.php index 4288598a592a7e99927b8645d40b5d7f34a552c3..18deac7e359dd8bc5b30b7a299a8c5221ab44115 100644 --- a/web/core/tests/Drupal/Tests/BrowserHtmlDebugTrait.php +++ b/web/core/tests/Drupal/Tests/BrowserHtmlDebugTrait.php @@ -41,7 +41,7 @@ trait BrowserHtmlDebugTrait { protected $htmlOutputCounter = 1; /** - * HTML output output enabled. + * HTML output enabled. * * @var bool */ diff --git a/web/core/tests/Drupal/Tests/Component/Discovery/YamlDirectoryDiscoveryTest.php b/web/core/tests/Drupal/Tests/Component/Discovery/YamlDirectoryDiscoveryTest.php index c329a7ddeb3a08fb4ce49289dc95cb4ffb2f70ae..710a2770e68575eba4ef0c858d65e45b9ec0cb0b 100644 --- a/web/core/tests/Drupal/Tests/Component/Discovery/YamlDirectoryDiscoveryTest.php +++ b/web/core/tests/Drupal/Tests/Component/Discovery/YamlDirectoryDiscoveryTest.php @@ -87,7 +87,7 @@ public function testDiscovery() { $this->assertSame(['id' => 'item3', 'name' => 'test2 item 3', YamlDirectoryDiscovery::FILE_KEY => 'vfs://modules/test_2/subdir1/item_3.test.yml'], $data['test_2']['item3']); $this->assertCount(1, $data['test_2']); - $this->assertTrue(empty($data['test_3']), 'test_3 provides 0 items'); + $this->assertArrayNotHasKey('test_3', $data, 'test_3 provides 0 items'); $this->assertSame(['id' => 'item4', 'name' => 'test4 item 4', YamlDirectoryDiscovery::FILE_KEY => 'vfs://modules/test_4/subdir1/item_4.test.yml'], $data['test_4']['item4']); $this->assertSame(['id' => 'item5', 'name' => 'test4 item 5', YamlDirectoryDiscovery::FILE_KEY => 'vfs://modules/test_4/subdir1/item_5.test.yml'], $data['test_4']['item5']); diff --git a/web/core/tests/Drupal/Tests/Component/Utility/XssTest.php b/web/core/tests/Drupal/Tests/Component/Utility/XssTest.php index 9ecffc195eca01025e214d50828d0e76699f506b..d8ddc227cae06a220412e84a3c5a5564cd7c6adc 100644 --- a/web/core/tests/Drupal/Tests/Component/Utility/XssTest.php +++ b/web/core/tests/Drupal/Tests/Component/Utility/XssTest.php @@ -86,7 +86,7 @@ public function testFilterXssNormalized($value, $expected, $message, array $allo * - The value to filter. * - The value to expect after filtering. * - The assertion message. - * - (optional) The allowed HTML HTML tags array that should be passed to + * - (optional) The allowed HTML tags array that should be passed to * \Drupal\Component\Utility\Xss::filter(). */ public function providerTestFilterXssNormalized() { @@ -153,7 +153,7 @@ public function testFilterXssNotNormalized($value, $expected, $message, array $a * - The value to filter. * - The value to expect that's missing after filtering. * - The assertion message. - * - (optional) The allowed HTML HTML tags array that should be passed to + * - (optional) The allowed HTML tags array that should be passed to * \Drupal\Component\Utility\Xss::filter(). */ public function providerTestFilterXssNotNormalized() { diff --git a/web/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ComposerHookTest.php b/web/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ComposerHookTest.php index 372ba0dee39a639aa6397fcd77b3eaf850ef1db4..52e27878588addc6efb38fa12b8a51bbb2325b44 100644 --- a/web/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ComposerHookTest.php +++ b/web/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ComposerHookTest.php @@ -81,7 +81,7 @@ public function testComposerHooks() { // project is "allowed" in our main fixture project, but not required. // We expect that requiring this library should re-scaffold, resulting // in a changed default.settings.php file. - $stdout = $this->mustExec("composer require --no-ansi --no-interaction fixtures/scaffold-override-fixture:dev-master", $sut); + $stdout = $this->mustExec("composer require --no-ansi --no-interaction fixtures/drupal-assets-fixture:dev-master fixtures/scaffold-override-fixture:dev-master", $sut); $this->assertScaffoldedFile($sut . '/sites/default/default.settings.php', FALSE, 'scaffolded from the scaffold-override-fixture'); // Make sure that the appropriate notice informing us that scaffolding // is allowed was printed. @@ -120,7 +120,7 @@ public function testComposerHooks() { $this->mustExec("composer install --no-ansi", $sut); // Require a project that is not allowed to scaffold and confirm that we // get a warning, and it does not scaffold. - $stdout = $this->mustExec("composer require --no-ansi --no-interaction fixtures/scaffold-override-fixture:dev-master", $sut); + $stdout = $this->mustExec("composer require --no-ansi --no-interaction fixtures/drupal-assets-fixture:dev-master fixtures/scaffold-override-fixture:dev-master", $sut); $this->assertFileDoesNotExist($sut . '/sites/default/default.settings.php'); $this->assertStringContainsString("Not scaffolding files for fixtures/scaffold-override-fixture, because it is not listed in the element 'extra.drupal-scaffold.allowed-packages' in the root-level composer.json file.", $stdout); } diff --git a/web/core/tests/Drupal/Tests/Core/Entity/Enhancer/EntityRouteEnhancerTest.php b/web/core/tests/Drupal/Tests/Core/Entity/Enhancer/EntityRouteEnhancerTest.php index 3f41a393002a61291b106c2cceceedc7341a39d3..c3c2cbc0021af25e98aec6e17df7501d4f23d5ef 100644 --- a/web/core/tests/Drupal/Tests/Core/Entity/Enhancer/EntityRouteEnhancerTest.php +++ b/web/core/tests/Drupal/Tests/Core/Entity/Enhancer/EntityRouteEnhancerTest.php @@ -85,7 +85,7 @@ public function testEnhancer() { $defaults = $route_enhancer->enhance($defaults, $request); $this->assertEquals('\Drupal\Core\Entity\Controller\EntityViewController::view', $defaults['_controller'], 'The entity view controller was not set.'); $this->assertEquals('Mock entity', $defaults['_entity']); - $this->assertTrue(empty($defaults['view_mode'])); + $this->assertArrayNotHasKey('view_mode', $defaults); $this->assertFalse(isset($defaults['_entity_view'])); } diff --git a/web/core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php b/web/core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php index ae0f753ef7ecd8d7b2a47d62e492ff248c90dfb2..96fd9fd76a2052be552926e78ea4eb15be45d6bd 100644 --- a/web/core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php +++ b/web/core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php @@ -45,7 +45,7 @@ protected function setUp(): void { public function testInfoParserNonExisting() { vfsStream::setup('modules'); $info = $this->infoParser->parse(vfsStream::url('modules') . '/does_not_exist.info.txt'); - $this->assertTrue(empty($info), 'Non existing info.yml returns empty array.'); + $this->assertEmpty($info, 'Non existing info.yml returns empty array.'); } /** diff --git a/web/core/tests/Drupal/Tests/Core/Render/MetadataBubblingUrlGeneratorTest.php b/web/core/tests/Drupal/Tests/Core/Render/MetadataBubblingUrlGeneratorTest.php index d47f35141efcf1730ddcd3fc14039a031aedb197..3979f2cc07331cdb29caf76756f821908197d9c8 100644 --- a/web/core/tests/Drupal/Tests/Core/Render/MetadataBubblingUrlGeneratorTest.php +++ b/web/core/tests/Drupal/Tests/Core/Render/MetadataBubblingUrlGeneratorTest.php @@ -56,7 +56,7 @@ public function testUrlBubbleableMetadataBubbling($collect_bubbleable_metadata, $this->renderer->expects($this->exactly($invocations)) ->method('render') ->willReturnCallback(function ($build) use ($self) { - $self->assertTrue(!empty($build['#cache'])); + $this->assertArrayHasKey('#cache', $build); }); $url = new Url('test_1', [], $options); diff --git a/web/core/tests/Drupal/Tests/Core/Render/RendererRecursionTest.php b/web/core/tests/Drupal/Tests/Core/Render/RendererRecursionTest.php index 69fa66bdd4d7414b0198d36eb4afcabbd262a2db..70b6a83dc3a0c46ff431675471c16905e8604bc9 100644 --- a/web/core/tests/Drupal/Tests/Core/Render/RendererRecursionTest.php +++ b/web/core/tests/Drupal/Tests/Core/Render/RendererRecursionTest.php @@ -122,7 +122,7 @@ public function testRenderRecursionWithNestedRenderPlain() { $output = $renderer->renderRoot($page); $this->assertEquals('<p>This is a rendered placeholder!</p>' . $parent_markup, $output, 'Rendered output as expected, with the placeholder replaced.'); $this->assertNotContains('test:complex_child', $page['#cache']['tags'], 'Cache tag bubbling not performed.'); - $this->assertTrue(empty($page['#attached']), 'Asset bubbling not performed.'); + $this->assertEmpty($page['#attached'], 'Asset bubbling not performed.'); } } diff --git a/web/core/themes/claro/css/theme/media-library.css b/web/core/themes/claro/css/theme/media-library.css index f48499892138792822ebb9c70d3c7ad8ff5f6ec5..46be6a74ffaddc0ad23d4897a5493eaf777acb9d 100644 --- a/web/core/themes/claro/css/theme/media-library.css +++ b/web/core/themes/claro/css/theme/media-library.css @@ -256,7 +256,7 @@ margin: 0.5rem 0 0; } -/* Align remove buttons with with Save button and compensate for IE scrollbar and focus padding. */ +/* Align remove buttons with Save button and compensate for IE scrollbar and focus padding. */ @media all and (-ms-high-contrast: active), (-ms-high-contrast: none) { .ui-dialog > .ui-dialog-content { diff --git a/web/core/themes/claro/css/theme/media-library.pcss.css b/web/core/themes/claro/css/theme/media-library.pcss.css index 6db92daad1d8038028cba6b1a69451ab0f0f1586..c9be5f01f4f6fe57d1e7871b4bf2774b72e8d6a0 100644 --- a/web/core/themes/claro/css/theme/media-library.pcss.css +++ b/web/core/themes/claro/css/theme/media-library.pcss.css @@ -235,7 +235,7 @@ margin: 8px 0 0; } -/* Align remove buttons with with Save button and compensate for IE scrollbar and focus padding. */ +/* Align remove buttons with Save button and compensate for IE scrollbar and focus padding. */ @media all and (-ms-high-contrast: active), (-ms-high-contrast: none) { .ui-dialog > .ui-dialog-content { padding-right: calc(var(--space-s) - calc(var(--focus-border-size) + var(--focus-border-offset-size) + 2px)); diff --git a/web/core/themes/olivero/css/components/navigation/nav-primary-wide.css b/web/core/themes/olivero/css/components/navigation/nav-primary-wide.css index 625efe4484b61c95cb8934c8f014a9bf10f65a96..9b5ef1b5c040753aa00cdc432ed010b724225909 100644 --- a/web/core/themes/olivero/css/components/navigation/nav-primary-wide.css +++ b/web/core/themes/olivero/css/components/navigation/nav-primary-wide.css @@ -111,8 +111,8 @@ } body:not(.is-always-mobile-nav) .primary-nav__menu-link-inner { - padding-top: 1.125rem; - padding-bottom: 1.125rem + padding-top: 2.25rem; + padding-bottom: 2.25rem } body:not(.is-always-mobile-nav) .primary-nav__menu-link-inner:after { diff --git a/web/core/themes/olivero/css/components/navigation/nav-primary-wide.pcss.css b/web/core/themes/olivero/css/components/navigation/nav-primary-wide.pcss.css index 16e196c0b290cc736712ea475d1067e4a3af45fe..65c7019c0d7a4ced7297a95f713d5d42ccb1681a 100644 --- a/web/core/themes/olivero/css/components/navigation/nav-primary-wide.pcss.css +++ b/web/core/themes/olivero/css/components/navigation/nav-primary-wide.pcss.css @@ -82,7 +82,7 @@ body:not(.is-always-mobile-nav) { } & .primary-nav__menu-link-inner { - padding-block: var(--sp1); + padding-block: var(--sp2); padding-inline-start: 0; padding-inline-end: 0; diff --git a/web/core/themes/stable/css/core/dialog/off-canvas.reset.css b/web/core/themes/stable/css/core/dialog/off-canvas.reset.css index 1c67de4c15ecef0aee1300edefe0f94df3ca20f9..e4107f4257ca6efc875643acdcb5e341eb2338f6 100644 --- a/web/core/themes/stable/css/core/dialog/off-canvas.reset.css +++ b/web/core/themes/stable/css/core/dialog/off-canvas.reset.css @@ -799,8 +799,12 @@ box-shadow: none; } -#drupal-off-canvas input:placeholder, -#drupal-off-canvas textarea:placeholder { +#drupal-off-canvas input:-ms-input-placeholder, #drupal-off-canvas textarea:-ms-input-placeholder { + color: gray; +} + +#drupal-off-canvas input::placeholder, +#drupal-off-canvas textarea::placeholder { color: gray; } diff --git a/web/core/themes/stable/css/core/dialog/off-canvas.reset.pcss.css b/web/core/themes/stable/css/core/dialog/off-canvas.reset.pcss.css index a4f71d5af4b398eec5e6bb4a7dbaccc3b7b40f67..4404f950d8467a07e8c388c9888ab82ffeddbfa4 100644 --- a/web/core/themes/stable/css/core/dialog/off-canvas.reset.pcss.css +++ b/web/core/themes/stable/css/core/dialog/off-canvas.reset.pcss.css @@ -425,8 +425,8 @@ user-select: none; box-shadow: none; } -#drupal-off-canvas input:placeholder, -#drupal-off-canvas textarea:placeholder { +#drupal-off-canvas input::placeholder, +#drupal-off-canvas textarea::placeholder { color: gray; } #drupal-off-canvas textarea,