diff --git a/core/includes/common.inc b/core/includes/common.inc index f40565a..2f4fac0 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -1111,7 +1111,6 @@ function drupal_flush_all_caches() { // to reset the theme manager. \Drupal::theme()->resetActiveTheme(); - // Rebuild and reboot a new kernel. A simple DrupalKernel reboot is not // sufficient, since the list of enabled modules might have been adjusted // above due to changed code. diff --git a/core/includes/file.inc b/core/includes/file.inc index 228515d..f6fbc18 100644 --- a/core/includes/file.inc +++ b/core/includes/file.inc @@ -526,7 +526,6 @@ function file_unmanaged_prepare($source, &$destination = NULL, $replace = FILE_E $destination = file_build_uri(drupal_basename($source)); } - // Prepare the destination directory. if (file_prepare_directory($destination)) { // The destination is already a directory, so append the source basename. diff --git a/core/lib/Drupal/Component/Diff/Diff.php b/core/lib/Drupal/Component/Diff/Diff.php index 8135b15..289bab5 100644 --- a/core/lib/Drupal/Component/Diff/Diff.php +++ b/core/lib/Drupal/Component/Diff/Diff.php @@ -148,7 +148,6 @@ public function check($from_lines, $to_lines) { trigger_error("Reversed closing doesn't match", E_USER_ERROR); } - $prevtype = 'none'; foreach ($this->edits as $edit) { if ( $prevtype == $edit->type ) { diff --git a/core/lib/Drupal/Core/Cache/Context/CacheContextsPass.php b/core/lib/Drupal/Core/Cache/Context/CacheContextsPass.php index bf49e54..2025fbb 100644 --- a/core/lib/Drupal/Core/Cache/Context/CacheContextsPass.php +++ b/core/lib/Drupal/Core/Cache/Context/CacheContextsPass.php @@ -36,7 +36,6 @@ public function process(ContainerBuilder $container) { } } - $container->setParameter('cache_contexts', $cache_contexts); } diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php index a14a83f..a7c1496 100644 --- a/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php +++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php @@ -124,7 +124,6 @@ public static function open(array &$connection_options = []) { throw $e; } - // Create functions needed by SQLite. $pdo->sqliteCreateFunction('if', [__CLASS__, 'sqlFunctionIf']); $pdo->sqliteCreateFunction('greatest', [__CLASS__, 'sqlFunctionGreatest']); diff --git a/core/lib/Drupal/Core/Database/Query/Select.php b/core/lib/Drupal/Core/Database/Query/Select.php index b3426e6..91eba3e 100644 --- a/core/lib/Drupal/Core/Database/Query/Select.php +++ b/core/lib/Drupal/Core/Database/Query/Select.php @@ -825,7 +825,6 @@ public function __toString() { } $query .= implode(', ', $fields); - // FROM - We presume all queries have a FROM, as any query that doesn't won't need the query builder anyway. $query .= "\nFROM "; foreach ($this->tables as $table) { diff --git a/core/lib/Drupal/Core/DependencyInjection/Compiler/BackendCompilerPass.php b/core/lib/Drupal/Core/DependencyInjection/Compiler/BackendCompilerPass.php index 1578cef..52e5c2b 100644 --- a/core/lib/Drupal/Core/DependencyInjection/Compiler/BackendCompilerPass.php +++ b/core/lib/Drupal/Core/DependencyInjection/Compiler/BackendCompilerPass.php @@ -56,7 +56,6 @@ public function process(ContainerBuilder $container) { } } - foreach ($container->findTaggedServiceIds('backend_overridable') as $id => $attributes) { // If the service is already an alias it is not the original backend, so // we don't want to fallback to other storages any longer. diff --git a/core/lib/Drupal/Core/Extension/ThemeInstaller.php b/core/lib/Drupal/Core/Extension/ThemeInstaller.php index db1226f..5472d3e 100644 --- a/core/lib/Drupal/Core/Extension/ThemeInstaller.php +++ b/core/lib/Drupal/Core/Extension/ThemeInstaller.php @@ -265,7 +265,6 @@ public function uninstall(array $theme_list) { $extension_config->save(TRUE); $this->state->set('system.theme.data', $current_theme_data); - // @todo Remove system_list(). $this->themeHandler->refreshInfo(); $this->resetSystem(); diff --git a/core/lib/Drupal/Core/Routing/MatcherDumper.php b/core/lib/Drupal/Core/Routing/MatcherDumper.php index 5e329f7..a82dd09 100644 --- a/core/lib/Drupal/Core/Routing/MatcherDumper.php +++ b/core/lib/Drupal/Core/Routing/MatcherDumper.php @@ -141,7 +141,6 @@ public function dump(array $options = []) { $insert->execute(); } - } catch (\Exception $e) { $transaction->rollBack(); diff --git a/core/modules/big_pipe/src/Render/BigPipe.php b/core/modules/big_pipe/src/Render/BigPipe.php index b312d76..ef658c2 100644 --- a/core/modules/big_pipe/src/Render/BigPipe.php +++ b/core/modules/big_pipe/src/Render/BigPipe.php @@ -446,7 +446,6 @@ protected function sendNoJsPlaceholders($html, $no_js_placeholders, AttachedAsse } } - // Create a new HtmlResponse. Ensure the CSS and (non-bottom) JS is sent // before the HTML they're associated with. In other words: ensure the // critical assets for this placeholder's markup are loaded first. @@ -483,7 +482,6 @@ protected function sendNoJsPlaceholders($html, $no_js_placeholders, AttachedAsse } } - // Send this embedded HTML response. $this->sendChunk($html_response); diff --git a/core/modules/big_pipe/tests/modules/big_pipe_test/src/BigPipePlaceholderTestCases.php b/core/modules/big_pipe/tests/modules/big_pipe_test/src/BigPipePlaceholderTestCases.php index 51b1976..e3da529 100644 --- a/core/modules/big_pipe/tests/modules/big_pipe_test/src/BigPipePlaceholderTestCases.php +++ b/core/modules/big_pipe/tests/modules/big_pipe_test/src/BigPipePlaceholderTestCases.php @@ -45,7 +45,6 @@ public static function cases(ContainerInterface $container = NULL, AccountInterf 'contexts' => ['session.exists', 'cookies:big_pipe_nojs'], ]; - // 1. Real-world example of HTML placeholder. $status_messages = new BigPipePlaceholderTestCase( ['#type' => 'status_messages'], @@ -96,7 +95,6 @@ public static function cases(ContainerInterface $container = NULL, AccountInterf $status_messages->embeddedHtmlResponse = '' . "\n \n"; } - // 2. Real-world example of HTML attribute value placeholder: form action. $form_action = new BigPipePlaceholderTestCase( $container ? $container->get('form_builder')->getForm('Drupal\big_pipe_test\Form\BigPipeTestForm') : [], @@ -119,7 +117,6 @@ public static function cases(ContainerInterface $container = NULL, AccountInterf $form_action->embeddedHtmlResponse = '
embeddedHtmlResponse = $container->get('csrf_token')->get('admin/appearance/default'); } - // 4. Edge case: custom string to be considered as a placeholder that // happens to not be valid HTML. $hello = new BigPipePlaceholderTestCase( @@ -182,7 +178,6 @@ public static function cases(ContainerInterface $container = NULL, AccountInterf ]; $hello->embeddedHtmlResponse = 'Yarhar llamas forever!'; - // 5. Edge case: non-#lazy_builder placeholder. $current_time = new BigPipePlaceholderTestCase( [ @@ -239,7 +234,6 @@ public static function cases(ContainerInterface $container = NULL, AccountInterf ]; $current_time->embeddedHtmlResponse = ''; - // 6. Edge case: #lazy_builder that throws an exception. $exception = new BigPipePlaceholderTestCase( [ diff --git a/core/modules/comment/src/Tests/CommentThreadingTest.php b/core/modules/comment/src/Tests/CommentThreadingTest.php index 8f412b2..7e8c163 100644 --- a/core/modules/comment/src/Tests/CommentThreadingTest.php +++ b/core/modules/comment/src/Tests/CommentThreadingTest.php @@ -54,7 +54,6 @@ public function testCommentThreading() { // Confirm that there is a link to the parent comment. $this->assertParentLink($comment1_3->id(), $comment1->id()); - // Reply to comment #1_3 creating comment #1_3_4. $this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment/' . $comment1_3->id()); $comment1_3_4 = $this->postComment(NULL, $this->randomMachineName(), $this->randomMachineName(), TRUE); diff --git a/core/modules/datetime/src/Plugin/views/filter/Date.php b/core/modules/datetime/src/Plugin/views/filter/Date.php index afd629a..0358054 100644 --- a/core/modules/datetime/src/Plugin/views/filter/Date.php +++ b/core/modules/datetime/src/Plugin/views/filter/Date.php @@ -96,7 +96,6 @@ protected function opBetween($field) { // Formatting will vary on date storage. - // Convert to ISO format and format for query. UTC timezone is used since // dates are stored in UTC. $a = $this->query->getDateFormat("'" . $this->dateFormatter->format($a, 'custom', DATETIME_DATETIME_STORAGE_FORMAT, DATETIME_STORAGE_TIMEZONE) . "'", $this->dateFormat, TRUE); diff --git a/core/modules/editor/src/Tests/EditorSecurityTest.php b/core/modules/editor/src/Tests/EditorSecurityTest.php index d00fe0e..60fb590 100644 --- a/core/modules/editor/src/Tests/EditorSecurityTest.php +++ b/core/modules/editor/src/Tests/EditorSecurityTest.php @@ -158,7 +158,6 @@ protected function setUp() { ]); $editor->save(); - // Create node type. $this->drupalCreateContentType([ 'type' => 'article', diff --git a/core/modules/editor/tests/src/Functional/Update/EditorUpdateTest.php b/core/modules/editor/tests/src/Functional/Update/EditorUpdateTest.php index a143c05..ad36484 100644 --- a/core/modules/editor/tests/src/Functional/Update/EditorUpdateTest.php +++ b/core/modules/editor/tests/src/Functional/Update/EditorUpdateTest.php @@ -46,7 +46,6 @@ public function testEditorUpdate8001() { $this->assertTrue($editor_full_html->get('status')); $this->assertNotIdentical($format_full_html->get('status'), $editor_full_html->get('status')); - // Run updates. $this->runUpdates(); diff --git a/core/modules/field/src/Tests/EntityReference/EntityReferenceFileUploadTest.php b/core/modules/field/src/Tests/EntityReference/EntityReferenceFileUploadTest.php index 1957584..ca36950 100644 --- a/core/modules/field/src/Tests/EntityReference/EntityReferenceFileUploadTest.php +++ b/core/modules/field/src/Tests/EntityReference/EntityReferenceFileUploadTest.php @@ -77,7 +77,6 @@ protected function setUp() { ], ])->save(); - // Create a file field. $file_field_name = 'file_field'; $field_storage = FieldStorageConfig::create([ diff --git a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php index 87a5f2f..c390e2f 100644 --- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php +++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php @@ -148,7 +148,6 @@ public function testFieldInstances() { $this->assertEntity('comment.comment_node_test_content_type.field_integer', 'Integer', 'integer', FALSE, FALSE); $this->assertEntity('user.user.field_file', 'File', 'file', FALSE, FALSE); - $this->assertLinkFields('node.test_content_type.field_link', DRUPAL_OPTIONAL); $this->assertLinkFields('node.article.field_link', DRUPAL_DISABLED); $this->assertLinkFields('node.blog.field_link', DRUPAL_REQUIRED); diff --git a/core/modules/forum/forum.views.inc b/core/modules/forum/forum.views.inc index 6f24259..5f67af5 100644 --- a/core/modules/forum/forum.views.inc +++ b/core/modules/forum/forum.views.inc @@ -86,7 +86,6 @@ function forum_views_data() { ], ]; - $data['forum_index']['created'] = [ 'title' => t('Post date'), 'help' => t('The date the content was posted.'), diff --git a/core/modules/forum/tests/src/Functional/ForumBlockTest.php b/core/modules/forum/tests/src/Functional/ForumBlockTest.php index 2914e94..b231f6d 100644 --- a/core/modules/forum/tests/src/Functional/ForumBlockTest.php +++ b/core/modules/forum/tests/src/Functional/ForumBlockTest.php @@ -52,7 +52,6 @@ public function testNewForumTopicsBlock() { // Create 5 forum topics. $topics = $this->createForumTopics(); - $this->assertLink(t('More'), 0, 'New forum topics block has a "more"-link.'); $this->assertLinkByHref('forum', 0, 'New forum topics block has a "more"-link.'); diff --git a/core/modules/forum/tests/src/Functional/ForumIndexTest.php b/core/modules/forum/tests/src/Functional/ForumIndexTest.php index 38adb72..8e01a6f 100644 --- a/core/modules/forum/tests/src/Functional/ForumIndexTest.php +++ b/core/modules/forum/tests/src/Functional/ForumIndexTest.php @@ -69,7 +69,6 @@ public function testForumIndexStatus() { $this->assertCacheTag('taxonomy_term:' . $tid); $this->assertCacheTag('taxonomy_term:' . $tid_child); - // Unpublish the node. $edit = ['status[value]' => FALSE]; $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save')); diff --git a/core/modules/forum/tests/src/Functional/ForumNodeAccessTest.php b/core/modules/forum/tests/src/Functional/ForumNodeAccessTest.php index fb9da66..9849084 100644 --- a/core/modules/forum/tests/src/Functional/ForumNodeAccessTest.php +++ b/core/modules/forum/tests/src/Functional/ForumNodeAccessTest.php @@ -61,7 +61,6 @@ public function testForumNodeAccess() { $public_node = $this->drupalGetNodeByTitle($public_node_title); $this->assertTrue(!empty($public_node), 'New public forum node found in database.'); - // Enable the new and active forum blocks. $this->drupalPlaceBlock('forum_active_block'); $this->drupalPlaceBlock('forum_new_block'); diff --git a/core/modules/hal/tests/src/Functional/EntityResource/HalEntityNormalizationTrait.php b/core/modules/hal/tests/src/Functional/EntityResource/HalEntityNormalizationTrait.php index b64de67..1fc2329 100644 --- a/core/modules/hal/tests/src/Functional/EntityResource/HalEntityNormalizationTrait.php +++ b/core/modules/hal/tests/src/Functional/EntityResource/HalEntityNormalizationTrait.php @@ -97,7 +97,6 @@ protected function assertNormalizationEdgeCases($method, Url $url, array $reques if ($this->entity->getEntityType()->hasKey('bundle')) { $normalization = $this->getNormalizedPostEntity(); - $normalization['_links']['type'] = Url::fromUri('base:rest/type/' . static::$entityTypeId . '/bad_bundle_name'); $request_options[RequestOptions::BODY] = $this->serializer->encode($normalization, static::$format); @@ -105,11 +104,9 @@ protected function assertNormalizationEdgeCases($method, Url $url, array $reques $response = $this->request($method, $url, $request_options); $this->assertResourceErrorResponse(422, 'No entity type(s) specified', $response); - unset($normalization['_links']['type']); $request_options[RequestOptions::BODY] = $this->serializer->encode($normalization, static::$format); - // DX: 422 when no entity type bundle is specified. $response = $this->request($method, $url, $request_options); $this->assertResourceErrorResponse(422, 'The type link relation must be specified.', $response); diff --git a/core/modules/history/tests/src/Kernel/Views/HistoryTimestampTest.php b/core/modules/history/tests/src/Kernel/Views/HistoryTimestampTest.php index b9d345e..5aebaf4 100644 --- a/core/modules/history/tests/src/Kernel/Views/HistoryTimestampTest.php +++ b/core/modules/history/tests/src/Kernel/Views/HistoryTimestampTest.php @@ -81,7 +81,6 @@ public function testHandlers() { 'timestamp' => REQUEST_TIME + 100, ])->execute(); - $column_map = [ 'nid' => 'nid', ]; diff --git a/core/modules/image/src/Tests/ImageDimensionsTest.php b/core/modules/image/src/Tests/ImageDimensionsTest.php index b3e100d..d81c04d 100644 --- a/core/modules/image/src/Tests/ImageDimensionsTest.php +++ b/core/modules/image/src/Tests/ImageDimensionsTest.php @@ -173,7 +173,6 @@ public function testImageDimensions() { $this->assertResponse(200, 'Image was generated at the URL.'); $this->assertTrue(file_exists($generated_uri), 'Generated file does exist after we accessed it.'); - // Add a crop effect. $effect = [ 'id' => 'image_crop', diff --git a/core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkNotExistingInternalConstraintValidatorTest.php b/core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkNotExistingInternalConstraintValidatorTest.php index 41ecd4a..2842df8 100644 --- a/core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkNotExistingInternalConstraintValidatorTest.php +++ b/core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkNotExistingInternalConstraintValidatorTest.php @@ -31,7 +31,6 @@ public function testValidate($value, $valid) { ->method('addViolation'); } - $constraint = new LinkNotExistingInternalConstraint(); $validator = new LinkNotExistingInternalConstraintValidator(); diff --git a/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentCacheabilityBubblingTest.php b/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentCacheabilityBubblingTest.php index c7689d9..414ecde 100644 --- a/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentCacheabilityBubblingTest.php +++ b/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentCacheabilityBubblingTest.php @@ -59,7 +59,6 @@ public function testOutboundPathAndRouteProcessing() { $menu_tree = \Drupal::menuTree(); $renderer = \Drupal::service('renderer'); - $default_menu_cacheability = (new BubbleableMetadata()) ->setCacheMaxAge(Cache::PERMANENT) ->setCacheTags(['config:system.menu.tools']) diff --git a/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php index ffe4313..74aea9e 100644 --- a/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php +++ b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php @@ -225,7 +225,6 @@ public function buildCredentialForm(array $form, FormStateInterface $form_state) $default_options = []; - $form['version'] = [ '#type' => 'radios', '#default_value' => 7, diff --git a/core/modules/node/src/Tests/NodeRevisionsTest.php b/core/modules/node/src/Tests/NodeRevisionsTest.php index 1982266..6afdd5a 100644 --- a/core/modules/node/src/Tests/NodeRevisionsTest.php +++ b/core/modules/node/src/Tests/NodeRevisionsTest.php @@ -165,7 +165,6 @@ public function testRevisions() { $expected = '
  • Delete
  • '; $this->assertTrue(strstr($json[$ids[0]], $expected), 'The "Delete" contextual link is shown for the default revision.'); - // Confirm that revisions revert properly. $this->drupalPostForm("node/" . $node->id() . "/revisions/" . $nodes[1]->getRevisionid() . "/revert", [], t('Revert')); $this->assertRaw(t('@type %title has been reverted to the revision from %revision-date.', @@ -188,7 +187,6 @@ public function testRevisions() { $this->assertFalse(strstr($json[$ids[0]], '
  • '), 'The "Edit" contextual link is not shown for a non-default revision.'); $this->assertFalse(strstr($json[$ids[0]], '
  • '), 'The "Delete" contextual link is not shown for a non-default revision.'); - // Confirm revisions delete properly. $this->drupalPostForm("node/" . $node->id() . "/revisions/" . $nodes[1]->getRevisionId() . "/delete", [], t('Delete')); $this->assertRaw(t('Revision from %revision-date of @type %title has been deleted.', diff --git a/core/modules/path/src/Form/PathFormBase.php b/core/modules/path/src/Form/PathFormBase.php index 884d24f..5172419 100644 --- a/core/modules/path/src/Form/PathFormBase.php +++ b/core/modules/path/src/Form/PathFormBase.php @@ -191,7 +191,6 @@ public function validateForm(array &$form, FormStateInterface $form_state) { } } - if (!$this->pathValidator->isValid(trim($source, '/'))) { $form_state->setErrorByName('source', t("The path '@link_path' is either invalid or you do not have access to it.", ['@link_path' => $source])); } diff --git a/core/modules/rest/src/RequestHandler.php b/core/modules/rest/src/RequestHandler.php index 4b7020c..95deeaa 100644 --- a/core/modules/rest/src/RequestHandler.php +++ b/core/modules/rest/src/RequestHandler.php @@ -76,7 +76,6 @@ public function handle(RouteMatchInterface $route_match, Request $request) { $method = strtolower($route_match->getRouteObject()->getMethods()[0]); assert(count($route_match->getRouteObject()->getMethods()) === 1); - $resource_config_id = $route_match->getRouteObject()->getDefault('_rest_resource_config'); /** @var \Drupal\rest\RestResourceConfigInterface $resource_config */ $resource_config = $this->resourceStorage->load($resource_config_id); diff --git a/core/modules/rest/tests/src/Functional/CookieResourceTestTrait.php b/core/modules/rest/tests/src/Functional/CookieResourceTestTrait.php index 8975c3f..0aedc53 100644 --- a/core/modules/rest/tests/src/Functional/CookieResourceTestTrait.php +++ b/core/modules/rest/tests/src/Functional/CookieResourceTestTrait.php @@ -109,23 +109,18 @@ protected function assertAuthenticationEdgeCases($method, Url $url, array $reque return; } - unset($request_options[RequestOptions::HEADERS]['X-CSRF-Token']); - // DX: 403 when missing X-CSRF-Token request header. $response = $this->request($method, $url, $request_options); $this->assertResourceErrorResponse(403, 'X-CSRF-Token request header is missing', $response); - $request_options[RequestOptions::HEADERS]['X-CSRF-Token'] = 'this-is-not-the-token-you-are-looking-for'; - // DX: 403 when invalid X-CSRF-Token request header. $response = $this->request($method, $url, $request_options); $this->assertResourceErrorResponse(403, 'X-CSRF-Token request header is invalid', $response); - $request_options[RequestOptions::HEADERS]['X-CSRF-Token'] = $this->csrfToken; } diff --git a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php index f39b7d8..cf815b1 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php @@ -301,17 +301,14 @@ public function testGet() { $url = $this->getEntityResourceUrl(); $request_options = []; - // DX: 404 when resource not provisioned, 403 if canonical route. HTML // response because missing ?_format query string. $response = $this->request('GET', $url, $request_options); $this->assertSame($has_canonical_url ? 403 : 404, $response->getStatusCode()); $this->assertSame(['text/html; charset=UTF-8'], $response->getHeader('Content-Type')); - $url->setOption('query', ['_format' => static::$format]); - // DX: 404 when resource not provisioned, 403 if canonical route. Non-HTML // response because ?_format query string is present. $response = $this->request('GET', $url, $request_options); @@ -322,12 +319,10 @@ public function testGet() { $this->assertResourceErrorResponse(404, 'No route found for "GET ' . str_replace($this->baseUrl, '', $this->getEntityResourceUrl()->setAbsolute()->toString()) . '"', $response); } - $this->provisionEntityResource(); // Simulate the developer again forgetting the ?_format query string. $url->setOption('query', []); - // DX: 406 when ?_format is missing, except when requesting a canonical HTML // route. $response = $this->request('GET', $url, $request_options); @@ -338,10 +333,8 @@ public function testGet() { $this->assert406Response($response); } - $url->setOption('query', ['_format' => static::$format]); - // DX: forgetting authentication: authentication provider-specific error // response. if (static::$auth) { @@ -365,16 +358,13 @@ public function testGet() { unset($request_options[RequestOptions::HEADERS]['REST-test-auth-global']); $request_options = NestedArray::mergeDeep($request_options, $this->getAuthenticationRequestOptions('GET')); - // DX: 403 when unauthorized. $response = $this->request('GET', $url, $request_options); $this->assertResourceErrorResponse(403, $this->getExpectedUnauthorizedAccessMessage('GET'), $response); $this->assertArrayNotHasKey('Link', $response->getHeaders()); - $this->setUpAuthorization('GET'); - // 200 for well-formed HEAD request. $response = $this->request('HEAD', $url, $request_options); $this->assertResourceResponse(200, '', $response); @@ -508,11 +498,9 @@ public function testGet() { // PrimitiveDataNormalizer. $this->rebuildAll(); - $response = $this->request('GET', $url, $request_options); $this->assertResourceResponse(200, FALSE, $response); - // Again do an identical comparison, but this time transform the expected // normalized entity's values to strings. This ensures the BC layer for // bc_primitives_as_strings works as expected. @@ -542,11 +530,9 @@ public function testGet() { // TimestampItemNormalizer. $this->rebuildAll(); - $response = $this->request('GET', $url, $request_options); $this->assertResourceResponse(200, FALSE, $response); - // This ensures the BC layer for bc_timestamp_normalizer_unix works as // expected. This method should be using // ::formatExpectedTimestampValue() to generate the timestamp value. This @@ -564,75 +550,59 @@ public function testGet() { $this->rebuildAll(); } - // BC: rest_update_8203(). $this->config('rest.settings')->set('bc_entity_resource_permissions', TRUE)->save(TRUE); $this->refreshTestStateAfterRestConfigChange(); - // DX: 403 when unauthorized. $response = $this->request('GET', $url, $request_options); $this->assertResourceErrorResponse(403, $this->getExpectedUnauthorizedAccessMessage('GET'), $response); - $this->grantPermissionsToTestedRole(['restful get entity:' . static::$entityTypeId]); - // 200 for well-formed request. $response = $this->request('GET', $url, $request_options); $this->assertResourceResponse(200, FALSE, $response); - $this->resourceConfigStorage->load(static::$resourceConfigId)->disable()->save(); $this->refreshTestStateAfterRestConfigChange(); - // DX: upon disabling a resource, it's immediately no longer available. $this->assertResourceNotAvailable($url, $request_options); - $this->resourceConfigStorage->load(static::$resourceConfigId)->enable()->save(); $this->refreshTestStateAfterRestConfigChange(); - // DX: upon re-enabling a resource, immediate 200. $response = $this->request('GET', $url, $request_options); $this->assertResourceResponse(200, FALSE, $response); - $this->resourceConfigStorage->load(static::$resourceConfigId)->delete(); $this->refreshTestStateAfterRestConfigChange(); - // DX: upon deleting a resource, it's immediately no longer available. $this->assertResourceNotAvailable($url, $request_options); - $this->provisionEntityResource(); $url->setOption('query', ['_format' => 'non_existing_format']); - // DX: 406 when requesting unsupported format. $response = $this->request('GET', $url, $request_options); $this->assert406Response($response); $this->assertSame(['text/plain; charset=UTF-8'], $response->getHeader('Content-Type')); - $request_options[RequestOptions::HEADERS]['Accept'] = static::$mimeType; - // DX: 406 when requesting unsupported format but specifying Accept header: // should result in a text/plain response. $response = $this->request('GET', $url, $request_options); $this->assert406Response($response); $this->assertSame(['text/plain; charset=UTF-8'], $response->getHeader('Content-Type')); - $url = Url::fromRoute('rest.entity.' . static::$entityTypeId . '.GET.' . static::$format); $url->setRouteParameter(static::$entityTypeId, 987654321); $url->setOption('query', ['_format' => static::$format]); - // DX: 404 when GETting non-existing entity. $response = $this->request('GET', $url, $request_options); $path = str_replace('987654321', '{' . static::$entityTypeId . '}', $url->setAbsolute()->setOptions(['base_url' => '', 'query' => []])->toString()); @@ -714,27 +684,22 @@ public function testPost() { $url = $this->getEntityResourcePostUrl(); $request_options = []; - // DX: 404 when resource not provisioned. HTML response because missing // ?_format query string. $response = $this->request('POST', $url, $request_options); $this->assertSame(404, $response->getStatusCode()); $this->assertSame(['text/html; charset=UTF-8'], $response->getHeader('Content-Type')); - $url->setOption('query', ['_format' => static::$format]); - // DX: 404 when resource not provisioned. $response = $this->request('POST', $url, $request_options); $this->assertResourceErrorResponse(404, 'No route found for "POST ' . str_replace($this->baseUrl, '', $this->getEntityResourcePostUrl()->setAbsolute()->toString()) . '"', $response); - $this->provisionEntityResource(); // Simulate the developer again forgetting the ?_format query string. $url->setOption('query', []); - // DX: 415 when no Content-Type request header. HTML response because // missing ?_format query string. $response = $this->request('POST', $url, $request_options); @@ -742,34 +707,26 @@ public function testPost() { $this->assertSame(['text/html; charset=UTF-8'], $response->getHeader('Content-Type')); $this->assertContains('A client error happened', (string) $response->getBody()); - $url->setOption('query', ['_format' => static::$format]); - // DX: 415 when no Content-Type request header. $response = $this->request('POST', $url, $request_options); $this->assertResourceErrorResponse(415, 'No "Content-Type" request header specified', $response); - $request_options[RequestOptions::HEADERS]['Content-Type'] = static::$mimeType; - // DX: 400 when no request body. $response = $this->request('POST', $url, $request_options); $this->assertResourceErrorResponse(400, 'No entity content received.', $response); - $request_options[RequestOptions::BODY] = $unparseable_request_body; - // DX: 400 when unparseable request body. $response = $this->request('POST', $url, $request_options); $this->assertResourceErrorResponse(400, 'Syntax error', $response); - $request_options[RequestOptions::BODY] = $parseable_invalid_request_body; - if (static::$auth) { // DX: forgetting authentication: authentication provider-specific error // response. @@ -777,28 +734,22 @@ public function testPost() { $this->assertResponseWhenMissingAuthentication($response); } - $request_options = NestedArray::mergeDeep($request_options, $this->getAuthenticationRequestOptions('POST')); - // DX: 403 when unauthorized. $response = $this->request('POST', $url, $request_options); $this->assertResourceErrorResponse(403, $this->getExpectedUnauthorizedAccessMessage('POST'), $response); - $this->setUpAuthorization('POST'); - // DX: 422 when invalid entity: multiple values sent for single-value field. $response = $this->request('POST', $url, $request_options); $label_field = $this->entity->getEntityType()->hasKey('label') ? $this->entity->getEntityType()->getKey('label') : static::$labelFieldName; $label_field_capitalized = $this->entity->getFieldDefinition($label_field)->getLabel(); $this->assertResourceErrorResponse(422, "Unprocessable Entity: validation failed.\n$label_field: $label_field_capitalized: this field cannot hold more than 1 values.\n", $response); - $request_options[RequestOptions::BODY] = $parseable_invalid_request_body_2; - // DX: 422 when invalid entity: UUID field too long. // @todo Fix this in https://www.drupal.org/node/2149851. if ($this->entity->getEntityType()->hasKey('uuid')) { @@ -806,35 +757,27 @@ public function testPost() { $this->assertResourceErrorResponse(422, "Unprocessable Entity: validation failed.\nuuid.0.value: UUID: may not be longer than 128 characters.\n", $response); } - $request_options[RequestOptions::BODY] = $parseable_invalid_request_body_3; - // DX: 403 when entity contains field without 'edit' access. $response = $this->request('POST', $url, $request_options); $this->assertResourceErrorResponse(403, "Access denied on creating field 'field_rest_test'.", $response); - $request_options[RequestOptions::BODY] = $parseable_valid_request_body; - // Before sending a well-formed request, allow the normalization and // authentication provider edge cases to also be tested. $this->assertNormalizationEdgeCases('POST', $url, $request_options); $this->assertAuthenticationEdgeCases('POST', $url, $request_options); - $request_options[RequestOptions::HEADERS]['Content-Type'] = 'text/xml'; - // DX: 415 when request body in existing but not allowed format. $response = $this->request('POST', $url, $request_options); $this->assertResourceErrorResponse(415, 'No route found that matches "Content-Type: text/xml"', $response); - $request_options[RequestOptions::HEADERS]['Content-Type'] = static::$mimeType; - // 201 for well-formed request. $response = $this->request('POST', $url, $request_options); $this->assertResourceResponse(201, FALSE, $response); @@ -866,20 +809,16 @@ public function testPost() { } } - $this->config('rest.settings')->set('bc_entity_resource_permissions', TRUE)->save(TRUE); $this->refreshTestStateAfterRestConfigChange(); $request_options[RequestOptions::BODY] = $parseable_valid_request_body_2; - // DX: 403 when unauthorized. $response = $this->request('POST', $url, $request_options); $this->assertResourceErrorResponse(403, $this->getExpectedUnauthorizedAccessMessage('POST'), $response); - $this->grantPermissionsToTestedRole(['restful post entity:' . static::$entityTypeId]); - // 201 for well-formed request. // Delete the first created entity in case there is a uniqueness constraint. $this->entityStorage->load(static::$firstCreatedEntityId)->delete(); @@ -934,7 +873,6 @@ public function testPatch() { $url = $this->getEntityResourceUrl(); $request_options = []; - // DX: 404 when resource not provisioned, 405 if canonical route. Plain text // or HTML response because missing ?_format query string. $response = $this->request('PATCH', $url, $request_options); @@ -949,10 +887,8 @@ public function testPatch() { $this->assertSame(['text/html; charset=UTF-8'], $response->getHeader('Content-Type')); } - $url->setOption('query', ['_format' => static::$format]); - // DX: 404 when resource not provisioned, 405 if canonical route. $response = $this->request('PATCH', $url, $request_options); if ($has_canonical_url) { @@ -962,46 +898,36 @@ public function testPatch() { $this->assertResourceErrorResponse(404, 'No route found for "PATCH ' . str_replace($this->baseUrl, '', $this->getEntityResourceUrl()->setAbsolute()->toString()) . '"', $response); } - $this->provisionEntityResource(); // Simulate the developer again forgetting the ?_format query string. $url->setOption('query', []); - // DX: 415 when no Content-Type request header. $response = $this->request('PATCH', $url, $request_options); $this->assertSame(415, $response->getStatusCode()); $this->assertSame(['text/html; charset=UTF-8'], $response->getHeader('Content-Type')); $this->assertContains('A client error happened', (string) $response->getBody()); - $url->setOption('query', ['_format' => static::$format]); - // DX: 415 when no Content-Type request header. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceErrorResponse(415, 'No "Content-Type" request header specified', $response); - $request_options[RequestOptions::HEADERS]['Content-Type'] = static::$mimeType; - // DX: 400 when no request body. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceErrorResponse(400, 'No entity content received.', $response); - $request_options[RequestOptions::BODY] = $unparseable_request_body; - // DX: 400 when unparseable request body. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceErrorResponse(400, 'Syntax error', $response); - $request_options[RequestOptions::BODY] = $parseable_invalid_request_body; - if (static::$auth) { // DX: forgetting authentication: authentication provider-specific error // response. @@ -1009,33 +935,26 @@ public function testPatch() { $this->assertResponseWhenMissingAuthentication($response); } - $request_options = NestedArray::mergeDeep($request_options, $this->getAuthenticationRequestOptions('PATCH')); - // DX: 403 when unauthorized. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceErrorResponse(403, $this->getExpectedUnauthorizedAccessMessage('PATCH'), $response); - $this->setUpAuthorization('PATCH'); - // DX: 422 when invalid entity: multiple values sent for single-value field. $response = $this->request('PATCH', $url, $request_options); $label_field = $this->entity->getEntityType()->hasKey('label') ? $this->entity->getEntityType()->getKey('label') : static::$labelFieldName; $label_field_capitalized = $this->entity->getFieldDefinition($label_field)->getLabel(); $this->assertResourceErrorResponse(422, "Unprocessable Entity: validation failed.\n$label_field: $label_field_capitalized: this field cannot hold more than 1 values.\n", $response); - $request_options[RequestOptions::BODY] = $parseable_invalid_request_body_2; - // DX: 403 when entity contains field without 'edit' access. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceErrorResponse(403, "Access denied on updating field 'field_rest_test'.", $response); - // DX: 403 when sending PATCH request with read-only fields. // First send all fields (the "maximum normalization"). Assert the expected // error message for the first PATCH-protected field. Remove that field from @@ -1055,27 +974,21 @@ public function testPatch() { $response = $this->request('PATCH', $url, $request_options); $this->assertResourceResponse(200, FALSE, $response); - $request_options[RequestOptions::BODY] = $parseable_valid_request_body; - // Before sending a well-formed request, allow the normalization and // authentication provider edge cases to also be tested. $this->assertNormalizationEdgeCases('PATCH', $url, $request_options); $this->assertAuthenticationEdgeCases('PATCH', $url, $request_options); - $request_options[RequestOptions::HEADERS]['Content-Type'] = 'text/xml'; - // DX: 415 when request body in existing but not allowed format. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceErrorResponse(415, 'No route found that matches "Content-Type: text/xml"', $response); - $request_options[RequestOptions::HEADERS]['Content-Type'] = static::$mimeType; - // 200 for well-formed request. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceResponse(200, FALSE, $response); @@ -1100,20 +1013,16 @@ public function testPatch() { // is not sent in the PATCH request. $this->assertSame('All the faith he had had had had no effect on the outcome of his life.', $updated_entity->get('field_rest_test')->value); - $this->config('rest.settings')->set('bc_entity_resource_permissions', TRUE)->save(TRUE); $this->refreshTestStateAfterRestConfigChange(); $request_options[RequestOptions::BODY] = $parseable_valid_request_body_2; - // DX: 403 when unauthorized. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceErrorResponse(403, $this->getExpectedUnauthorizedAccessMessage('PATCH'), $response); - $this->grantPermissionsToTestedRole(['restful patch entity:' . static::$entityTypeId]); - // 200 for well-formed request. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceResponse(200, FALSE, $response); @@ -1141,7 +1050,6 @@ public function testDelete() { $url = $this->getEntityResourceUrl(); $request_options = []; - // DX: 404 when resource not provisioned, but 405 if canonical route. Plain // text or HTML response because missing ?_format query string. $response = $this->request('DELETE', $url, $request_options); @@ -1156,10 +1064,8 @@ public function testDelete() { $this->assertSame(['text/html; charset=UTF-8'], $response->getHeader('Content-Type')); } - $url->setOption('query', ['_format' => static::$format]); - // DX: 404 when resource not provisioned, 405 if canonical route. $response = $this->request('DELETE', $url, $request_options); if ($has_canonical_url) { @@ -1172,7 +1078,6 @@ public function testDelete() { $this->provisionEntityResource(); - if (static::$auth) { // DX: forgetting authentication: authentication provider-specific error // response. @@ -1180,23 +1085,18 @@ public function testDelete() { $this->assertResponseWhenMissingAuthentication($response); } - $request_options = NestedArray::mergeDeep($request_options, $this->getAuthenticationRequestOptions('PATCH')); - // DX: 403 when unauthorized. $response = $this->request('DELETE', $url, $request_options); $this->assertResourceErrorResponse(403, $this->getExpectedUnauthorizedAccessMessage('DELETE'), $response); - $this->setUpAuthorization('DELETE'); - // Before sending a well-formed request, allow the authentication provider's // edge cases to also be tested. $this->assertAuthenticationEdgeCases('DELETE', $url, $request_options); - // 204 for well-formed request. $response = $this->request('DELETE', $url, $request_options); $this->assertSame(204, $response->getStatusCode()); @@ -1208,21 +1108,17 @@ public function testDelete() { $this->assertSame('', (string) $response->getBody()); $this->assertFalse($response->hasHeader('X-Drupal-Cache')); - $this->config('rest.settings')->set('bc_entity_resource_permissions', TRUE)->save(TRUE); $this->refreshTestStateAfterRestConfigChange(); $this->entity = $this->createEntity(); $url = $this->getEntityResourceUrl()->setOption('query', $url->getOption('query')); - // DX: 403 when unauthorized. $response = $this->request('DELETE', $url, $request_options); $this->assertResourceErrorResponse(403, $this->getExpectedUnauthorizedAccessMessage('DELETE'), $response); - $this->grantPermissionsToTestedRole(['restful delete entity:' . static::$entityTypeId]); - // 204 for well-formed request. $response = $this->request('DELETE', $url, $request_options); $this->assertSame(204, $response->getStatusCode()); @@ -1249,17 +1145,14 @@ protected function assertNormalizationEdgeCases($method, Url $url, array $reques $normalization[$bundle_field_name] = 'bad_bundle_name'; $request_options[RequestOptions::BODY] = $this->serializer->encode($normalization, static::$format); - // DX: 422 when incorrect entity type bundle is specified. $response = $this->request($method, $url, $request_options); $this->assertResourceErrorResponse(422, '"bad_bundle_name" is not a valid bundle type for denormalization.', $response); } - unset($normalization[$bundle_field_name]); $request_options[RequestOptions::BODY] = $this->serializer->encode($normalization, static::$format); - // DX: 422 when no entity type bundle is specified. $response = $this->request($method, $url, $request_options); $this->assertResourceErrorResponse(422, sprintf('Could not determine entity type bundle: "%s" field is missing.', $bundle_field_name), $response); diff --git a/core/modules/rest/tests/src/Functional/EntityResource/User/UserResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/User/UserResourceTestBase.php index caf2909..d758cf6 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/User/UserResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/User/UserResourceTestBase.php @@ -144,7 +144,6 @@ public function testPatchDxForSecuritySensitiveBaseFields() { // @todo Remove the array_diff_key() call in https://www.drupal.org/node/2821077. $original_normalization = array_diff_key($this->serializer->normalize($user, static::$format), ['created' => TRUE, 'changed' => TRUE, 'name' => TRUE]); - // Since this test must be performed by the user that is being modified, // we cannot use $this->getUrl(). $url = $user->toUrl()->setOption('query', ['_format' => static::$format]); @@ -153,18 +152,15 @@ public function testPatchDxForSecuritySensitiveBaseFields() { ]; $request_options = array_merge_recursive($request_options, $this->getAuthenticationRequestOptions('PATCH')); - // Test case 1: changing email. $normalization = $original_normalization; $normalization['mail'] = [['value' => 'new-email@example.com']]; $request_options[RequestOptions::BODY] = $this->serializer->encode($normalization, static::$format); - // DX: 422 when changing email without providing the password. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceErrorResponse(422, "Unprocessable Entity: validation failed.\nmail: Your current password is missing or incorrect; it's required to change the Email.\n", $response); - $normalization['pass'] = [['existing' => 'wrong']]; $request_options[RequestOptions::BODY] = $this->serializer->encode($normalization, static::$format); @@ -172,41 +168,33 @@ public function testPatchDxForSecuritySensitiveBaseFields() { $response = $this->request('PATCH', $url, $request_options); $this->assertResourceErrorResponse(422, "Unprocessable Entity: validation failed.\nmail: Your current password is missing or incorrect; it's required to change the Email.\n", $response); - $normalization['pass'] = [['existing' => $this->account->passRaw]]; $request_options[RequestOptions::BODY] = $this->serializer->encode($normalization, static::$format); - // 200 for well-formed request. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceResponse(200, FALSE, $response); - // Test case 2: changing password. $normalization = $original_normalization; $new_password = $this->randomString(); $normalization['pass'] = [['value' => $new_password]]; $request_options[RequestOptions::BODY] = $this->serializer->encode($normalization, static::$format); - // DX: 422 when changing password without providing the current password. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceErrorResponse(422, "Unprocessable Entity: validation failed.\npass: Your current password is missing or incorrect; it's required to change the Password.\n", $response); - $normalization['pass'][0]['existing'] = $this->account->pass_raw; $request_options[RequestOptions::BODY] = $this->serializer->encode($normalization, static::$format); - // 200 for well-formed request. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceResponse(200, FALSE, $response); - // Verify that we can log in with the new password. $this->assertRpcLogin($user->getAccountName(), $new_password); - // Update password in $this->account, prepare for future requests. $this->account->passRaw = $new_password; $this->initAuthentication(); @@ -215,21 +203,17 @@ public function testPatchDxForSecuritySensitiveBaseFields() { ]; $request_options = array_merge_recursive($request_options, $this->getAuthenticationRequestOptions('PATCH')); - // Test case 3: changing name. $normalization = $original_normalization; $normalization['name'] = [['value' => 'Cooler Llama']]; $request_options[RequestOptions::BODY] = $this->serializer->encode($normalization, static::$format); - // DX: 403 when modifying username without required permission. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceErrorResponse(403, "Access denied on updating field 'name'.", $response); - $this->grantPermissionsToTestedRole(['change own username']); - // 200 for well-formed request. $response = $this->request('PATCH', $url, $request_options); $this->assertResourceResponse(200, FALSE, $response); diff --git a/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php b/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php index cb9fee2..f82b4de 100644 --- a/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php +++ b/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php @@ -124,7 +124,6 @@ public function testSerializerResponses() { $this->assertIdentical($actual_json, json_encode($expected), 'The expected JSON output was found.'); - // Test that the rendered output and the preview output are the same. $view->destroy(); $view->setDisplay('rest_export_1'); diff --git a/core/modules/search/src/SearchQuery.php b/core/modules/search/src/SearchQuery.php index dbd0534..faa30ab 100644 --- a/core/modules/search/src/SearchQuery.php +++ b/core/modules/search/src/SearchQuery.php @@ -571,7 +571,6 @@ public function execute() { } } - // Add arguments for the keyword relevance normalization number. $normalization = 1.0 / $this->normalize; for ($i = 0; $i < $this->relevance_count; $i++ ) { diff --git a/core/modules/search/src/Tests/SearchPageCacheTagsTest.php b/core/modules/search/src/Tests/SearchPageCacheTagsTest.php index 417d991..55adf97 100644 --- a/core/modules/search/src/Tests/SearchPageCacheTagsTest.php +++ b/core/modules/search/src/Tests/SearchPageCacheTagsTest.php @@ -122,7 +122,6 @@ public function testSearchTagsBubbling() { $this->container->get('module_installer')->install(['field_ui', 'entity_reference']); $this->resetAll(); - // Creates a new content type that will have an entity reference. $type_name = 'entity_reference_test'; $type = $this->drupalCreateContentType(['name' => $type_name, 'type' => $type_name]); diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/EntityReferenceFieldItemNormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/EntityReferenceFieldItemNormalizerTest.php index e0561a1..c2c6221 100644 --- a/core/modules/serialization/tests/src/Unit/Normalizer/EntityReferenceFieldItemNormalizerTest.php +++ b/core/modules/serialization/tests/src/Unit/Normalizer/EntityReferenceFieldItemNormalizerTest.php @@ -241,7 +241,6 @@ public function testDenormalizeWithTypeWithIncorrectUuid() { ->willReturn('field_reference') ->shouldBeCalled(); - $this->assertDenormalize($data); } @@ -261,7 +260,6 @@ public function testDenormalizeWithEmtpyUuid() { ->willReturn('field_reference') ->shouldBeCalled(); - $this->assertDenormalize($data); } diff --git a/core/modules/simpletest/src/KernelTestBase.php b/core/modules/simpletest/src/KernelTestBase.php index b133bfb..27b01f1 100644 --- a/core/modules/simpletest/src/KernelTestBase.php +++ b/core/modules/simpletest/src/KernelTestBase.php @@ -201,7 +201,6 @@ protected function setUp() { $this->kernel->shutdown(); $this->kernel->boot(); - // Save the original site directory path, so that extensions in the // site-specific directory can still be discovered in the test site // environment. diff --git a/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php b/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php index 7f5c5e3..d215df5 100644 --- a/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php +++ b/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php @@ -415,7 +415,6 @@ public function testReferencedEntity() { $cid = $this->createCacheId($cache_keys, $entity_cache_contexts); $this->verifyRenderCache($cid, $non_referencing_entity_cache_tags); - $this->pass("Test listing of referencing entities.", 'Debug'); // Prime the page cache for the listing of referencing entities. $this->verifyPageCache($listing_url, 'MISS'); @@ -434,7 +433,6 @@ public function testReferencedEntity() { $contexts_in_header = $this->drupalGetHeader('X-Drupal-Cache-Contexts'); $this->assertEqual(Cache::mergeContexts($page_cache_contexts, $this->getAdditionalCacheContextsForEntityListing()), empty($contexts_in_header) ? [] : explode(' ', $contexts_in_header)); - $this->pass("Test listing containing referenced entity.", 'Debug'); // Prime the page cache for the listing containing the referenced entity. $this->verifyPageCache($nonempty_entity_listing_url, 'MISS', $nonempty_entity_listing_cache_tags); @@ -444,7 +442,6 @@ public function testReferencedEntity() { $contexts_in_header = $this->drupalGetHeader('X-Drupal-Cache-Contexts'); $this->assertEqual(Cache::mergeContexts($page_cache_contexts, $this->getAdditionalCacheContextsForEntityListing()), empty($contexts_in_header) ? [] : explode(' ', $contexts_in_header)); - // Verify that after modifying the referenced entity, there is a cache miss // for every route except the one for the non-referencing entity. $this->pass("Test modification of referenced entity.", 'Debug'); @@ -461,7 +458,6 @@ public function testReferencedEntity() { $this->verifyPageCache($empty_entity_listing_url, 'HIT'); $this->verifyPageCache($nonempty_entity_listing_url, 'HIT'); - // Verify that after modifying the referencing entity, there is a cache miss // for every route except the ones for the non-referencing entity and the // empty entity listing. @@ -478,7 +474,6 @@ public function testReferencedEntity() { $this->verifyPageCache($listing_url, 'HIT'); $this->verifyPageCache($nonempty_entity_listing_url, 'HIT'); - // Verify that after modifying the non-referencing entity, there is a cache // miss only for the non-referencing entity route. $this->pass("Test modification of non-referencing entity.", 'Debug'); @@ -492,7 +487,6 @@ public function testReferencedEntity() { // Verify cache hits. $this->verifyPageCache($non_referencing_entity_url, 'HIT'); - if ($this->entity->getEntityType()->hasHandlerClass('view_builder')) { // Verify that after modifying the entity's display, there is a cache miss // for both the referencing entity, and the listing of referencing @@ -512,7 +506,6 @@ public function testReferencedEntity() { $this->verifyPageCache($listing_url, 'HIT'); } - if ($bundle_entity_type_id = $this->entity->getEntityType()->getBundleEntityType()) { // Verify that after modifying the corresponding bundle entity, there is a // cache miss for both the referencing entity, and the listing of @@ -546,7 +539,6 @@ public function testReferencedEntity() { } } - if ($this->entity->getEntityType()->get('field_ui_base_route')) { // Verify that after modifying a configurable field on the entity, there // is a cache miss. @@ -564,7 +556,6 @@ public function testReferencedEntity() { $this->verifyPageCache($referencing_entity_url, 'HIT'); $this->verifyPageCache($listing_url, 'HIT'); - // Verify that after modifying a configurable field on the entity, there // is a cache miss. $this->pass("Test modification of referenced entity's configurable field.", 'Debug'); @@ -582,7 +573,6 @@ public function testReferencedEntity() { $this->verifyPageCache($listing_url, 'HIT'); } - // Verify that after invalidating the entity's cache tag directly, there is // a cache miss for every route except the ones for the non-referencing // entity and the empty entity listing. @@ -614,7 +604,6 @@ public function testReferencedEntity() { $this->verifyPageCache($empty_entity_listing_url, 'HIT'); $this->verifyPageCache($nonempty_entity_listing_url, 'HIT'); - if (!empty($view_cache_tag)) { // Verify that after invalidating the generic entity type's view cache tag // directly, there is a cache miss for both the referencing entity, and the diff --git a/core/modules/system/src/Tests/Entity/EntityWithUriCacheTagsTestBase.php b/core/modules/system/src/Tests/Entity/EntityWithUriCacheTagsTestBase.php index 74c1103..997a4d2 100644 --- a/core/modules/system/src/Tests/Entity/EntityWithUriCacheTagsTestBase.php +++ b/core/modules/system/src/Tests/Entity/EntityWithUriCacheTagsTestBase.php @@ -34,7 +34,6 @@ public function testEntityUri() { $view_cache_tag = \Drupal::entityManager()->getViewBuilder($entity_type)->getCacheTags(); $render_cache_tag = 'rendered'; - $this->pass("Test entity.", 'Debug'); $this->verifyPageCache($entity_url, 'MISS'); @@ -65,7 +64,6 @@ public function testEntityUri() { // Verify a cache hit. $this->verifyPageCache($entity_url, 'HIT'); - // Verify that after modifying the entity's display, there is a cache miss. $this->pass("Test modification of entity's '$view_mode' display.", 'Debug'); $entity_display = entity_get_display($entity_type, $this->entity->bundle(), $view_mode); @@ -75,7 +73,6 @@ public function testEntityUri() { // Verify a cache hit. $this->verifyPageCache($entity_url, 'HIT'); - if ($bundle_entity_type_id = $this->entity->getEntityType()->getBundleEntityType()) { // Verify that after modifying the corresponding bundle entity, there is a // cache miss. @@ -90,7 +87,6 @@ public function testEntityUri() { $this->verifyPageCache($entity_url, 'HIT'); } - if ($this->entity->getEntityType()->get('field_ui_base_route')) { // Verify that after modifying a configurable field on the entity, there // is a cache miss. @@ -115,7 +111,6 @@ public function testEntityUri() { $this->verifyPageCache($entity_url, 'HIT'); } - // Verify that after invalidating the entity's cache tag directly, there is // a cache miss. $this->pass("Test invalidation of entity's cache tag.", 'Debug'); @@ -125,7 +120,6 @@ public function testEntityUri() { // Verify a cache hit. $this->verifyPageCache($entity_url, 'HIT'); - // Verify that after invalidating the generic entity type's view cache tag // directly, there is a cache miss. $this->pass("Test invalidation of entity's 'view' cache tag.", 'Debug'); @@ -135,7 +129,6 @@ public function testEntityUri() { // Verify a cache hit. $this->verifyPageCache($entity_url, 'HIT'); - // Verify that after deleting the entity, there is a cache miss. $this->pass('Test deletion of entity.', 'Debug'); $this->entity->delete(); diff --git a/core/modules/system/src/Tests/Routing/RouterTest.php b/core/modules/system/src/Tests/Routing/RouterTest.php index 38d7ecb..83a9c55 100644 --- a/core/modules/system/src/Tests/Routing/RouterTest.php +++ b/core/modules/system/src/Tests/Routing/RouterTest.php @@ -53,7 +53,6 @@ public function testFinishResponseSubscriber() { // a page inception style. This test verifies that is not happening. $this->assertNoPattern('#.*#s', 'There was no double-page effect from a misrendered subrequest.'); - // Confirm that route-level access check's cacheability is applied to the // X-Drupal-Cache-Contexts and X-Drupal-Cache-Tags headers. // 1. controller result: render array, globally cacheable route access. diff --git a/core/modules/system/src/Tests/System/UncaughtExceptionTest.php b/core/modules/system/src/Tests/System/UncaughtExceptionTest.php index b66837e..c42cd62 100644 --- a/core/modules/system/src/Tests/System/UncaughtExceptionTest.php +++ b/core/modules/system/src/Tests/System/UncaughtExceptionTest.php @@ -200,7 +200,6 @@ public function testExceptionContainer() { $this->drupalGet(''); $this->assertResponse(500); - $this->assertRaw('The website encountered an unexpected error'); $this->assertRaw($this->expectedExceptionMessage); $this->assertErrorLogged($this->expectedExceptionMessage); diff --git a/core/modules/system/src/Tests/Theme/EngineTwigTest.php b/core/modules/system/src/Tests/Theme/EngineTwigTest.php index ffff75f..2ca831c 100644 --- a/core/modules/system/src/Tests/Theme/EngineTwigTest.php +++ b/core/modules/system/src/Tests/Theme/EngineTwigTest.php @@ -76,7 +76,6 @@ public function testTwigLinkGenerator() { /** @var \Drupal\Core\Utility\LinkGenerator $link_generator */ $link_generator = $this->container->get('link_generator'); - $generated_url = Url::fromRoute('user.register', [], ['absolute' => TRUE])->toString(TRUE)->getGeneratedUrl(); $expected = [ 'link via the linkgenerator: ' . $link_generator->generate('register', new Url('user.register', [], ['absolute' => TRUE])), diff --git a/core/modules/system/system.module b/core/modules/system/system.module index bde0346..fee09b1 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -1056,7 +1056,6 @@ function _system_rebuild_module_data() { _system_rebuild_module_data_ensure_required($module, $modules); } - if ($profile && isset($modules[$profile])) { // The installation profile is required, if it's a valid module. $modules[$profile]->info['required'] = TRUE; diff --git a/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestCommandsForm.php b/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestCommandsForm.php index e3c09af..d69b416 100644 --- a/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestCommandsForm.php +++ b/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestCommandsForm.php @@ -52,7 +52,6 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#suffix' => '
    Append inside this div
    ', ]; - // Shows the 'before' command. $form['before_command_example'] = [ '#value' => $this->t("AJAX 'before': Click to put something before the div"), @@ -91,7 +90,6 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#suffix' => '
    box
    ', ]; - // Shows the Ajax 'data' command. But there is no use of this information, // as this would require a javascript client to use the data. $form['data_command_example'] = [ diff --git a/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestSimpleForm.php b/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestSimpleForm.php index f69a123..414bc4f 100644 --- a/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestSimpleForm.php +++ b/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestSimpleForm.php @@ -108,7 +108,6 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#title' => $this->t('Another AJAX checkbox in a nested group'), ]; - return $form; } diff --git a/core/modules/system/tests/modules/dialog_renderer_test/src/Render/MainContent/WideModalRenderer.php b/core/modules/system/tests/modules/dialog_renderer_test/src/Render/MainContent/WideModalRenderer.php index 3ca7715..2fd9828 100644 --- a/core/modules/system/tests/modules/dialog_renderer_test/src/Render/MainContent/WideModalRenderer.php +++ b/core/modules/system/tests/modules/dialog_renderer_test/src/Render/MainContent/WideModalRenderer.php @@ -70,7 +70,6 @@ public function renderResponse(array $main_content, Request $request, RouteMatch break; } - $response->addCommand(new OpenModalDialogCommand($title, $content, $options)); return $response; } diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestDisabledElementsForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestDisabledElementsForm.php index 56e6d2e..7d482a4 100644 --- a/core/modules/system/tests/modules/form_test/src/Form/FormTestDisabledElementsForm.php +++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestDisabledElementsForm.php @@ -146,7 +146,6 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#date_timezone' => 'Europe/Berlin', ]; - // Try to hijack the email field with a valid email. $form['disabled_container']['disabled_container_email'] = [ '#type' => 'email', diff --git a/core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php b/core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php index 1476dfa..aa9452a 100644 --- a/core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php +++ b/core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php @@ -412,7 +412,6 @@ public function testReferencedEntity() { $cid = $this->createCacheId($cache_keys, $entity_cache_contexts); $this->verifyRenderCache($cid, $non_referencing_entity_cache_tags); - $this->pass("Test listing of referencing entities.", 'Debug'); // Prime the page cache for the listing of referencing entities. $this->verifyPageCache($listing_url, 'MISS'); @@ -431,7 +430,6 @@ public function testReferencedEntity() { $contexts_in_header = $this->drupalGetHeader('X-Drupal-Cache-Contexts'); $this->assertEqual(Cache::mergeContexts($page_cache_contexts, $this->getAdditionalCacheContextsForEntityListing()), empty($contexts_in_header) ? [] : explode(' ', $contexts_in_header)); - $this->pass("Test listing containing referenced entity.", 'Debug'); // Prime the page cache for the listing containing the referenced entity. $this->verifyPageCache($nonempty_entity_listing_url, 'MISS', $nonempty_entity_listing_cache_tags); @@ -441,7 +439,6 @@ public function testReferencedEntity() { $contexts_in_header = $this->drupalGetHeader('X-Drupal-Cache-Contexts'); $this->assertEqual(Cache::mergeContexts($page_cache_contexts, $this->getAdditionalCacheContextsForEntityListing()), empty($contexts_in_header) ? [] : explode(' ', $contexts_in_header)); - // Verify that after modifying the referenced entity, there is a cache miss // for every route except the one for the non-referencing entity. $this->pass("Test modification of referenced entity.", 'Debug'); @@ -458,7 +455,6 @@ public function testReferencedEntity() { $this->verifyPageCache($empty_entity_listing_url, 'HIT'); $this->verifyPageCache($nonempty_entity_listing_url, 'HIT'); - // Verify that after modifying the referencing entity, there is a cache miss // for every route except the ones for the non-referencing entity and the // empty entity listing. @@ -475,7 +471,6 @@ public function testReferencedEntity() { $this->verifyPageCache($listing_url, 'HIT'); $this->verifyPageCache($nonempty_entity_listing_url, 'HIT'); - // Verify that after modifying the non-referencing entity, there is a cache // miss only for the non-referencing entity route. $this->pass("Test modification of non-referencing entity.", 'Debug'); @@ -489,7 +484,6 @@ public function testReferencedEntity() { // Verify cache hits. $this->verifyPageCache($non_referencing_entity_url, 'HIT'); - if ($this->entity->getEntityType()->hasHandlerClass('view_builder')) { // Verify that after modifying the entity's display, there is a cache miss // for both the referencing entity, and the listing of referencing @@ -509,7 +503,6 @@ public function testReferencedEntity() { $this->verifyPageCache($listing_url, 'HIT'); } - if ($bundle_entity_type_id = $this->entity->getEntityType()->getBundleEntityType()) { // Verify that after modifying the corresponding bundle entity, there is a // cache miss for both the referencing entity, and the listing of @@ -543,7 +536,6 @@ public function testReferencedEntity() { } } - if ($this->entity->getEntityType()->get('field_ui_base_route')) { // Verify that after modifying a configurable field on the entity, there // is a cache miss. @@ -561,7 +553,6 @@ public function testReferencedEntity() { $this->verifyPageCache($referencing_entity_url, 'HIT'); $this->verifyPageCache($listing_url, 'HIT'); - // Verify that after modifying a configurable field on the entity, there // is a cache miss. $this->pass("Test modification of referenced entity's configurable field.", 'Debug'); @@ -579,7 +570,6 @@ public function testReferencedEntity() { $this->verifyPageCache($listing_url, 'HIT'); } - // Verify that after invalidating the entity's cache tag directly, there is // a cache miss for every route except the ones for the non-referencing // entity and the empty entity listing. @@ -611,7 +601,6 @@ public function testReferencedEntity() { $this->verifyPageCache($empty_entity_listing_url, 'HIT'); $this->verifyPageCache($nonempty_entity_listing_url, 'HIT'); - if (!empty($view_cache_tag)) { // Verify that after invalidating the generic entity type's view cache tag // directly, there is a cache miss for both the referencing entity, and the diff --git a/core/modules/system/tests/src/Functional/Entity/Update/MoveRevisionMetadataFieldsUpdateTest.php b/core/modules/system/tests/src/Functional/Entity/Update/MoveRevisionMetadataFieldsUpdateTest.php index c843c83..8634b16 100644 --- a/core/modules/system/tests/src/Functional/Entity/Update/MoveRevisionMetadataFieldsUpdateTest.php +++ b/core/modules/system/tests/src/Functional/Entity/Update/MoveRevisionMetadataFieldsUpdateTest.php @@ -65,7 +65,6 @@ public function testSystemUpdate8400() { $this->assertEqual($entity_rev_second->getRevisionLogMessage(), 'second revision'); $this->assertEqual($entity_rev_second->getRevisionCreationTime(), '1476268518'); - // Test that the views using revision metadata fields are updated // properly. $view = View::load($entity_type_id . '_for_2248983'); diff --git a/core/modules/system/tests/src/Functional/Form/RedirectTest.php b/core/modules/system/tests/src/Functional/Form/RedirectTest.php index a4c9e15..62253a6 100644 --- a/core/modules/system/tests/src/Functional/Form/RedirectTest.php +++ b/core/modules/system/tests/src/Functional/Form/RedirectTest.php @@ -34,7 +34,6 @@ public function testRedirect() { $this->drupalPostForm($path, $edit, t('Submit')); $this->assertUrl($edit['destination'], [], 'Basic redirection works.'); - // Test without redirection. $edit = [ 'redirection' => FALSE, diff --git a/core/modules/system/tests/src/Functional/Update/EntityUpdateToRevisionableAndPublishableTest.php b/core/modules/system/tests/src/Functional/Update/EntityUpdateToRevisionableAndPublishableTest.php index eb4a01c..e72f9f1 100644 --- a/core/modules/system/tests/src/Functional/Update/EntityUpdateToRevisionableAndPublishableTest.php +++ b/core/modules/system/tests/src/Functional/Update/EntityUpdateToRevisionableAndPublishableTest.php @@ -165,7 +165,6 @@ protected function updateEntityTypeDefinition() { ]; $entity_type->set('revision_metadata_keys', $revision_metadata_keys); - $entity_type->set('translatable', TRUE); $entity_type->set('data_table', 'entity_test_update_data'); $entity_type->set('revision_table', 'entity_test_update_revision'); diff --git a/core/modules/system/tests/src/Kernel/Token/TokenReplaceKernelTest.php b/core/modules/system/tests/src/Kernel/Token/TokenReplaceKernelTest.php index b334e64..9e878f5 100644 --- a/core/modules/system/tests/src/Kernel/Token/TokenReplaceKernelTest.php +++ b/core/modules/system/tests/src/Kernel/Token/TokenReplaceKernelTest.php @@ -96,7 +96,6 @@ public function testSystemSiteTokenReplacement() { ->set('mail', 'simpletest@example.com') ->save(); - // Generate and test tokens. $tests = []; $tests['[site:name]'] = Html::escape($config->get('name')); diff --git a/core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php b/core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php index c2014d5..aae8704 100644 --- a/core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php +++ b/core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php @@ -182,7 +182,6 @@ public function providerTestBuildCacheability() { ], ]; - $data = []; // Empty tree. diff --git a/core/modules/taxonomy/tests/src/Functional/Views/ArgumentValidatorTermTest.php b/core/modules/taxonomy/tests/src/Functional/Views/ArgumentValidatorTermTest.php index a7ac9b8..8260565 100644 --- a/core/modules/taxonomy/tests/src/Functional/Views/ArgumentValidatorTermTest.php +++ b/core/modules/taxonomy/tests/src/Functional/Views/ArgumentValidatorTermTest.php @@ -65,7 +65,6 @@ public function testArgumentValidatorTerm() { $view = Views::getView('test_argument_validator_term'); $view->initHandlers(); - // Test the single validator for term IDs. $view->argument['tid']->validator->options['type'] = 'tid'; @@ -83,7 +82,6 @@ public function testArgumentValidatorTerm() { $view->argument['tid']->validated_title = NULL; $view->argument['tid']->argument_validated = NULL; - // Test the multiple validator for term IDs. $view->argument['tid']->validator->options['type'] = 'tids'; $view->argument['tid']->options['break_phrase'] = TRUE; diff --git a/core/modules/user/tests/src/Kernel/UserEntityReferenceTest.php b/core/modules/user/tests/src/Kernel/UserEntityReferenceTest.php index 159a699..3ad8e7b 100644 --- a/core/modules/user/tests/src/Kernel/UserEntityReferenceTest.php +++ b/core/modules/user/tests/src/Kernel/UserEntityReferenceTest.php @@ -77,7 +77,6 @@ public function testUserSelectionByRole() { $user3->addRole($this->role2->id()); $user3->save(); - /** @var \Drupal\Core\Entity\EntityAutocompleteMatcher $autocomplete */ $autocomplete = \Drupal::service('entity.autocomplete_matcher'); diff --git a/core/modules/views/src/Element/View.php b/core/modules/views/src/Element/View.php index 43d1058..6cc87e5 100644 --- a/core/modules/views/src/Element/View.php +++ b/core/modules/views/src/Element/View.php @@ -53,7 +53,6 @@ public static function preRenderViewElement($element) { // possible to manipulate the $element. $view->element['#pre_rendered'] = TRUE; - if (isset($element['#response'])) { $view->setResponse($element['#response']); } diff --git a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php index 8c29657..3475f81 100644 --- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php @@ -164,7 +164,6 @@ public function initDisplay(ViewExecutable $view, array &$display, array &$optio } } - $this->setOptionDefaults($this->options, $this->defineOptions()); $this->display = &$display; diff --git a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php index fb6b5bf..c700237 100644 --- a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php +++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php @@ -857,7 +857,6 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { ], ]; - // Get a list of the available fields and arguments for token replacement. // Setup the tokens for fields. diff --git a/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php b/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php index a036e15..63330af 100644 --- a/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php +++ b/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php @@ -104,7 +104,6 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o $this->options['expose']['multiple'] = TRUE; } - // If there are relationships in the view, allow empty should be true // so that we can do IS NULL checks on items. Not all filters respect // allow empty, but string and numeric do and that covers enough. diff --git a/core/modules/views/src/Plugin/views/pager/SqlBase.php b/core/modules/views/src/Plugin/views/pager/SqlBase.php index 55e07df..d683202 100644 --- a/core/modules/views/src/Plugin/views/pager/SqlBase.php +++ b/core/modules/views/src/Plugin/views/pager/SqlBase.php @@ -132,7 +132,6 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { ], ]; - $form['expose']['items_per_page_options_all'] = [ '#type' => 'checkbox', '#title' => $this->t('Allow user to display all items'), diff --git a/core/modules/views/src/Plugin/views/relationship/EntityReverse.php b/core/modules/views/src/Plugin/views/relationship/EntityReverse.php index 7c01604..568bcd2 100644 --- a/core/modules/views/src/Plugin/views/relationship/EntityReverse.php +++ b/core/modules/views/src/Plugin/views/relationship/EntityReverse.php @@ -71,7 +71,6 @@ public function query() { } $first_join = $this->joinManager->createInstance($id, $first); - $this->first_alias = $this->query->addTable($this->definition['field table'], $this->relationship, $first_join); // Second, relate the field table to the entity specified using diff --git a/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php b/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php index 6238914..34e1b08 100644 --- a/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php +++ b/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php @@ -115,7 +115,6 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { '#default_value' => $this->options['subquery_namespace'], ]; - // WIP: This stuff doesn't work yet: namespacing issues. // A list of suitable views to pick one as the subview. $views = ['' => '- None -']; diff --git a/core/modules/views/src/ViewExecutable.php b/core/modules/views/src/ViewExecutable.php index b8e7346..5996e87 100644 --- a/core/modules/views/src/ViewExecutable.php +++ b/core/modules/views/src/ViewExecutable.php @@ -619,7 +619,6 @@ public function setOffset($offset) { $this->offset = $offset; - // If the pager is already initialized, pass it through to the pager. if (!empty($this->pager)) { $this->pager->setOffset($offset); diff --git a/core/modules/views/tests/src/Functional/Plugin/StyleTest.php b/core/modules/views/tests/src/Functional/Plugin/StyleTest.php index fbb5bcf..1686d53 100644 --- a/core/modules/views/tests/src/Functional/Plugin/StyleTest.php +++ b/core/modules/views/tests/src/Functional/Plugin/StyleTest.php @@ -173,7 +173,6 @@ public function _testGrouping($stripped = FALSE) { $expected['Job: Drummer']['rows']['Age: 28']['rows'][2]->views_test_data_age = '28'; $expected['Job: Drummer']['rows']['Age: 28']['rows'][2]->views_test_data_id = '3'; - // Alter the results to support the stripped case. if ($stripped) { @@ -194,7 +193,6 @@ public function _testGrouping($stripped = FALSE) { $view->style_plugin->options['grouping'][1] = ['field' => 'age', 'rendered' => TRUE, 'rendered_strip' => TRUE]; } - // The newer api passes the value of the grouping as well. $sets_new_rendered = $view->style_plugin->renderGrouping($view->result, $view->style_plugin->options['grouping'], TRUE); diff --git a/core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php b/core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php index a2bec23..51d2414 100644 --- a/core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php +++ b/core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php @@ -98,7 +98,6 @@ protected function assertCacheTagsForFieldBasedView($do_assert_views_caches) { $this->assertViewsCacheTags($view, $base_tags, $do_assert_views_caches, $base_tags); $this->assertViewsCacheTagsFromStaticRenderArray($view, $base_tags, $do_assert_views_caches); - // Non-empty result (1 entity). /** @var \Drupal\Core\Entity\EntityInterface[] $entities */ $entities[] = $entity = EntityTest::create(); @@ -109,7 +108,6 @@ protected function assertCacheTagsForFieldBasedView($do_assert_views_caches) { $this->assertViewsCacheTags($view, $tags_with_entity, $do_assert_views_caches, $tags_with_entity); $this->assertViewsCacheTagsFromStaticRenderArray($view, $tags_with_entity, $do_assert_views_caches); - // Paged result (more entities than the items-per-page limit). for ($i = 0; $i < 5; $i++) { $entities[] = $entity = EntityTest::create(); @@ -259,7 +257,6 @@ protected function assertCacheTagsForEntityBasedView($do_assert_views_caches) { $this->assertViewsCacheTags($view, $result_tags_with_entity, $do_assert_views_caches, $render_tags_with_entity); $this->assertViewsCacheTagsFromStaticRenderArray($view, $render_tags_with_entity, $do_assert_views_caches); - // Paged result (more entities than the items-per-page limit). for ($i = 0; $i < 5; $i++) { $entities[] = $entity = EntityTest::create(); diff --git a/core/modules/views/tests/src/Unit/Plugin/area/EntityTest.php b/core/modules/views/tests/src/Unit/Plugin/area/EntityTest.php index 556aef9..64e2777 100644 --- a/core/modules/views/tests/src/Unit/Plugin/area/EntityTest.php +++ b/core/modules/views/tests/src/Unit/Plugin/area/EntityTest.php @@ -92,7 +92,6 @@ protected function setUp() { ->method('getStyle') ->willReturn($this->stylePlugin); - $token = $this->getMockBuilder('Drupal\Core\Utility\Token') ->disableOriginalConstructor() ->getMock(); diff --git a/core/modules/views/tests/src/Unit/Plugin/area/ViewTest.php b/core/modules/views/tests/src/Unit/Plugin/area/ViewTest.php index 91d5282..98a1554 100644 --- a/core/modules/views/tests/src/Unit/Plugin/area/ViewTest.php +++ b/core/modules/views/tests/src/Unit/Plugin/area/ViewTest.php @@ -58,7 +58,6 @@ public function testCalculateDependencies() { ]); $this->viewHandler->view->storage = $view_this; - $this->viewHandler->options['view_to_insert'] = 'other:default'; $this->assertArrayEquals(['config' => ['view.other']], $this->viewHandler->calculateDependencies()); diff --git a/core/modules/views/tests/src/Unit/Plugin/argument_validator/EntityTest.php b/core/modules/views/tests/src/Unit/Plugin/argument_validator/EntityTest.php index 13a7bc9..b398dde 100644 --- a/core/modules/views/tests/src/Unit/Plugin/argument_validator/EntityTest.php +++ b/core/modules/views/tests/src/Unit/Plugin/argument_validator/EntityTest.php @@ -71,7 +71,6 @@ protected function setUp() { ['test_op_3', NULL, FALSE, TRUE], ])); - $storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface'); // Setup values for IDs passed as strings or numbers. diff --git a/core/modules/views/tests/src/Unit/ViewsDataTest.php b/core/modules/views/tests/src/Unit/ViewsDataTest.php index a145538..18d6b7a 100644 --- a/core/modules/views/tests/src/Unit/ViewsDataTest.php +++ b/core/modules/views/tests/src/Unit/ViewsDataTest.php @@ -236,7 +236,6 @@ public function testFullAndTableGetCache() { ->method('alter') ->with('views_data', $expected_views_data); - // The cache should only be called once (before the clear() call) as get // will get all table data in the first get(). $this->cacheBackend->expects($this->at(0)) diff --git a/core/modules/views/views.views.inc b/core/modules/views/views.views.inc index ed6fa07..fca5ee3 100644 --- a/core/modules/views/views.views.inc +++ b/core/modules/views/views.views.inc @@ -171,7 +171,6 @@ function views_views_data() { } } - // Field modules can implement hook_field_views_data() to override the default // behavior for adding fields. $module_handler = \Drupal::moduleHandler(); diff --git a/core/modules/views_ui/src/ViewEditForm.php b/core/modules/views_ui/src/ViewEditForm.php index 7066476..ca3a4d3 100644 --- a/core/modules/views_ui/src/ViewEditForm.php +++ b/core/modules/views_ui/src/ViewEditForm.php @@ -162,7 +162,6 @@ public function form(array $form, FormStateInterface $form_state) { ], ]; - $form['displays']['top'] = $this->renderDisplayTop($view); // The rest requires a display to be selected. diff --git a/core/modules/views_ui/tests/src/Kernel/TagTest.php b/core/modules/views_ui/tests/src/Kernel/TagTest.php index e63bf22..44d3417 100644 --- a/core/modules/views_ui/tests/src/Kernel/TagTest.php +++ b/core/modules/views_ui/tests/src/Kernel/TagTest.php @@ -52,7 +52,6 @@ public function testViewsUiAutocompleteTag() { $this->assertTrue(in_array($match, $suggestions), 'Make sure the returned array has the proper format.'); } - // Make sure that matching by a certain prefix works. $request->query->set('q', 'autocomplete_tag_test_even'); $result = $controller->autocompleteTag($request); diff --git a/core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php b/core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php index 23cc7a8..b4a3df0 100644 --- a/core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php +++ b/core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php @@ -75,7 +75,6 @@ public function testBuildRowEntityList() { ], ])); - $default_display = $this->getMock('Drupal\views\Plugin\views\display\DefaultDisplay', ['initDisplay'], [[], 'default', $display_manager->getDefinition('default')] diff --git a/core/phpcs.xml.dist b/core/phpcs.xml.dist index f992e69..5d46912 100644 --- a/core/phpcs.xml.dist +++ b/core/phpcs.xml.dist @@ -163,6 +163,7 @@ + diff --git a/core/tests/Drupal/KernelTests/Core/Bootstrap/GetFilenameTest.php b/core/tests/Drupal/KernelTests/Core/Bootstrap/GetFilenameTest.php index 4c54487..b070b1c 100644 --- a/core/tests/Drupal/KernelTests/Core/Bootstrap/GetFilenameTest.php +++ b/core/tests/Drupal/KernelTests/Core/Bootstrap/GetFilenameTest.php @@ -49,7 +49,6 @@ public function testDrupalGetFilename() { // a fixed location and naming. $this->assertIdentical(drupal_get_filename('profile', 'testing'), 'core/profiles/testing/testing.info.yml'); - // Generate a non-existing module name. $non_existing_module = uniqid("", TRUE); diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php index b3dab6d..8bfcd8b 100644 --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php @@ -211,7 +211,6 @@ public function testSchemaMapping() { $expected['mapping']['upscale']['label'] = 'Upscale'; $expected['type'] = 'image.effect.image_scale'; - $this->assertEqual($definition, $expected, 'Retrieved the right metadata for image.effect.image_scale'); // Most complex case, get metadata for actual configuration element. diff --git a/core/tests/Drupal/KernelTests/Core/Database/SelectTest.php b/core/tests/Drupal/KernelTests/Core/Database/SelectTest.php index 0d332d0..5df355a 100644 --- a/core/tests/Drupal/KernelTests/Core/Database/SelectTest.php +++ b/core/tests/Drupal/KernelTests/Core/Database/SelectTest.php @@ -466,7 +466,6 @@ public function testRegexCondition() { ], ]; - $database = $this->container->get('database'); foreach ($test_groups as $test_group) { $query = $database->select('test', 't'); diff --git a/core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php b/core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php index 56050a7..78c7a5d 100644 --- a/core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php +++ b/core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php @@ -635,7 +635,6 @@ public function testLookupKeys() { $entity->enforceIsNew(); $entity->save(); - $expected[] = $entity->getConfigDependencyName(); $this->assertEqual($expected, $key_value->get('style:test')); diff --git a/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityCloneTest.php b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityCloneTest.php index 0f77535..7faa8b8 100644 --- a/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityCloneTest.php +++ b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityCloneTest.php @@ -131,7 +131,6 @@ public function testClonedEntityFields() { } $this->assertTrue($different_references, 'The entity object and the cloned entity object reference different field item list objects.'); - // Reload the entity, initialize one translation, clone it and check that // both entity objects reference different field instances. $entity = $this->reloadEntity($entity); diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayFormBaseTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayFormBaseTest.php index 11aeede..179c63e 100644 --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayFormBaseTest.php +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayFormBaseTest.php @@ -63,7 +63,6 @@ public function testCopyFormValuesToEntity() { ]) ->shouldBeCalled(); - // An initially visible field, with a submitted region change. $entity->getComponent('field_start_visible_change_region') ->willReturn([ diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php index 0430369..aa37970 100644 --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php @@ -802,7 +802,6 @@ public function testCaseSensitivity() { )->execute(); $this->assertIdentical(count($result), 1, 'Case sensitive, exact match.'); - // Check the case insensitive field, ENDS_WITH operator. $result = \Drupal::entityQuery('entity_test_mulrev')->condition( 'field_ci', $fixtures[1]['lowercase'], 'ENDS_WITH' @@ -825,7 +824,6 @@ public function testCaseSensitivity() { )->execute(); $this->assertIdentical(count($result), 0, 'Case sensitive, exact match.'); - // Check the case insensitive field, CONTAINS operator, use the inner 8 // characters of the uppercase and lowercase strings. $result = \Drupal::entityQuery('entity_test_mulrev')->condition( diff --git a/core/tests/Drupal/KernelTests/Core/KeyValueStore/GarbageCollectionTest.php b/core/tests/Drupal/KernelTests/Core/KeyValueStore/GarbageCollectionTest.php index e0badd8..eb6c67e 100644 --- a/core/tests/Drupal/KernelTests/Core/KeyValueStore/GarbageCollectionTest.php +++ b/core/tests/Drupal/KernelTests/Core/KeyValueStore/GarbageCollectionTest.php @@ -54,7 +54,6 @@ public function testGarbageCollection() { ->execute(); } - // Perform a new set operation and then trigger garbage collection. $store->setWithExpire('autumn', 'winter', rand(500, 1000000)); system_cron(); diff --git a/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php b/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php index ed59f2f..0f231f4 100644 --- a/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php +++ b/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php @@ -532,7 +532,6 @@ public function testOutlinePathNoMatch() { $request = Request::create($path, 'GET'); - $routes = $provider->getRoutesByPattern($path); $this->assertFalse(count($routes), 'No path found with this pattern.'); diff --git a/core/tests/Drupal/Tests/Component/FileCache/FileCacheFactoryTest.php b/core/tests/Drupal/Tests/Component/FileCache/FileCacheFactoryTest.php index 4fe9d3c..c837e1a 100644 --- a/core/tests/Drupal/Tests/Component/FileCache/FileCacheFactoryTest.php +++ b/core/tests/Drupal/Tests/Component/FileCache/FileCacheFactoryTest.php @@ -122,7 +122,6 @@ public function configurationDataProvider() { ], ], [], $class]; - // Test default configuration plus specific per collection setting. $data['default-plus-collection-setting'] = [[ 'default' => [ diff --git a/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php b/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php index 5bd6220..923560d 100644 --- a/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php +++ b/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php @@ -620,7 +620,6 @@ public function andOrCacheabilityPropagationProvider() { [$allowed_un, 'OR', $neutral_cf, FALSE, NULL], [$allowed_un, 'OR', $neutral_un, FALSE, NULL], - // Forbidden (ct) OR allowed (ct,cf,un). [$forbidden_ct, 'OR', $allowed_ct, TRUE, TRUE], [$forbidden_ct, 'OR', $allowed_cf, TRUE, TRUE], @@ -660,7 +659,6 @@ public function andOrCacheabilityPropagationProvider() { [$forbidden_un, 'OR', $forbidden_cf, FALSE, NULL], [$forbidden_un, 'OR', $forbidden_un, FALSE, NULL], - // Neutral (ct) OR allowed (ct,cf,un). [$neutral_ct, 'OR', $allowed_ct, TRUE, TRUE], [$neutral_ct, 'OR', $allowed_cf, TRUE, FALSE], @@ -700,7 +698,6 @@ public function andOrCacheabilityPropagationProvider() { [$neutral_un, 'OR', $forbidden_cf, FALSE, NULL], [$neutral_un, 'OR', $forbidden_un, FALSE, NULL], - // Allowed (ct) AND allowed (ct,cf,un). [$allowed_ct, 'AND', $allowed_ct, TRUE, TRUE], [$allowed_ct, 'AND', $allowed_cf, TRUE, FALSE], @@ -740,7 +737,6 @@ public function andOrCacheabilityPropagationProvider() { [$allowed_un, 'AND', $neutral_cf, FALSE, NULL], [$allowed_un, 'AND', $neutral_un, FALSE, NULL], - // Forbidden (ct) AND allowed (ct,cf,un). [$forbidden_ct, 'AND', $allowed_ct, TRUE, TRUE], [$forbidden_ct, 'AND', $allowed_cf, TRUE, TRUE], @@ -780,7 +776,6 @@ public function andOrCacheabilityPropagationProvider() { [$forbidden_un, 'AND', $forbidden_cf, FALSE, NULL], [$forbidden_un, 'AND', $forbidden_un, FALSE, NULL], - // Neutral (ct) AND allowed (ct,cf,un). [$neutral_ct, 'AND', $allowed_ct, TRUE, TRUE], [$neutral_ct, 'AND', $allowed_cf, TRUE, TRUE], diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php index d525514..a7f7eb4 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php @@ -439,7 +439,6 @@ public function testGetFieldStorageDefinitionsWithCaching() { }) ->shouldBeCalled(); - $this->assertSame($expected, $this->entityFieldManager->getFieldStorageDefinitions('test_entity_type')); $this->entityFieldManager->testClearEntityFieldInfo(); $this->assertSame($expected, $this->entityFieldManager->getFieldStorageDefinitions('test_entity_type')); diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/RssResponseRelativeUrlFilterTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/RssResponseRelativeUrlFilterTest.php index f7179c8..49b9fbd 100644 --- a/core/tests/Drupal/Tests/Core/EventSubscriber/RssResponseRelativeUrlFilterTest.php +++ b/core/tests/Drupal/Tests/Core/EventSubscriber/RssResponseRelativeUrlFilterTest.php @@ -100,7 +100,6 @@ public function providerTestOnResponse() { RSS; - $data['invalid-feed'] = [$invalid_feed, $invalid_feed]; return $data; } diff --git a/core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php b/core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php index 3d3d501..624d592 100644 --- a/core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php @@ -462,7 +462,6 @@ protected function setupFactoryAndLocalTaskPlugins(array $definitions, $active_p $mock->getCacheTags()->willReturn(isset($info['cache_tags']) ? $info['cache_tags'] : []); $mock->getCacheMaxAge()->willReturn(isset($info['cache_max_age']) ? $info['cache_max_age'] : Cache::PERMANENT); - $access_manager_map[] = [$info['route_name'], [], $this->account, TRUE, $info['access']]; $map[] = [$info['id'], [], $mock->reveal()]; diff --git a/core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php b/core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php index 2bfb1c9..5511f0a 100644 --- a/core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php +++ b/core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php @@ -133,7 +133,6 @@ public function testIsValidWithLinkToAnyPageAccount() { ->method('processInbound') ->willReturnArgument(0); - $this->assertTrue($this->pathValidator->isValid('test-path')); } diff --git a/core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php b/core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php index 7188a51..1fca817 100644 --- a/core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php +++ b/core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php @@ -163,7 +163,6 @@ public function providerTestApplyTo() { ], ]; - $expected_when_empty_metadata = [ '#cache' => [ 'contexts' => [], @@ -228,7 +227,6 @@ public function providerTestCreateFromRenderArray() { ], ]; - $data[] = [$empty_render_array, $empty_metadata]; $data[] = [$nonempty_render_array, $nonempty_metadata]; diff --git a/core/tests/Drupal/Tests/Core/Render/RendererTest.php b/core/tests/Drupal/Tests/Core/Render/RendererTest.php index 7ac4a90..7410c4b 100644 --- a/core/tests/Drupal/Tests/Core/Render/RendererTest.php +++ b/core/tests/Drupal/Tests/Core/Render/RendererTest.php @@ -65,10 +65,8 @@ public function testRenderBasic($build, $expected, callable $setup_code = NULL) public function providerTestRenderBasic() { $data = []; - // Part 1: the most simplistic render arrays possible, none using #theme. - // Pass a NULL. $data[] = [NULL, '']; // Pass an empty string. @@ -169,7 +167,6 @@ public function providerTestRenderBasic() { // Part 2: render arrays using #theme and #theme_wrappers. - // Tests that #theme and #theme_wrappers can co-exist on an element. $build = [ '#theme' => 'common_test_foo', @@ -255,10 +252,8 @@ public function providerTestRenderBasic() { }; $data[] = [$build, '
    ' . "\n", $setup_code]; - // Part 3: render arrays using #markup as a fallback for #theme hooks. - // Theme suggestion is not implemented, #markup should be rendered. $build = [ '#theme' => ['suggestionnotimplemented'], @@ -310,10 +305,8 @@ public function providerTestRenderBasic() { ]; $data[] = [$build, $theme_function_output, $setup_code]; - // Part 4: handling of #children and child renderable elements. - // #theme is implemented so the values of both #children and 'child' will // be ignored - it is the responsibility of the theme hook to render these // if appropriate. diff --git a/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php b/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php index 6c6d768..1fc6aea 100644 --- a/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php +++ b/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php @@ -211,7 +211,6 @@ public function testAliasGeneration() { ->method('processOutbound') ->with($this->anything()); - // Check that the two generate methods return the same result. $this->assertGenerateFromRoute('test_1', [], [], $url, (new BubbleableMetadata())->setCacheMaxAge(Cache::PERMANENT)); @@ -232,7 +231,6 @@ public function testAliasGenerationUsingInterfaceConstants() { ->method('processOutbound') ->with($this->anything()); - // Check that the two generate methods return the same result. $this->assertGenerateFromRoute('test_1', [], [], $url, (new BubbleableMetadata())->setCacheMaxAge(Cache::PERMANENT));