summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxjm2017-11-09 15:13:57 -0600
committerxjm2017-11-09 15:13:57 -0600
commit6dc062eb45f223359252703347d9c9d316119344 (patch)
treeb11efa997a17273e90e79b5eb8ca652f2ebd90af
parentedf57d8ab88485556d31ddc1d7958813b5832503 (diff)
Issue #2901562 by mfernea, Jo Fitzgerald, Yogesh Pawar, 3ssom, Mile23, borisson_: Fix 'Squiz.WhiteSpace.SuperfluousWhitespace' coding standard
-rw-r--r--core/includes/common.inc1
-rw-r--r--core/includes/file.inc1
-rw-r--r--core/lib/Drupal/Component/Diff/Diff.php1
-rw-r--r--core/lib/Drupal/Core/Cache/Context/CacheContextsPass.php1
-rw-r--r--core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php1
-rw-r--r--core/lib/Drupal/Core/Database/Query/Select.php1
-rw-r--r--core/lib/Drupal/Core/DependencyInjection/Compiler/BackendCompilerPass.php1
-rw-r--r--core/lib/Drupal/Core/Extension/ThemeInstaller.php1
-rw-r--r--core/lib/Drupal/Core/Render/Element/RenderElement.php1
-rw-r--r--core/lib/Drupal/Core/Routing/MatcherDumper.php1
-rw-r--r--core/modules/big_pipe/src/Render/BigPipe.php2
-rw-r--r--core/modules/big_pipe/tests/modules/big_pipe_test/src/BigPipePlaceholderTestCases.php6
-rw-r--r--core/modules/comment/tests/src/Functional/CommentThreadingTest.php1
-rw-r--r--core/modules/datetime/src/Plugin/views/filter/Date.php1
-rw-r--r--core/modules/editor/src/Tests/EditorSecurityTest.php1
-rw-r--r--core/modules/editor/tests/src/Functional/Update/EditorUpdateTest.php1
-rw-r--r--core/modules/field/src/Tests/EntityReference/EntityReferenceFileUploadTest.php1
-rw-r--r--core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php1
-rw-r--r--core/modules/forum/forum.views.inc1
-rw-r--r--core/modules/forum/tests/src/Functional/ForumBlockTest.php1
-rw-r--r--core/modules/forum/tests/src/Functional/ForumIndexTest.php1
-rw-r--r--core/modules/forum/tests/src/Functional/ForumNodeAccessTest.php1
-rw-r--r--core/modules/hal/tests/src/Functional/EntityResource/HalEntityNormalizationTrait.php3
-rw-r--r--core/modules/history/tests/src/Kernel/Views/HistoryTimestampTest.php1
-rw-r--r--core/modules/image/src/Tests/ImageDimensionsTest.php1
-rw-r--r--core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkNotExistingInternalConstraintValidatorTest.php1
-rw-r--r--core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentCacheabilityBubblingTest.php1
-rw-r--r--core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php1
-rw-r--r--core/modules/node/src/Tests/NodeRevisionsTest.php2
-rw-r--r--core/modules/path/src/Form/PathFormBase.php1
-rw-r--r--core/modules/rest/src/RequestHandler.php1
-rw-r--r--core/modules/rest/tests/src/Functional/CookieResourceTestTrait.php5
-rw-r--r--core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php107
-rw-r--r--core/modules/rest/tests/src/Functional/EntityResource/User/UserResourceTestBase.php16
-rw-r--r--core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php1
-rw-r--r--core/modules/search/src/SearchQuery.php1
-rw-r--r--core/modules/search/src/Tests/SearchPageCacheTagsTest.php1
-rw-r--r--core/modules/serialization/tests/src/Unit/Normalizer/EntityReferenceFieldItemNormalizerTest.php2
-rw-r--r--core/modules/simpletest/src/KernelTestBase.php1
-rw-r--r--core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php11
-rw-r--r--core/modules/system/src/Tests/Entity/EntityWithUriCacheTagsTestBase.php7
-rw-r--r--core/modules/system/src/Tests/Routing/RouterTest.php1
-rw-r--r--core/modules/system/src/Tests/System/UncaughtExceptionTest.php1
-rw-r--r--core/modules/system/src/Tests/Theme/EngineTwigTest.php1
-rw-r--r--core/modules/system/system.module1
-rw-r--r--core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestCommandsForm.php2
-rw-r--r--core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestSimpleForm.php1
-rw-r--r--core/modules/system/tests/modules/dialog_renderer_test/src/Render/MainContent/WideModalRenderer.php1
-rw-r--r--core/modules/system/tests/modules/form_test/src/Form/FormTestDisabledElementsForm.php1
-rw-r--r--core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php11
-rw-r--r--core/modules/system/tests/src/Functional/Entity/Update/MoveRevisionMetadataFieldsUpdateTest.php1
-rw-r--r--core/modules/system/tests/src/Functional/Form/RedirectTest.php1
-rw-r--r--core/modules/system/tests/src/Functional/Update/EntityUpdateToRevisionableAndPublishableTest.php1
-rw-r--r--core/modules/system/tests/src/Kernel/Token/TokenReplaceKernelTest.php1
-rw-r--r--core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php1
-rw-r--r--core/modules/taxonomy/tests/src/Functional/Views/ArgumentValidatorTermTest.php2
-rw-r--r--core/modules/user/tests/src/Kernel/UserEntityReferenceTest.php1
-rw-r--r--core/modules/views/src/Element/View.php1
-rw-r--r--core/modules/views/src/Plugin/views/display/DisplayPluginBase.php1
-rw-r--r--core/modules/views/src/Plugin/views/field/FieldPluginBase.php1
-rw-r--r--core/modules/views/src/Plugin/views/filter/FilterPluginBase.php1
-rw-r--r--core/modules/views/src/Plugin/views/pager/SqlBase.php1
-rw-r--r--core/modules/views/src/Plugin/views/relationship/EntityReverse.php1
-rw-r--r--core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php1
-rw-r--r--core/modules/views/src/Tests/Update/EntityViewsMultiValueBaseFieldDataUpdateTest.php1
-rw-r--r--core/modules/views/src/ViewExecutable.php1
-rw-r--r--core/modules/views/tests/src/Functional/Plugin/StyleTest.php2
-rw-r--r--core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php3
-rw-r--r--core/modules/views/tests/src/Unit/Plugin/area/EntityTest.php1
-rw-r--r--core/modules/views/tests/src/Unit/Plugin/area/ViewTest.php1
-rw-r--r--core/modules/views/tests/src/Unit/Plugin/argument_validator/EntityTest.php1
-rw-r--r--core/modules/views/tests/src/Unit/ViewsDataTest.php1
-rw-r--r--core/modules/views/views.views.inc1
-rw-r--r--core/modules/views_ui/src/ViewEditForm.php1
-rw-r--r--core/modules/views_ui/tests/src/Kernel/TagTest.php1
-rw-r--r--core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php1
-rw-r--r--core/phpcs.xml.dist1
-rw-r--r--core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormFieldValidationFilteringTest.php1
-rw-r--r--core/tests/Drupal/KernelTests/Core/Bootstrap/GetFilenameTest.php1
-rw-r--r--core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php1
-rw-r--r--core/tests/Drupal/KernelTests/Core/Database/SelectTest.php1
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php1
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/ContentEntityCloneTest.php1
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayFormBaseTest.php1
-rw-r--r--core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php2
-rw-r--r--core/tests/Drupal/KernelTests/Core/KeyValueStore/GarbageCollectionTest.php1
-rw-r--r--core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php1
-rw-r--r--core/tests/Drupal/Tests/Component/FileCache/FileCacheFactoryTest.php1
-rw-r--r--core/tests/Drupal/Tests/Core/Access/AccessResultTest.php5
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php1
-rw-r--r--core/tests/Drupal/Tests/Core/EventSubscriber/RssResponseRelativeUrlFilterTest.php1
-rw-r--r--core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php1
-rw-r--r--core/tests/Drupal/Tests/Core/Path/PathValidatorTest.php1
-rw-r--r--core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Render/RendererTest.php7
-rw-r--r--core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php2
96 files changed, 1 insertions, 274 deletions
diff --git a/core/includes/common.inc b/core/includes/common.inc
index 67b1812..bed7adc 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -1117,7 +1117,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 0288c83..b6ab267 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 @@ class Diff {
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 @@ class CacheContextsPass implements CompilerPassInterface {
}
}
-
$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 @@ class Connection extends DatabaseConnection {
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 80533fd..ee4ed84 100644
--- a/core/lib/Drupal/Core/Database/Query/Select.php
+++ b/core/lib/Drupal/Core/Database/Query/Select.php
@@ -825,7 +825,6 @@ class Select extends Query implements SelectInterface {
}
$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 @@ class BackendCompilerPass implements CompilerPassInterface {
}
}
-
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 @@ class ThemeInstaller implements ThemeInstallerInterface {
$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/Render/Element/RenderElement.php b/core/lib/Drupal/Core/Render/Element/RenderElement.php
index 46c6f29..5a26db0 100644
--- a/core/lib/Drupal/Core/Render/Element/RenderElement.php
+++ b/core/lib/Drupal/Core/Render/Element/RenderElement.php
@@ -269,7 +269,6 @@ abstract class RenderElement extends PluginBase implements ElementInterface {
$element['#attributes']['data-disable-refocus'] = "true";
}
-
// Add a reasonable default event handler if none was specified.
if (isset($element['#ajax']) && !isset($element['#ajax']['event'])) {
switch ($element['#type']) {
diff --git a/core/lib/Drupal/Core/Routing/MatcherDumper.php b/core/lib/Drupal/Core/Routing/MatcherDumper.php
index 0de7288..f19b0ee 100644
--- a/core/lib/Drupal/Core/Routing/MatcherDumper.php
+++ b/core/lib/Drupal/Core/Routing/MatcherDumper.php
@@ -141,7 +141,6 @@ class MatcherDumper implements MatcherDumperInterface {
$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 @@ class BigPipe {
}
}
-
// 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 @@ class BigPipe {
}
}
-
// 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 @@ class BigPipePlaceholderTestCases {
'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 @@ class BigPipePlaceholderTestCases {
$status_messages->embeddedHtmlResponse = '<div role="contentinfo" aria-label="Status message" class="messages messages--status">' . "\n" . ' <h2 class="visually-hidden">Status message</h2>' . "\n" . ' Hello from BigPipe!' . "\n" . ' </div>' . "\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 @@ class BigPipePlaceholderTestCases {
$form_action->embeddedHtmlResponse = '<form class="big-pipe-test-form" data-drupal-selector="big-pipe-test-form" action="' . base_path() . 'big_pipe_test"';
}
-
// 3. Real-world example of HTML attribute value subset placeholder: CSRF
// token in link.
$csrf_token = new BigPipePlaceholderTestCase(
@@ -150,7 +147,6 @@ class BigPipePlaceholderTestCases {
$csrf_token->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 @@ class BigPipePlaceholderTestCases {
];
$hello->embeddedHtmlResponse = '<marquee>Yarhar llamas forever!</marquee>';
-
// 5. Edge case: non-#lazy_builder placeholder.
$current_time = new BigPipePlaceholderTestCase(
[
@@ -239,7 +234,6 @@ class BigPipePlaceholderTestCases {
];
$current_time->embeddedHtmlResponse = '<time datetime="1991-03-14"></time>';
-
// 6. Edge case: #lazy_builder that throws an exception.
$exception = new BigPipePlaceholderTestCase(
[
diff --git a/core/modules/comment/tests/src/Functional/CommentThreadingTest.php b/core/modules/comment/tests/src/Functional/CommentThreadingTest.php
index cff22ba..9fe7aea 100644
--- a/core/modules/comment/tests/src/Functional/CommentThreadingTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentThreadingTest.php
@@ -54,7 +54,6 @@ class CommentThreadingTest extends CommentTestBase {
// 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 0da78f0..378f33f 100644
--- a/core/modules/datetime/src/Plugin/views/filter/Date.php
+++ b/core/modules/datetime/src/Plugin/views/filter/Date.php
@@ -97,7 +97,6 @@ class Date extends NumericDate implements ContainerFactoryPluginInterface {
// 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', DateTimeItemInterface::DATETIME_STORAGE_FORMAT, DateTimeItemInterface::STORAGE_TIMEZONE) . "'", $this->dateFormat, TRUE);
diff --git a/core/modules/editor/src/Tests/EditorSecurityTest.php b/core/modules/editor/src/Tests/EditorSecurityTest.php
index cf9ab8f..f3c2995 100644
--- a/core/modules/editor/src/Tests/EditorSecurityTest.php
+++ b/core/modules/editor/src/Tests/EditorSecurityTest.php
@@ -158,7 +158,6 @@ class EditorSecurityTest extends WebTestBase {
]);
$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 @@ class EditorUpdateTest extends UpdatePathTestBase {
$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 @@ class EntityReferenceFileUploadTest extends WebTestBase {
],
])->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 2c4cdab..24d4116 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php
@@ -128,7 +128,6 @@ class MigrateFieldInstanceTest extends MigrateDrupal7TestBase {
$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 @@ class ForumBlockTest extends BrowserTestBase {
// Create 5 forum topics.
$topics = $this->createForumTopics();
-
$this->assertLink(t('More'), 0, 'New forum topics block has a "more"-link.');
$this->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 e3d904d..5d0ccdf 100644
--- a/core/modules/forum/tests/src/Functional/ForumIndexTest.php
+++ b/core/modules/forum/tests/src/Functional/ForumIndexTest.php
@@ -71,7 +71,6 @@ class ForumIndexTest extends BrowserTestBase {
$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 @@ class ForumNodeAccessTest extends BrowserTestBase {
$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 @@ trait HalEntityNormalizationTrait {
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 @@ trait HalEntityNormalizationTrait {
$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 @@ class HistoryTimestampTest extends ViewsKernelTestBase {
'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 @@ class ImageDimensionsTest extends WebTestBase {
$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 @@ class LinkNotExistingInternalConstraintValidatorTest extends UnitTestCase {
->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 @@ class MenuLinkContentCacheabilityBubblingTest extends KernelTestBase {
$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 f238504..6bfaf42 100644
--- a/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php
+++ b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php
@@ -260,7 +260,6 @@ class MigrateUpgradeForm extends ConfirmFormBase {
$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 efb4011..da5b260 100644
--- a/core/modules/node/src/Tests/NodeRevisionsTest.php
+++ b/core/modules/node/src/Tests/NodeRevisionsTest.php
@@ -166,7 +166,6 @@ class NodeRevisionsTest extends NodeTestBase {
$expected = '<li class="entitynodedelete-form"><a href="' . base_path() . 'node/' . $node->id() . '/delete">Delete</a></li>';
$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.', [
@@ -191,7 +190,6 @@ class NodeRevisionsTest extends NodeTestBase {
$this->assertFalse(strstr($json[$ids[0]], '<li class="entitynodeedit-form">'), 'The "Edit" contextual link is not shown for a non-default revision.');
$this->assertFalse(strstr($json[$ids[0]], '<li class="entitynodedelete-form">'), '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 c1b3dfd..5a54c08 100644
--- a/core/modules/path/src/Form/PathFormBase.php
+++ b/core/modules/path/src/Form/PathFormBase.php
@@ -191,7 +191,6 @@ abstract class PathFormBase extends FormBase {
}
}
-
if (!$this->pathValidator->isValid(trim($source, '/'))) {
$form_state->setErrorByName('source', t("Either the path '@link_path' is 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 @@ class RequestHandler implements ContainerAwareInterface, ContainerInjectionInter
$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 3b7c3b4..a63e41a 100644
--- a/core/modules/rest/tests/src/Functional/CookieResourceTestTrait.php
+++ b/core/modules/rest/tests/src/Functional/CookieResourceTestTrait.php
@@ -109,23 +109,18 @@ trait CookieResourceTestTrait {
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 9a4527f..7196940 100644
--- a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php
+++ b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php
@@ -306,17 +306,14 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
$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);
@@ -327,12 +324,10 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
$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);
@@ -343,10 +338,8 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
$this->assert406Response($response);
}
-
$url->setOption('query', ['_format' => static::$format]);
-
// DX: forgetting authentication: authentication provider-specific error
// response.
if (static::$auth) {
@@ -370,16 +363,13 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
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);
@@ -506,11 +496,9 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
// 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.
@@ -540,11 +528,9 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
// 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
@@ -562,75 +548,59 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
$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());
@@ -712,27 +682,22 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
$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);
@@ -740,34 +705,26 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
$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.
@@ -775,28 +732,22 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
$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')) {
@@ -804,35 +755,27 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
$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);
@@ -868,20 +811,16 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
}
}
-
$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.
// If the entity is stored, delete the first created entity (in case there
// is a uniqueness constraint).
@@ -939,7 +878,6 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
$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);
@@ -954,10 +892,8 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
$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) {
@@ -967,46 +903,36 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
$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.
@@ -1014,33 +940,26 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
$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
@@ -1060,27 +979,21 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
$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);
@@ -1105,20 +1018,16 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
// 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);
@@ -1146,7 +1055,6 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
$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);
@@ -1161,10 +1069,8 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
$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) {
@@ -1177,7 +1083,6 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
$this->provisionEntityResource();
-
if (static::$auth) {
// DX: forgetting authentication: authentication provider-specific error
// response.
@@ -1185,23 +1090,18 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
$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());
@@ -1213,21 +1113,17 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
$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());
@@ -1254,17 +1150,14 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
$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 @@ abstract class UserResourceTestBase extends EntityResourceTestBase {
// @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 @@ abstract class UserResourceTestBase extends EntityResourceTestBase {
];
$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 @@ abstract class UserResourceTestBase extends EntityResourceTestBase {
$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 @@ abstract class UserResourceTestBase extends EntityResourceTestBase {
];
$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 94af542..6de1ec9 100644
--- a/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php
+++ b/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php
@@ -127,7 +127,6 @@ class StyleSerializerTest extends ViewTestBase {
$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 cc0b65e..fca2b23 100644
--- a/core/modules/search/src/SearchQuery.php
+++ b/core/modules/search/src/SearchQuery.php
@@ -571,7 +571,6 @@ class SearchQuery extends SelectExtender {
}
}
-
// 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 @@ class SearchPageCacheTagsTest extends SearchTestBase {
$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 de2a4a6..e9df564 100644
--- a/core/modules/serialization/tests/src/Unit/Normalizer/EntityReferenceFieldItemNormalizerTest.php
+++ b/core/modules/serialization/tests/src/Unit/Normalizer/EntityReferenceFieldItemNormalizerTest.php
@@ -251,7 +251,6 @@ class EntityReferenceFieldItemNormalizerTest extends UnitTestCase {
->willReturn('field_reference')
->shouldBeCalled();
-
$this->assertDenormalize($data);
}
@@ -271,7 +270,6 @@ class EntityReferenceFieldItemNormalizerTest extends UnitTestCase {
->willReturn('field_reference')
->shouldBeCalled();
-
$this->assertDenormalize($data);
}
diff --git a/core/modules/simpletest/src/KernelTestBase.php b/core/modules/simpletest/src/KernelTestBase.php
index 7bc20ec..255adcc 100644
--- a/core/modules/simpletest/src/KernelTestBase.php
+++ b/core/modules/simpletest/src/KernelTestBase.php
@@ -226,7 +226,6 @@ EOD;
$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 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
$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 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
$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 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
$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 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
$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 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
$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 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
// 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 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
$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 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
}
}
-
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 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
$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 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
$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 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
$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 @@ abstract class EntityWithUriCacheTagsTestBase extends EntityCacheTagsTestBase {
$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 @@ abstract class EntityWithUriCacheTagsTestBase extends EntityCacheTagsTestBase {
// 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 @@ abstract class EntityWithUriCacheTagsTestBase extends EntityCacheTagsTestBase {
// 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 @@ abstract class EntityWithUriCacheTagsTestBase extends EntityCacheTagsTestBase {
$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 @@ abstract class EntityWithUriCacheTagsTestBase extends EntityCacheTagsTestBase {
$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 @@ abstract class EntityWithUriCacheTagsTestBase extends EntityCacheTagsTestBase {
// 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 @@ abstract class EntityWithUriCacheTagsTestBase extends EntityCacheTagsTestBase {
// 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 @@ class RouterTest extends WebTestBase {
// a page inception style. This test verifies that is not happening.
$this->assertNoPattern('#</body>.*</body>#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 02c0956..c4218c6 100644
--- a/core/modules/system/src/Tests/System/UncaughtExceptionTest.php
+++ b/core/modules/system/src/Tests/System/UncaughtExceptionTest.php
@@ -199,7 +199,6 @@ class UncaughtExceptionTest extends WebTestBase {
$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 @@ class EngineTwigTest extends WebTestBase {
/** @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 3b3d01d..b66ff41 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -1067,7 +1067,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 c7861e6..924a9fd 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
@@ -54,7 +54,6 @@ class AjaxFormsTestCommandsForm extends FormBase {
'#suffix' => '<div id="append_div">Append inside this div</div>',
];
-
// Shows the 'before' command.
$form['before_command_example'] = [
'#value' => $this->t("AJAX 'before': Click to put something before the div"),
@@ -93,7 +92,6 @@ class AjaxFormsTestCommandsForm extends FormBase {
'#suffix' => '<div id="css_div" style="height: 50px; width: 50px; border: 1px solid black"> box</div>',
];
-
// 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 6fc2857..3cb8105 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
@@ -111,7 +111,6 @@ class AjaxFormsTestSimpleForm extends FormBase {
'#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 @@ class WideModalRenderer extends ModalRenderer {
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 5d36779..a756dc5 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
@@ -148,7 +148,6 @@ class FormTestDisabledElementsForm extends FormBase {
'#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 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
$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 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
$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 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
$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 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
$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 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
$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 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
// 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 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
$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 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
}
}
-
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 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
$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 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
$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 @@ abstract class EntityCacheTagsTestBase extends PageCacheTagsTestBase {
$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 @@ class MoveRevisionMetadataFieldsUpdateTest extends UpdatePathTestBase {
$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 @@ class RedirectTest extends BrowserTestBase {
$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 @@ class EntityUpdateToRevisionableAndPublishableTest extends UpdatePathTestBase {
];
$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 @@ class TokenReplaceKernelTest extends TokenReplaceKernelTestBase {
->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 2423668..a3c5730 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 @@ class MenuLinkTreeTest extends UnitTestCase {
],
];
-
$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 @@ class ArgumentValidatorTermTest extends TaxonomyTestBase {
$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 @@ class ArgumentValidatorTermTest extends TaxonomyTestBase {
$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 @@ class UserEntityReferenceTest extends EntityKernelTestBase {
$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 @@ class View extends RenderElement {
// 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 a2e19a2..e1eab3e 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 @@ abstract class DisplayPluginBase extends PluginBase implements DisplayPluginInte
}
}
-
$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 c5ce66b..25f3c01 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 @@ abstract class FieldPluginBase extends HandlerBase implements FieldHandlerInterf
],
];
-
// 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 fc1d7e1..873ecb9 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 @@ abstract class FilterPluginBase extends HandlerBase implements CacheableDependen
$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 @@ abstract class SqlBase extends PagerPluginBase implements CacheableDependencyInt
],
];
-
$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 @@ class EntityReverse extends RelationshipPluginBase {
}
$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 @@ class GroupwiseMax extends RelationshipPluginBase {
'#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/Tests/Update/EntityViewsMultiValueBaseFieldDataUpdateTest.php b/core/modules/views/src/Tests/Update/EntityViewsMultiValueBaseFieldDataUpdateTest.php
index 5fe9fb7..206214e 100644
--- a/core/modules/views/src/Tests/Update/EntityViewsMultiValueBaseFieldDataUpdateTest.php
+++ b/core/modules/views/src/Tests/Update/EntityViewsMultiValueBaseFieldDataUpdateTest.php
@@ -46,7 +46,6 @@ class EntityViewsMultiValueBaseFieldDataUpdateTest extends UpdatePathTestBase {
// Check the table is still correct.
$this->assertEqual('user__roles', $handler_config['table']);
-
// The plugin ID should be updated as well.
$this->assertEqual($type === 'arguments' ? 'user__roles_rid' : 'user_roles', $handler_config['plugin_id']);
}
diff --git a/core/modules/views/src/ViewExecutable.php b/core/modules/views/src/ViewExecutable.php
index 82c1cb9..0fda8c8 100644
--- a/core/modules/views/src/ViewExecutable.php
+++ b/core/modules/views/src/ViewExecutable.php
@@ -619,7 +619,6 @@ class ViewExecutable {
$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 @@ class StyleTest extends ViewTestBase {
$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 @@ class StyleTest extends ViewTestBase {
$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 ace4204..02e90cd 100644
--- a/core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php
+++ b/core/modules/views/tests/src/Kernel/RenderCacheIntegrationTest.php
@@ -98,7 +98,6 @@ class RenderCacheIntegrationTest extends ViewsKernelTestBase {
$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 @@ class RenderCacheIntegrationTest extends ViewsKernelTestBase {
$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 @@ class RenderCacheIntegrationTest extends ViewsKernelTestBase {
$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 @@ class EntityTest extends UnitTestCase {
->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 @@ class ViewTest extends UnitTestCase {
]);
$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 @@ class EntityTest extends UnitTestCase {
['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 @@ class ViewsDataTest extends UnitTestCase {
->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 526f350..633ce9b 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 84db541..9c1d58a 100644
--- a/core/modules/views_ui/src/ViewEditForm.php
+++ b/core/modules/views_ui/src/ViewEditForm.php
@@ -165,7 +165,6 @@ class ViewEditForm extends ViewFormBase {
],
];
-
$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 @@ class TagTest extends ViewsKernelTestBase {
$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 @@ class ViewListBuilderTest extends UnitTestCase {
],
]));
-
$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 75f01b3..6e7e024 100644
--- a/core/phpcs.xml.dist
+++ b/core/phpcs.xml.dist
@@ -290,6 +290,7 @@
<property name="ignoreNewlines" value="true"/>
</properties>
</rule>
+ <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/>
<!-- Zend sniffs -->
<rule ref="Zend.Files.ClosingTag"/>
diff --git a/core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormFieldValidationFilteringTest.php b/core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormFieldValidationFilteringTest.php
index 0f17e64..98f66bd 100644
--- a/core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormFieldValidationFilteringTest.php
+++ b/core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormFieldValidationFilteringTest.php
@@ -112,7 +112,6 @@ class ContentEntityFormFieldValidationFilteringTest extends BrowserTestBase {
'translatable' => FALSE,
])->save();
-
entity_get_form_display($this->entityTypeId, $this->entityTypeId, 'default')
->setComponent($this->fieldNameSingle, ['type' => 'test_field_widget'])
->setComponent($this->fieldNameMultiple, ['type' => 'test_field_widget'])
diff --git a/core/tests/Drupal/KernelTests/Core/Bootstrap/GetFilenameTest.php b/core/tests/Drupal/KernelTests/Core/Bootstrap/GetFilenameTest.php
index 66005de..e0eccbf 100644
--- a/core/tests/Drupal/KernelTests/Core/Bootstrap/GetFilenameTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Bootstrap/GetFilenameTest.php
@@ -49,7 +49,6 @@ class GetFilenameTest extends KernelTestBase {
// 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 6c0bc1a..b2859a0 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php
@@ -211,7 +211,6 @@ class ConfigSchemaTest extends KernelTestBase {
$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 c28e1aa..fb36fe7 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/SelectTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/SelectTest.php
@@ -467,7 +467,6 @@ class SelectTest extends DatabaseTestBase {
],
];
-
$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 @@ class ConfigEntityQueryTest extends KernelTestBase {
$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 @@ class ContentEntityCloneTest extends EntityKernelTestBase {
}
$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 @@ class EntityDisplayFormBaseTest extends KernelTestBase {
])
->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 ebb3072..9edee5c 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php
@@ -819,7 +819,6 @@ class EntityQueryTest extends EntityKernelTestBase {
)->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'
@@ -842,7 +841,6 @@ class EntityQueryTest extends EntityKernelTestBase {
)->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 875ca7a..ea76f0a 100644
--- a/core/tests/Drupal/KernelTests/Core/KeyValueStore/GarbageCollectionTest.php
+++ b/core/tests/Drupal/KernelTests/Core/KeyValueStore/GarbageCollectionTest.php
@@ -54,7 +54,6 @@ class GarbageCollectionTest extends KernelTestBase {
->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 @@ class RouteProviderTest extends KernelTestBase {
$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 c317bd8..995f5fc 100644
--- a/core/tests/Drupal/Tests/Component/FileCache/FileCacheFactoryTest.php
+++ b/core/tests/Drupal/Tests/Component/FileCache/FileCacheFactoryTest.php
@@ -125,7 +125,6 @@ class FileCacheFactoryTest extends TestCase {
$class,
];
-
// Test default configuration plus specific per collection setting.
$data['default-plus-collection-setting'] = [
[
diff --git a/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php b/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php
index 0b694c6..60a17a0 100644
--- a/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php
+++ b/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php
@@ -620,7 +620,6 @@ class AccessResultTest extends UnitTestCase {
[$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 @@ class AccessResultTest extends UnitTestCase {
[$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 @@ class AccessResultTest extends UnitTestCase {
[$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 @@ class AccessResultTest extends UnitTestCase {
[$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 @@ class AccessResultTest extends UnitTestCase {
[$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 @@ class EntityFieldManagerTest extends UnitTestCase {
})
->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 @@ D rupal is an open source content management platform powering millions of websi
</rss>
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 @@ class LocalTaskManagerTest extends UnitTestCase {
$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 @@ class PathValidatorTest extends UnitTestCase {
->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 @@ class BubbleableMetadataTest extends UnitTestCase {
],
];
-
$expected_when_empty_metadata = [
'#cache' => [
'contexts' => [],
@@ -228,7 +227,6 @@ class BubbleableMetadataTest extends UnitTestCase {
],
];
-
$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 010ffc2..52569ea 100644
--- a/core/tests/Drupal/Tests/Core/Render/RendererTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/RendererTest.php
@@ -65,10 +65,8 @@ class RendererTest extends RendererTestBase {
public function providerTestRenderBasic() {
$data = [];
-
// Part 1: the most simplistic render arrays possible, none using #theme.
-
// Pass a NULL.
$data[] = [NULL, ''];
// Pass an empty string.
@@ -216,7 +214,6 @@ class RendererTest extends RendererTestBase {
// 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',
@@ -302,10 +299,8 @@ class RendererTest extends RendererTestBase {
};
$data[] = [$build, '<div class="foo"></div>' . "\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'],
@@ -357,10 +352,8 @@ class RendererTest extends RendererTestBase {
];
$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 @@ class UrlGeneratorTest extends UnitTestCase {
->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 @@ class UrlGeneratorTest extends UnitTestCase {
->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));