';
@@ -282,7 +282,7 @@ function forum_comment_delete(CommentInterface $comment) {
}
/**
- * Implements hook_form_BASE_FORM_ID_alter().
+ * Implements hook_form_BASE_FORM_ID_alter() for \Drupal\taxonomy\VocabularyForm.
*/
function forum_form_taxonomy_vocabulary_form_alter(&$form, FormStateInterface $form_state, $form_id) {
$vid = \Drupal::config('forum.settings')->get('vocabulary');
@@ -304,7 +304,7 @@ function forum_form_taxonomy_vocabulary_form_alter(&$form, FormStateInterface $f
}
/**
- * Implements hook_form_FORM_ID_alter() for taxonomy_term_form().
+ * Implements hook_form_FORM_ID_alter() for \Drupal\taxonomy\TermForm.
*/
function forum_form_taxonomy_term_form_alter(&$form, FormStateInterface $form_state, $form_id) {
$vid = \Drupal::config('forum.settings')->get('vocabulary');
@@ -315,7 +315,7 @@ function forum_form_taxonomy_term_form_alter(&$form, FormStateInterface $form_st
}
/**
- * Implements hook_form_BASE_FORM_ID_alter() for node_form().
+ * Implements hook_form_BASE_FORM_ID_alter() for \Drupal\node\NodeForm.
*/
function forum_form_node_form_alter(&$form, FormStateInterface $form_state, $form_id) {
$node = $form_state->getFormObject()->getEntity();
diff --git a/core/modules/forum/src/Breadcrumb/ForumBreadcrumbBuilderBase.php b/core/modules/forum/src/Breadcrumb/ForumBreadcrumbBuilderBase.php
index 4bde297cf..6604001f7 100644
--- a/core/modules/forum/src/Breadcrumb/ForumBreadcrumbBuilderBase.php
+++ b/core/modules/forum/src/Breadcrumb/ForumBreadcrumbBuilderBase.php
@@ -17,7 +17,7 @@ use Drupal\forum\ForumManagerInterface;
* This just holds the dependency-injected config, entity manager, and forum
* manager objects.
*/
-abstract class ForumBreadcrumbBuilderBase implements BreadcrumbBuilderInterface {
+abstract class ForumBreadcrumbBuilderBase implements BreadcrumbBuilderInterface {
use StringTranslationTrait;
/**
diff --git a/core/modules/forum/src/Form/Overview.php b/core/modules/forum/src/Form/Overview.php
index 9e77482c1..ba9c033de 100644
--- a/core/modules/forum/src/Form/Overview.php
+++ b/core/modules/forum/src/Form/Overview.php
@@ -10,7 +10,7 @@ use Drupal\taxonomy\Form\OverviewTerms;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
-/*
+/**
* Provides forum overview form for the forum vocabulary.
*/
class Overview extends OverviewTerms {
diff --git a/core/modules/forum/src/Plugin/Block/NewTopicsBlock.php b/core/modules/forum/src/Plugin/Block/NewTopicsBlock.php
index 50551eef1..d57628f31 100644
--- a/core/modules/forum/src/Plugin/Block/NewTopicsBlock.php
+++ b/core/modules/forum/src/Plugin/Block/NewTopicsBlock.php
@@ -24,4 +24,5 @@ class NewTopicsBlock extends ForumBlockBase {
->orderBy('f.created', 'DESC')
->range(0, $this->configuration['block_count']);
}
+
}
diff --git a/core/modules/forum/src/Plugin/Validation/Constraint/ForumLeafConstraint.php b/core/modules/forum/src/Plugin/Validation/Constraint/ForumLeafConstraint.php
index 1791a719d..eec87cbee 100644
--- a/core/modules/forum/src/Plugin/Validation/Constraint/ForumLeafConstraint.php
+++ b/core/modules/forum/src/Plugin/Validation/Constraint/ForumLeafConstraint.php
@@ -16,4 +16,5 @@ class ForumLeafConstraint extends Constraint {
public $selectForum = 'Select a forum.';
public $noLeafMessage = 'The item %forum is a forum container, not a forum. Select one of the forums below instead.';
+
}
diff --git a/core/modules/forum/src/Tests/ForumBlockTest.php b/core/modules/forum/src/Tests/ForumBlockTest.php
index 6b1399b8d..1bcc9bc8d 100644
--- a/core/modules/forum/src/Tests/ForumBlockTest.php
+++ b/core/modules/forum/src/Tests/ForumBlockTest.php
@@ -176,4 +176,5 @@ class ForumBlockTest extends WebTestBase {
return $topics;
}
+
}
diff --git a/core/modules/forum/src/Tests/ForumIndexTest.php b/core/modules/forum/src/Tests/ForumIndexTest.php
index 64fe0d12f..8ead34f6d 100644
--- a/core/modules/forum/src/Tests/ForumIndexTest.php
+++ b/core/modules/forum/src/Tests/ForumIndexTest.php
@@ -79,4 +79,5 @@ class ForumIndexTest extends WebTestBase {
$this->drupalGet('forum/' . $tid);
$this->assertNoText($title, 'Unpublished forum topic no longer appears on index.');
}
+
}
diff --git a/core/modules/forum/src/Tests/ForumTest.php b/core/modules/forum/src/Tests/ForumTest.php
index 04e5ff46c..34176650a 100644
--- a/core/modules/forum/src/Tests/ForumTest.php
+++ b/core/modules/forum/src/Tests/ForumTest.php
@@ -678,4 +678,5 @@ class ForumTest extends WebTestBase {
$this->nids[] = $node->id();
}
}
+
}
diff --git a/core/modules/forum/src/Tests/ForumUninstallTest.php b/core/modules/forum/src/Tests/ForumUninstallTest.php
index d2acc1f7e..1978e6b31 100644
--- a/core/modules/forum/src/Tests/ForumUninstallTest.php
+++ b/core/modules/forum/src/Tests/ForumUninstallTest.php
@@ -138,7 +138,7 @@ class ForumUninstallTest extends WebTestBase {
// Delete all terms in the Forums vocabulary. Uninstalling the forum module
// will fail unless this is done.
$terms = entity_load_multiple_by_properties('taxonomy_term', array('vid' => 'forums'));
- foreach($terms as $term) {
+ foreach ($terms as $term) {
$term->delete();
}
diff --git a/core/modules/hal/src/Normalizer/ContentEntityNormalizer.php b/core/modules/hal/src/Normalizer/ContentEntityNormalizer.php
index f2b913fb7..fd8158b34 100644
--- a/core/modules/hal/src/Normalizer/ContentEntityNormalizer.php
+++ b/core/modules/hal/src/Normalizer/ContentEntityNormalizer.php
@@ -215,7 +215,6 @@ class ContentEntityNormalizer extends NormalizerBase {
*
* @return array
* The typed data IDs.
- *
*/
protected function getTypedDataIds($types, $context = array()) {
// The 'type' can potentially contain an array of type objects. By default,
@@ -245,4 +244,5 @@ class ContentEntityNormalizer extends NormalizerBase {
return $typed_data_ids;
}
+
}
diff --git a/core/modules/hal/tests/src/Kernel/DenormalizeTest.php b/core/modules/hal/tests/src/Kernel/DenormalizeTest.php
index 3e99f2fa7..64c8311f7 100644
--- a/core/modules/hal/tests/src/Kernel/DenormalizeTest.php
+++ b/core/modules/hal/tests/src/Kernel/DenormalizeTest.php
@@ -203,4 +203,5 @@ class DenormalizeTest extends NormalizerTestBase {
// Check the custom property that contains the list of fields to merge.
$this->assertEqual($denormalized->_restSubmittedFields, ['field_test_text']);
}
+
}
diff --git a/core/modules/help/src/Tests/HelpTest.php b/core/modules/help/src/Tests/HelpTest.php
index 6cb399198..76e2ee3a3 100644
--- a/core/modules/help/src/Tests/HelpTest.php
+++ b/core/modules/help/src/Tests/HelpTest.php
@@ -158,4 +158,5 @@ class HelpTest extends WebTestBase {
}
return $modules;
}
+
}
diff --git a/core/modules/help/src/Tests/NoHelpTest.php b/core/modules/help/src/Tests/NoHelpTest.php
index 9d087b756..7a6fb7a4c 100644
--- a/core/modules/help/src/Tests/NoHelpTest.php
+++ b/core/modules/help/src/Tests/NoHelpTest.php
@@ -45,4 +45,5 @@ class NoHelpTest extends WebTestBase {
$this->drupalGet('admin/help/menu_test');
$this->assertResponse(404, 'Getting a module overview help page for a module that does not implement hook_help() results in a 404.');
}
+
}
diff --git a/core/modules/history/history.module b/core/modules/history/history.module
index baaec2edd..779259132 100644
--- a/core/modules/history/history.module
+++ b/core/modules/history/history.module
@@ -28,7 +28,7 @@ function history_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.history':
$output = '
' . t('About') . '
';
- $output .= '
' . t('The History module keeps track of which content a user has read. It marks content as new or updated depending on the last time the user viewed it. History records that are older than one month are removed during cron, which means that content older than one month is always considered read. The History module does not have a user interface but it provides a filter to Views to show new or updated content. For more information, see the online documentation for the History module.', array(':views-help' => (\Drupal::moduleHandler()->moduleExists('views')) ? \Drupal::url('help.page', array ('name' => 'views')) : '#', ':url' => 'https://www.drupal.org/documentation/modules/history')) . '
';
+ $output .= '
' . t('The History module keeps track of which content a user has read. It marks content as new or updated depending on the last time the user viewed it. History records that are older than one month are removed during cron, which means that content older than one month is always considered read. The History module does not have a user interface but it provides a filter to Views to show new or updated content. For more information, see the online documentation for the History module.', array(':views-help' => (\Drupal::moduleHandler()->moduleExists('views')) ? \Drupal::url('help.page', array ('name' => 'views')) : '#', ':url' => 'https://www.drupal.org/documentation/modules/history')) . '
';
return $output;
}
}
diff --git a/core/modules/history/src/Plugin/views/filter/HistoryUserTimestamp.php b/core/modules/history/src/Plugin/views/filter/HistoryUserTimestamp.php
index 92e1acddd..65dfc2b49 100644
--- a/core/modules/history/src/Plugin/views/filter/HistoryUserTimestamp.php
+++ b/core/modules/history/src/Plugin/views/filter/HistoryUserTimestamp.php
@@ -18,7 +18,7 @@ use Drupal\views\Plugin\views\filter\FilterPluginBase;
class HistoryUserTimestamp extends FilterPluginBase {
// Don't display empty space where the operator would be.
- var $no_operator = TRUE;
+ public $no_operator = TRUE;
/**
* {@inheritdoc}
diff --git a/core/modules/history/src/Tests/HistoryTest.php b/core/modules/history/src/Tests/HistoryTest.php
index 9e5d970ef..17bba3406 100644
--- a/core/modules/history/src/Tests/HistoryTest.php
+++ b/core/modules/history/src/Tests/HistoryTest.php
@@ -144,4 +144,5 @@ class HistoryTest extends WebTestBase {
$this->markNodeAsRead($nid);
$this->assertResponse(403);
}
+
}
diff --git a/core/modules/history/src/Tests/Views/HistoryTimestampTest.php b/core/modules/history/src/Tests/Views/HistoryTimestampTest.php
index 1e34b79d2..0f484014b 100644
--- a/core/modules/history/src/Tests/Views/HistoryTimestampTest.php
+++ b/core/modules/history/src/Tests/Views/HistoryTimestampTest.php
@@ -85,4 +85,5 @@ class HistoryTimestampTest extends ViewTestBase {
$this->executeView($view);
}
+
}
diff --git a/core/modules/image/src/Plugin/migrate/process/d6/ImageCacheActions.php b/core/modules/image/src/Plugin/migrate/process/d6/ImageCacheActions.php
index 259cd2f10..0d40769ae 100644
--- a/core/modules/image/src/Plugin/migrate/process/d6/ImageCacheActions.php
+++ b/core/modules/image/src/Plugin/migrate/process/d6/ImageCacheActions.php
@@ -19,7 +19,7 @@ class ImageCacheActions extends ProcessPluginBase {
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
$effects = [];
- foreach($row->getSourceProperty('actions') as $action) {
+ foreach ($row->getSourceProperty('actions') as $action) {
$id = preg_replace('/^imagecache/', 'image', $action['action']);
if ($id === 'image_crop') {
diff --git a/core/modules/image/src/Plugin/migrate/source/d6/ImageCachePreset.php b/core/modules/image/src/Plugin/migrate/source/d6/ImageCachePreset.php
index 2f14adc96..4266ff179 100644
--- a/core/modules/image/src/Plugin/migrate/source/d6/ImageCachePreset.php
+++ b/core/modules/image/src/Plugin/migrate/source/d6/ImageCachePreset.php
@@ -54,7 +54,7 @@ class ImageCachePreset extends DrupalSqlBase {
->condition('presetid', $row->getSourceProperty('presetid'))
->execute();
- foreach($results as $key => $result) {
+ foreach ($results as $key => $result) {
$actions[$key] = $result;
$actions[$key]['data'] = unserialize($result['data']);
}
diff --git a/core/modules/image/src/Tests/FileMoveTest.php b/core/modules/image/src/Tests/FileMoveTest.php
index 5868e85c4..195799446 100644
--- a/core/modules/image/src/Tests/FileMoveTest.php
+++ b/core/modules/image/src/Tests/FileMoveTest.php
@@ -48,4 +48,5 @@ class FileMoveTest extends WebTestBase {
// Check if derivative image has been flushed.
$this->assertFalse(file_exists($derivative_uri), 'Make sure derivative image has been flushed.');
}
+
}
diff --git a/core/modules/image/src/Tests/ImageDimensionsTest.php b/core/modules/image/src/Tests/ImageDimensionsTest.php
index 74cc7bf49..6f73042cc 100644
--- a/core/modules/image/src/Tests/ImageDimensionsTest.php
+++ b/core/modules/image/src/Tests/ImageDimensionsTest.php
@@ -35,7 +35,7 @@ class ImageDimensionsTest extends WebTestBase {
/** @var $style \Drupal\image\ImageStyleInterface */
$style = ImageStyle::create(array('name' => 'test', 'label' => 'Test'));
$style->save();
- $generated_uri = 'public://styles/test/public/'. \Drupal::service('file_system')->basename($original_uri);
+ $generated_uri = 'public://styles/test/public/' . \Drupal::service('file_system')->basename($original_uri);
$url = file_url_transform_relative($style->buildUrl($original_uri));
$variables = array(
@@ -248,7 +248,7 @@ class ImageDimensionsTest extends WebTestBase {
'#height' => 20,
];
// PNG original image. Should be resized to 100x100.
- $generated_uri = 'public://styles/test_uri/public/'. \Drupal::service('file_system')->basename($original_uri);
+ $generated_uri = 'public://styles/test_uri/public/' . \Drupal::service('file_system')->basename($original_uri);
$url = file_url_transform_relative($style->buildUrl($original_uri));
$this->assertEqual($this->getImageTag($variables), '');
$this->assertFalse(file_exists($generated_uri), 'Generated file does not exist.');
@@ -261,7 +261,7 @@ class ImageDimensionsTest extends WebTestBase {
// GIF original image. Should be resized to 50x50.
$file = $files[1];
$original_uri = file_unmanaged_copy($file->uri, 'public://', FILE_EXISTS_RENAME);
- $generated_uri = 'public://styles/test_uri/public/'. \Drupal::service('file_system')->basename($original_uri);
+ $generated_uri = 'public://styles/test_uri/public/' . \Drupal::service('file_system')->basename($original_uri);
$url = file_url_transform_relative($style->buildUrl($original_uri));
$variables['#uri'] = $original_uri;
$this->assertEqual($this->getImageTag($variables), '');
diff --git a/core/modules/image/src/Tests/ImageFieldValidateTest.php b/core/modules/image/src/Tests/ImageFieldValidateTest.php
index d36aafcdc..253252412 100644
--- a/core/modules/image/src/Tests/ImageFieldValidateTest.php
+++ b/core/modules/image/src/Tests/ImageFieldValidateTest.php
@@ -101,4 +101,5 @@ class ImageFieldValidateTest extends ImageFieldTestBase {
$this->assertNoText(t('Alternative text field is required.'));
$this->assertNoText(t('Title field is required.'));
}
+
}
diff --git a/core/modules/image/src/Tests/ImageStyleFlushTest.php b/core/modules/image/src/Tests/ImageStyleFlushTest.php
index 1f7c8e41d..63c0d8093 100644
--- a/core/modules/image/src/Tests/ImageStyleFlushTest.php
+++ b/core/modules/image/src/Tests/ImageStyleFlushTest.php
@@ -106,4 +106,5 @@ class ImageStyleFlushTest extends ImageFieldTestBase {
// Post flush, expected no image in the 'private' wrapper.
$this->assertEqual($this->getImageCount($style, 'private'), 0, format_string('Image style %style flushed correctly for %wrapper wrapper.', array('%style' => $style->label(), '%wrapper' => 'private')));
}
+
}
diff --git a/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php b/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php
index fc71e1803..f146ccc5a 100644
--- a/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php
+++ b/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php
@@ -175,7 +175,7 @@ class ImageStylesPathAndUrlTest extends WebTestBase {
// make sure that access is denied.
$file_noaccess = array_shift($files);
$original_uri_noaccess = file_unmanaged_copy($file_noaccess->uri, $scheme . '://', FILE_EXISTS_RENAME);
- $generated_uri_noaccess = $scheme . '://styles/' . $this->style->id() . '/' . $scheme . '/'. drupal_basename($original_uri_noaccess);
+ $generated_uri_noaccess = $scheme . '://styles/' . $this->style->id() . '/' . $scheme . '/' . drupal_basename($original_uri_noaccess);
$this->assertFalse(file_exists($generated_uri_noaccess), 'Generated file does not exist.');
$generate_url_noaccess = $this->style->buildUrl($original_uri_noaccess);
@@ -249,7 +249,7 @@ class ImageStylesPathAndUrlTest extends WebTestBase {
// Check that requesting a nonexistent image does not create any new
// directories in the file system.
- $directory = $scheme . '://styles/' . $this->style->id() . '/' . $scheme . '/' . $this->randomMachineName();
+ $directory = $scheme . '://styles/' . $this->style->id() . '/' . $scheme . '/' . $this->randomMachineName();
$this->drupalGet(file_create_url($directory . '/' . $this->randomString()));
$this->assertFalse(file_exists($directory), 'New directory was not created in the filesystem when requesting an unauthorized image.');
}
diff --git a/core/modules/image/src/Tests/ImageThemeFunctionTest.php b/core/modules/image/src/Tests/ImageThemeFunctionTest.php
index bf0a4cdb0..52cf6c6e5 100644
--- a/core/modules/image/src/Tests/ImageThemeFunctionTest.php
+++ b/core/modules/image/src/Tests/ImageThemeFunctionTest.php
@@ -217,4 +217,5 @@ class ImageThemeFunctionTest extends WebTestBase {
$elements = $this->xpath('//img[contains(@class, class) and contains(@alt, :alt)]', array(":class" => "image-with-attribute-alt", ":alt" => "Attribute alt"));
$this->assertEqual(count($elements), 1, 'Attribute alt overrides alt property if both set.');
}
+
}
diff --git a/core/modules/language/language.module b/core/modules/language/language.module
index c7873b895..b4612f4a2 100644
--- a/core/modules/language/language.module
+++ b/core/modules/language/language.module
@@ -168,7 +168,7 @@ function language_entity_base_field_info_alter(&$fields) {
foreach ($fields as $definition) {
// Set configurable form display for language fields with display options.
if ($definition->getType() == 'language') {
- foreach (array('form', 'view') as $type) {
+ foreach (array('form', 'view') as $type) {
if ($definition->getDisplayOptions($type)) {
// The related configurations will be purged manually on Language
// module uninstallation. @see language_modules_uninstalled().
diff --git a/core/modules/language/src/ConfigurableLanguageManager.php b/core/modules/language/src/ConfigurableLanguageManager.php
index 26892c318..238bd830c 100644
--- a/core/modules/language/src/ConfigurableLanguageManager.php
+++ b/core/modules/language/src/ConfigurableLanguageManager.php
@@ -387,7 +387,7 @@ class ConfigurableLanguageManager extends LanguageManager implements Configurabl
$type = 'language_fallback_candidates';
$types = array();
if (!empty($context['operation'])) {
- $types[] = $type . '_' . $context['operation'];
+ $types[] = $type . '_' . $context['operation'];
}
$types[] = $type;
$this->moduleHandler->alter($types, $candidates, $context);
diff --git a/core/modules/language/src/ContentLanguageSettingsInterface.php b/core/modules/language/src/ContentLanguageSettingsInterface.php
index 3bb3d5d25..7e1211d3c 100644
--- a/core/modules/language/src/ContentLanguageSettingsInterface.php
+++ b/core/modules/language/src/ContentLanguageSettingsInterface.php
@@ -39,7 +39,7 @@ interface ContentLanguageSettingsInterface extends ConfigEntityInterface {
* @param string $default_langcode
* The default language code.
*
- * @return $this;
+ * @return $this
*/
public function setDefaultLangcode($default_langcode);
diff --git a/core/modules/language/src/Form/NegotiationBrowserForm.php b/core/modules/language/src/Form/NegotiationBrowserForm.php
index 1e38a9b70..dfbdabbeb 100644
--- a/core/modules/language/src/Form/NegotiationBrowserForm.php
+++ b/core/modules/language/src/Form/NegotiationBrowserForm.php
@@ -211,4 +211,5 @@ class NegotiationBrowserForm extends ConfigFormBase {
}
return $config->get('map');
}
+
}
diff --git a/core/modules/language/src/LanguageServiceProvider.php b/core/modules/language/src/LanguageServiceProvider.php
index 566bd632c..cb4ad8823 100644
--- a/core/modules/language/src/LanguageServiceProvider.php
+++ b/core/modules/language/src/LanguageServiceProvider.php
@@ -100,4 +100,5 @@ class LanguageServiceProvider extends ServiceProviderBase {
}
return FALSE;
}
+
}
diff --git a/core/modules/language/src/Plugin/Condition/Language.php b/core/modules/language/src/Plugin/Condition/Language.php
index bbb37bf23..d1f3c95ce 100644
--- a/core/modules/language/src/Plugin/Condition/Language.php
+++ b/core/modules/language/src/Plugin/Condition/Language.php
@@ -19,7 +19,6 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
* "language" = @ContextDefinition("language", label = @Translation("Language"))
* }
* )
- *
*/
class Language extends ConditionPluginBase implements ContainerFactoryPluginInterface {
diff --git a/core/modules/language/src/Tests/LanguageBlockSettingsVisibilityTest.php b/core/modules/language/src/Tests/LanguageBlockSettingsVisibilityTest.php
index f92514bd9..ee6912e37 100644
--- a/core/modules/language/src/Tests/LanguageBlockSettingsVisibilityTest.php
+++ b/core/modules/language/src/Tests/LanguageBlockSettingsVisibilityTest.php
@@ -23,4 +23,5 @@ class LanguageBlockSettingsVisibilityTest extends WebTestBase {
$this->assertFieldByXPath('//input[@id="edit-visibility-language-langcodes-en"]', NULL, '\'English\' option appears at block config, language settings section.');
$this->assertFieldByXpath('//input[@id="edit-visibility-language-langcodes-hu"]', NULL, '\'Hungarian\' option appears at block config, language settings section.');
}
+
}
diff --git a/core/modules/language/src/Tests/LanguageBrowserDetectionTest.php b/core/modules/language/src/Tests/LanguageBrowserDetectionTest.php
index c6b731907..3991b2a0a 100644
--- a/core/modules/language/src/Tests/LanguageBrowserDetectionTest.php
+++ b/core/modules/language/src/Tests/LanguageBrowserDetectionTest.php
@@ -86,4 +86,5 @@ class LanguageBrowserDetectionTest extends WebTestBase {
$this->assertField('edit-mappings-xx-browser-langcode', 'xx', 'Browser language code found.');
$this->assertField('edit-mappings-xx-drupal-langcode', 'zh-hans', 'Drupal language code found.');
}
+
}
diff --git a/core/modules/language/src/Tests/LanguageCustomLanguageConfigurationTest.php b/core/modules/language/src/Tests/LanguageCustomLanguageConfigurationTest.php
index 9cf69ad59..dbd35cdf3 100644
--- a/core/modules/language/src/Tests/LanguageCustomLanguageConfigurationTest.php
+++ b/core/modules/language/src/Tests/LanguageCustomLanguageConfigurationTest.php
@@ -97,4 +97,5 @@ class LanguageCustomLanguageConfigurationTest extends WebTestBase {
));
$this->assertUrl(\Drupal::url('language.add', array(), array('absolute' => TRUE)), [], 'Correct page redirection.');
}
+
}
diff --git a/core/modules/language/src/Tests/LanguageListModuleInstallTest.php b/core/modules/language/src/Tests/LanguageListModuleInstallTest.php
index ea9cdd561..3df9bdc0b 100644
--- a/core/modules/language/src/Tests/LanguageListModuleInstallTest.php
+++ b/core/modules/language/src/Tests/LanguageListModuleInstallTest.php
@@ -37,4 +37,5 @@ class LanguageListModuleInstallTest extends WebTestBase {
$this->rebuildContainer();
$this->assertTrue(\Drupal::moduleHandler()->moduleExists('language'), 'Language module is enabled');
}
+
}
diff --git a/core/modules/language/src/Tests/LanguageListTest.php b/core/modules/language/src/Tests/LanguageListTest.php
index 25de99cd0..d40753060 100644
--- a/core/modules/language/src/Tests/LanguageListTest.php
+++ b/core/modules/language/src/Tests/LanguageListTest.php
@@ -61,7 +61,7 @@ class LanguageListTest extends WebTestBase {
);
$this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
$this->assertUrl(\Drupal::url('entity.configurable_language.collection', [], ['absolute' => TRUE]));
- $this->assertRaw('"edit-languages-' . $langcode .'-weight"', 'Language code found.');
+ $this->assertRaw('"edit-languages-' . $langcode . '-weight"', 'Language code found.');
$this->assertText(t($name), 'Test language added.');
$language = \Drupal::service('language_manager')->getLanguage($langcode);
@@ -205,4 +205,5 @@ class LanguageListTest extends WebTestBase {
$conf_languages = $this->container->get('language_manager')->getLanguages();
$this->assertEqual(array_diff_key($expected_conf_languages, $conf_languages), array(), 'Configurable languages loaded correctly.');
}
+
}
diff --git a/core/modules/language/src/Tests/LanguageLocaleListTest.php b/core/modules/language/src/Tests/LanguageLocaleListTest.php
index ec05c4418..dd3e02a1f 100644
--- a/core/modules/language/src/Tests/LanguageLocaleListTest.php
+++ b/core/modules/language/src/Tests/LanguageLocaleListTest.php
@@ -69,4 +69,5 @@ class LanguageLocaleListTest extends WebTestBase {
// Check the language list displayed is ordered.
$this->assertTrue($options === $options_ordered, 'Language list is ordered.');
}
+
}
diff --git a/core/modules/language/src/Tests/LanguageNegotiationInfoTest.php b/core/modules/language/src/Tests/LanguageNegotiationInfoTest.php
index caafc80a0..ee4c6d4ce 100644
--- a/core/modules/language/src/Tests/LanguageNegotiationInfoTest.php
+++ b/core/modules/language/src/Tests/LanguageNegotiationInfoTest.php
@@ -86,7 +86,7 @@ class LanguageNegotiationInfoTest extends WebTestBase {
$test_type = 'test_language_type';
$interface_method_id = LanguageNegotiationUI::METHOD_ID;
$test_method_id = 'test_language_negotiation_method';
- $form_field = $type . '[enabled]['. $interface_method_id .']';
+ $form_field = $type . '[enabled][' . $interface_method_id . ']';
$edit = array(
$form_field => TRUE,
$type . '[enabled][' . $test_method_id . ']' => TRUE,
diff --git a/core/modules/language/src/Tests/LanguagePathMonolingualTest.php b/core/modules/language/src/Tests/LanguagePathMonolingualTest.php
index 1f79604f1..510d80542 100644
--- a/core/modules/language/src/Tests/LanguagePathMonolingualTest.php
+++ b/core/modules/language/src/Tests/LanguagePathMonolingualTest.php
@@ -69,4 +69,5 @@ class LanguagePathMonolingualTest extends WebTestBase {
$this->assertResponse(200, 'Clicked link results in a valid page');
$this->assertText(t('Add language'), 'Page contains the add language text');
}
+
}
diff --git a/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php b/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php
index 7e19d4f6b..ef2abee3c 100644
--- a/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php
+++ b/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php
@@ -532,4 +532,5 @@ class LanguageUILanguageNegotiationTest extends WebTestBase {
$block = Block::load($block_id);
$this->assertFalse($block, 'Language switcher block was removed.');
}
+
}
diff --git a/core/modules/language/tests/language_elements_test/src/Form/LanguageConfigurationElement.php b/core/modules/language/tests/language_elements_test/src/Form/LanguageConfigurationElement.php
index e89f86a66..99b2fff27 100644
--- a/core/modules/language/tests/language_elements_test/src/Form/LanguageConfigurationElement.php
+++ b/core/modules/language/tests/language_elements_test/src/Form/LanguageConfigurationElement.php
@@ -46,4 +46,5 @@ class LanguageConfigurationElement extends FormBase {
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
}
+
}
diff --git a/core/modules/language/tests/language_elements_test/src/Form/LanguageConfigurationElementTest.php b/core/modules/language/tests/language_elements_test/src/Form/LanguageConfigurationElementTest.php
index d538fcc82..0aa6c4975 100644
--- a/core/modules/language/tests/language_elements_test/src/Form/LanguageConfigurationElementTest.php
+++ b/core/modules/language/tests/language_elements_test/src/Form/LanguageConfigurationElementTest.php
@@ -34,4 +34,5 @@ class LanguageConfigurationElementTest extends FormBase {
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
}
+
}
diff --git a/core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php b/core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php
index 4fa83a441..8ecdbf771 100644
--- a/core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php
+++ b/core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php
@@ -249,6 +249,7 @@ class LanguageNegotiationUrlTest extends UnitTestCase {
);
return $domain_configuration;
}
+
}
}
diff --git a/core/modules/link/src/Plugin/Field/FieldFormatter/LinkSeparateFormatter.php b/core/modules/link/src/Plugin/Field/FieldFormatter/LinkSeparateFormatter.php
index 4849d32b8..f7370378e 100644
--- a/core/modules/link/src/Plugin/Field/FieldFormatter/LinkSeparateFormatter.php
+++ b/core/modules/link/src/Plugin/Field/FieldFormatter/LinkSeparateFormatter.php
@@ -85,4 +85,5 @@ class LinkSeparateFormatter extends LinkFormatter {
}
return $element;
}
+
}
diff --git a/core/modules/link/src/Plugin/Validation/Constraint/LinkTypeConstraint.php b/core/modules/link/src/Plugin/Validation/Constraint/LinkTypeConstraint.php
index 3fe76a67b..4f706f6a0 100644
--- a/core/modules/link/src/Plugin/Validation/Constraint/LinkTypeConstraint.php
+++ b/core/modules/link/src/Plugin/Validation/Constraint/LinkTypeConstraint.php
@@ -74,4 +74,5 @@ class LinkTypeConstraint extends Constraint implements ConstraintValidatorInterf
}
}
}
+
}
diff --git a/core/modules/link/src/Tests/Views/LinkViewsTokensTest.php b/core/modules/link/src/Tests/Views/LinkViewsTokensTest.php
index b80624f72..ec06ca614 100644
--- a/core/modules/link/src/Tests/Views/LinkViewsTokensTest.php
+++ b/core/modules/link/src/Tests/Views/LinkViewsTokensTest.php
@@ -94,4 +94,5 @@ class LinkViewsTokensTest extends ViewTestBase {
$this->assertRaw("Raw options: .");
}
}
+
}
diff --git a/core/modules/locale/src/Form/ExportForm.php b/core/modules/locale/src/Form/ExportForm.php
index 1b19a93c8..ed2a6cf5c 100644
--- a/core/modules/locale/src/Form/ExportForm.php
+++ b/core/modules/locale/src/Form/ExportForm.php
@@ -139,7 +139,7 @@ class ExportForm extends FormBase {
$reader->setOptions($content_options);
$languages = $this->languageManager->getLanguages();
$language_name = isset($languages[$language->getId()]) ? $languages[$language->getId()]->getName() : '';
- $filename = $language->getId() .'.po';
+ $filename = $language->getId() . '.po';
}
else {
// Template required.
diff --git a/core/modules/locale/src/Form/ImportForm.php b/core/modules/locale/src/Form/ImportForm.php
index 5a20e278f..0ea71809b 100644
--- a/core/modules/locale/src/Form/ImportForm.php
+++ b/core/modules/locale/src/Form/ImportForm.php
@@ -192,4 +192,5 @@ class ImportForm extends FormBase {
$form_state->setRedirect('locale.translate_page');
}
+
}
diff --git a/core/modules/locale/src/Gettext.php b/core/modules/locale/src/Gettext.php
index 7bfa2ddb0..5573f43d6 100644
--- a/core/modules/locale/src/Gettext.php
+++ b/core/modules/locale/src/Gettext.php
@@ -93,4 +93,5 @@ class Gettext {
$report['seek'] = $reader->getSeek();
return $report;
}
+
}
diff --git a/core/modules/locale/src/Locale.php b/core/modules/locale/src/Locale.php
index 3627b578d..3e2a9f5da 100644
--- a/core/modules/locale/src/Locale.php
+++ b/core/modules/locale/src/Locale.php
@@ -20,4 +20,5 @@ class Locale {
public static function config() {
return \Drupal::service('locale.config_manager');
}
+
}
diff --git a/core/modules/locale/src/LocaleConfigManager.php b/core/modules/locale/src/LocaleConfigManager.php
index 1a8aef8d8..2de875e29 100644
--- a/core/modules/locale/src/LocaleConfigManager.php
+++ b/core/modules/locale/src/LocaleConfigManager.php
@@ -204,7 +204,6 @@ class LocaleConfigManager {
* The translatable array structure. A nested array matching the exact
* structure under of the default configuration for $name with only the
* elements that are translatable wrapped into a TranslatableMarkup.
- * @see self::getTranslatableData().
* @param string $langcode
* The language code to process the array with.
*
@@ -212,6 +211,8 @@ class LocaleConfigManager {
* Processed translatable data array. Will only contain translations
* different from source strings or in case of untranslatable English, the
* source strings themselves.
+ *
+ * @see self::getTranslatableData()
*/
protected function processTranslatableData($name, array $active, array $translatable, $langcode) {
$translated = array();
diff --git a/core/modules/locale/src/LocaleProjectStorage.php b/core/modules/locale/src/LocaleProjectStorage.php
index e0189de30..907bd6cd7 100644
--- a/core/modules/locale/src/LocaleProjectStorage.php
+++ b/core/modules/locale/src/LocaleProjectStorage.php
@@ -165,4 +165,5 @@ class LocaleProjectStorage implements LocaleProjectStorageInterface {
}
return $this->cache;
}
+
}
diff --git a/core/modules/locale/src/LocaleProjectStorageInterface.php b/core/modules/locale/src/LocaleProjectStorageInterface.php
index be3fe570f..b56174db8 100644
--- a/core/modules/locale/src/LocaleProjectStorageInterface.php
+++ b/core/modules/locale/src/LocaleProjectStorageInterface.php
@@ -98,4 +98,5 @@ interface LocaleProjectStorageInterface {
* The number of saved items.
*/
public function countProjects();
+
}
diff --git a/core/modules/locale/src/StreamWrapper/TranslationsStream.php b/core/modules/locale/src/StreamWrapper/TranslationsStream.php
index 7797ad117..8a1c1c9fb 100644
--- a/core/modules/locale/src/StreamWrapper/TranslationsStream.php
+++ b/core/modules/locale/src/StreamWrapper/TranslationsStream.php
@@ -42,9 +42,11 @@ class TranslationsStream extends LocalStream {
/**
* Implements Drupal\Core\StreamWrapper\StreamWrapperInterface::getExternalUrl().
- * @throws \LogicException PO files URL should not be public.
+ * @throws \LogicException
+ * PO files URL should not be public.
*/
function getExternalUrl() {
throw new \LogicException('PO files URL should not be public.');
}
+
}
diff --git a/core/modules/locale/src/StringDatabaseStorage.php b/core/modules/locale/src/StringDatabaseStorage.php
index fc6552a5b..01a0544e4 100644
--- a/core/modules/locale/src/StringDatabaseStorage.php
+++ b/core/modules/locale/src/StringDatabaseStorage.php
@@ -536,4 +536,5 @@ class StringDatabaseStorage implements StringStorageInterface {
protected function dbExecute($query, array $args = array()) {
return $this->connection->query($query, $args, $this->options);
}
+
}
diff --git a/core/modules/locale/src/StringStorageInterface.php b/core/modules/locale/src/StringStorageInterface.php
index 2aad73ea5..da1c8fb1f 100644
--- a/core/modules/locale/src/StringStorageInterface.php
+++ b/core/modules/locale/src/StringStorageInterface.php
@@ -176,4 +176,5 @@ interface StringStorageInterface {
* New string translation object.
*/
public function createTranslation($values = array());
+
}
diff --git a/core/modules/locale/src/Tests/LocaleContentTest.php b/core/modules/locale/src/Tests/LocaleContentTest.php
index 51ab6b0ad..07021faff 100644
--- a/core/modules/locale/src/Tests/LocaleContentTest.php
+++ b/core/modules/locale/src/Tests/LocaleContentTest.php
@@ -112,7 +112,7 @@ class LocaleContentTest extends WebTestBase {
// Edit the content and ensure correct language is selected.
$path = 'node/' . $node->id() . '/edit';
$this->drupalGet($path);
- $this->assertRaw('', 'Correct language selected.');
+ $this->assertRaw('', 'Correct language selected.');
// Ensure we can change the node language.
$edit = array(
'langcode[0][value]' => 'en',
diff --git a/core/modules/locale/src/Tests/LocaleImportFunctionalTest.php b/core/modules/locale/src/Tests/LocaleImportFunctionalTest.php
index c2ecc1a3d..0b69da257 100644
--- a/core/modules/locale/src/Tests/LocaleImportFunctionalTest.php
+++ b/core/modules/locale/src/Tests/LocaleImportFunctionalTest.php
@@ -638,4 +638,5 @@ msgstr "Deutsch"
EOF;
}
+
}
diff --git a/core/modules/locale/src/Tests/LocaleLibraryAlterTest.php b/core/modules/locale/src/Tests/LocaleLibraryAlterTest.php
index 0993e286a..e84e3dd48 100644
--- a/core/modules/locale/src/Tests/LocaleLibraryAlterTest.php
+++ b/core/modules/locale/src/Tests/LocaleLibraryAlterTest.php
@@ -32,4 +32,5 @@ class LocaleLibraryAlterTest extends WebTestBase {
$js_assets = $this->container->get('asset.resolver')->getJsAssets($assets, FALSE)[1];
$this->assertTrue(array_key_exists('core/modules/locale/locale.datepicker.js', $js_assets), 'locale.datepicker.js added to scripts.');
}
+
}
diff --git a/core/modules/locale/src/Tests/LocalePathTest.php b/core/modules/locale/src/Tests/LocalePathTest.php
index 7bd2615db..cc4f31a93 100644
--- a/core/modules/locale/src/Tests/LocalePathTest.php
+++ b/core/modules/locale/src/Tests/LocalePathTest.php
@@ -147,4 +147,5 @@ class LocalePathTest extends WebTestBase {
$this->assertText($second_node->label(), 'Custom alias with prefix returns second node.');
}
+
}
diff --git a/core/modules/locale/src/Tests/LocalePluralFormatTest.php b/core/modules/locale/src/Tests/LocalePluralFormatTest.php
index 0f6c9c107..00fe8d58a 100644
--- a/core/modules/locale/src/Tests/LocalePluralFormatTest.php
+++ b/core/modules/locale/src/Tests/LocalePluralFormatTest.php
@@ -444,4 +444,5 @@ msgid "Monday"
msgstr "Ponedjeljak"
EOF;
}
+
}
diff --git a/core/modules/locale/src/Tests/LocaleStringTest.php b/core/modules/locale/src/Tests/LocaleStringTest.php
index f70a96420..2f467e74d 100644
--- a/core/modules/locale/src/Tests/LocaleStringTest.php
+++ b/core/modules/locale/src/Tests/LocaleStringTest.php
@@ -201,4 +201,5 @@ class LocaleStringTest extends WebTestBase {
'translation' => $this->randomMachineName(100),
))->save();
}
+
}
diff --git a/core/modules/locale/src/Tests/LocaleTranslatedSchemaDefinitionTest.php b/core/modules/locale/src/Tests/LocaleTranslatedSchemaDefinitionTest.php
index dae9e5b2f..b117e2c8e 100644
--- a/core/modules/locale/src/Tests/LocaleTranslatedSchemaDefinitionTest.php
+++ b/core/modules/locale/src/Tests/LocaleTranslatedSchemaDefinitionTest.php
@@ -87,4 +87,5 @@ class LocaleTranslatedSchemaDefinitionTest extends WebTestBase {
$this->assertRaw('messages--status', 'No pending updates.');
$this->assertNoLinkByHref('fr/update.php/run', 'No link to run updates.');
}
+
}
diff --git a/core/modules/locale/src/Tests/LocaleTranslationUiTest.php b/core/modules/locale/src/Tests/LocaleTranslationUiTest.php
index 1f790b6b9..aad0119fa 100644
--- a/core/modules/locale/src/Tests/LocaleTranslationUiTest.php
+++ b/core/modules/locale/src/Tests/LocaleTranslationUiTest.php
@@ -205,7 +205,7 @@ class LocaleTranslationUiTest extends WebTestBase {
$this->assertNoText(t('No strings available.'), 'The translation has been removed');
}
- /*
+ /**
* Adds a language and checks that the JavaScript translation files are
* properly created and rebuilt on deletion.
*/
@@ -539,4 +539,5 @@ class LocaleTranslationUiTest extends WebTestBase {
$this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
$this->assertText($string->getString(), "Translation is marked as customized.");
}
+
}
diff --git a/core/modules/locale/src/Tests/LocaleUpdateBase.php b/core/modules/locale/src/Tests/LocaleUpdateBase.php
index a76345839..85196ad7c 100644
--- a/core/modules/locale/src/Tests/LocaleUpdateBase.php
+++ b/core/modules/locale/src/Tests/LocaleUpdateBase.php
@@ -301,4 +301,5 @@ EOF;
$db_translation = $db_translation == FALSE ? '' : $db_translation;
$this->assertEqual($translation, $db_translation, $message ? $message : format_string('Correct translation of %source (%language)', array('%source' => $source, '%language' => $langcode)));
}
+
}
diff --git a/core/modules/locale/src/Tests/LocaleUpdateCronTest.php b/core/modules/locale/src/Tests/LocaleUpdateCronTest.php
index 073258d3e..569b818bd 100644
--- a/core/modules/locale/src/Tests/LocaleUpdateCronTest.php
+++ b/core/modules/locale/src/Tests/LocaleUpdateCronTest.php
@@ -106,4 +106,5 @@ class LocaleUpdateCronTest extends LocaleUpdateBase {
$this->assertTrue($current->timestamp > $initial->timestamp, 'Timestamp is updated');
$this->assertTrue($current->last_checked > $initial->last_checked, 'Last checked is updated');
}
+
}
diff --git a/core/modules/locale/src/Tests/LocaleUpdateDevelopmentReleaseTest.php b/core/modules/locale/src/Tests/LocaleUpdateDevelopmentReleaseTest.php
index 4dd79134d..cfd2446fc 100644
--- a/core/modules/locale/src/Tests/LocaleUpdateDevelopmentReleaseTest.php
+++ b/core/modules/locale/src/Tests/LocaleUpdateDevelopmentReleaseTest.php
@@ -28,4 +28,5 @@ class LocaleUpdateDevelopmentReleaseTest extends WebTestBase {
$this->verbose($projects['contrib']->info['version']);
$this->assertEqual($projects['contrib']->info['version'], '12.x-10.x', 'The branch of the contrib module dev release.');
}
+
}
diff --git a/core/modules/menu_link_content/menu_link_content.module b/core/modules/menu_link_content/menu_link_content.module
index cd9a97300..98357c6cd 100644
--- a/core/modules/menu_link_content/menu_link_content.module
+++ b/core/modules/menu_link_content/menu_link_content.module
@@ -49,7 +49,6 @@ function menu_link_content_path_insert($path) {
*
* @param string $path
* The path alias.
- *
*/
function _menu_link_content_update_path_alias($path) {
/** @var \Drupal\Core\Menu\MenuLinkManagerInterface $menu_link_manager */
diff --git a/core/modules/menu_link_content/src/Plugin/Deriver/MenuLinkContentDeriver.php b/core/modules/menu_link_content/src/Plugin/Deriver/MenuLinkContentDeriver.php
index 6f631345c..e05fa2158 100644
--- a/core/modules/menu_link_content/src/Plugin/Deriver/MenuLinkContentDeriver.php
+++ b/core/modules/menu_link_content/src/Plugin/Deriver/MenuLinkContentDeriver.php
@@ -43,7 +43,6 @@ class MenuLinkContentDeriver extends DeriverBase implements ContainerDeriverInte
*
* @param \Drupal\Core\Entity\Query\QueryFactory $query_factory
* The query factory.
- *
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager.
* @param \Drupal\Core\Menu\MenuLinkManagerInterface $menu_link_manager
diff --git a/core/modules/menu_link_content/src/Tests/MenuLinkContentFormTest.php b/core/modules/menu_link_content/src/Tests/MenuLinkContentFormTest.php
index 5be8bed6b..1bdc927f7 100644
--- a/core/modules/menu_link_content/src/Tests/MenuLinkContentFormTest.php
+++ b/core/modules/menu_link_content/src/Tests/MenuLinkContentFormTest.php
@@ -64,4 +64,5 @@ class MenuLinkContentFormTest extends WebTestBase {
);
$this->assertText(t('Manually entered paths should start with /, ? or #.'));
}
+
}
diff --git a/core/modules/menu_ui/menu_ui.module b/core/modules/menu_ui/menu_ui.module
index 463f8cabd..d642247f5 100644
--- a/core/modules/menu_ui/menu_ui.module
+++ b/core/modules/menu_ui/menu_ui.module
@@ -257,7 +257,7 @@ function menu_ui_get_menu_link_defaults(NodeInterface $node) {
}
/**
- * Implements hook_form_BASE_FORM_ID_alter() for node_form.
+ * Implements hook_form_BASE_FORM_ID_alter() for \Drupal\node\NodeForm.
*
* Adds menu item fields to the node form.
*
@@ -371,7 +371,7 @@ function menu_ui_form_node_form_submit($form, FormStateInterface $form_state) {
$entity->delete();
}
}
- elseif (trim($values['title'])) {
+ elseif (trim($values['title'])) {
// Decompose the selected menu parent option into 'menu_name' and 'parent',
// if the form used the default parent selection widget.
if (!empty($values['menu_parent'])) {
@@ -385,12 +385,12 @@ function menu_ui_form_node_form_submit($form, FormStateInterface $form_state) {
}
/**
- * Implements hook_form_FORM_ID_alter().
+ * Implements hook_form_FORM_ID_alter() for \Drupal\node\NodeTypeForm.
*
* Adds menu options to the node type form.
*
- * @see NodeTypeForm::form().
- * @see menu_ui_form_node_type_form_submit().
+ * @see NodeTypeForm::form()
+ * @see menu_ui_form_node_type_form_submit()
*/
function menu_ui_form_node_type_form_alter(&$form, FormStateInterface $form_state) {
/** @var \Drupal\Core\Menu\MenuParentFormSelectorInterface $menu_parent_selector */
@@ -437,7 +437,7 @@ function menu_ui_form_node_type_form_alter(&$form, FormStateInterface $form_stat
/**
* Submit handler for forms with menu options.
*
- * @see menu_ui_form_node_type_form_alter().
+ * @see menu_ui_form_node_type_form_alter()
*/
function menu_ui_form_node_type_form_validate(&$form, FormStateInterface $form_state) {
$available_menus = array_filter($form_state->getValue('menu_options'));
@@ -457,7 +457,7 @@ function menu_ui_form_node_type_form_validate(&$form, FormStateInterface $form_s
/**
* Entity builder for the node type form with menu options.
*
- * @see menu_ui_form_node_type_form_alter().
+ * @see menu_ui_form_node_type_form_alter()
*/
function menu_ui_form_node_type_form_builder($entity_type, NodeTypeInterface $type, &$form, FormStateInterface $form_state) {
$type->setThirdPartySetting('menu_ui', 'available_menus', array_values(array_filter($form_state->getValue('menu_options'))));
diff --git a/core/modules/menu_ui/src/Form/MenuDeleteForm.php b/core/modules/menu_ui/src/Form/MenuDeleteForm.php
index 86fbd6b81..22bfb0ac3 100644
--- a/core/modules/menu_ui/src/Form/MenuDeleteForm.php
+++ b/core/modules/menu_ui/src/Form/MenuDeleteForm.php
@@ -92,4 +92,5 @@ class MenuDeleteForm extends EntityDeleteForm {
parent::submitForm($form, $form_state);
}
+
}
diff --git a/core/modules/menu_ui/src/Tests/MenuLinkReorderTest.php b/core/modules/menu_ui/src/Tests/MenuLinkReorderTest.php
index c0e985698..0396f173e 100644
--- a/core/modules/menu_ui/src/Tests/MenuLinkReorderTest.php
+++ b/core/modules/menu_ui/src/Tests/MenuLinkReorderTest.php
@@ -63,4 +63,5 @@ class MenuLinkReorderTest extends WebTestBase {
$this->assertLink('Home');
}
+
}
diff --git a/core/modules/menu_ui/src/Tests/MenuNodeTest.php b/core/modules/menu_ui/src/Tests/MenuNodeTest.php
index cdc0b12c7..3fc8423fe 100644
--- a/core/modules/menu_ui/src/Tests/MenuNodeTest.php
+++ b/core/modules/menu_ui/src/Tests/MenuNodeTest.php
@@ -229,10 +229,10 @@ class MenuNodeTest extends WebTestBase {
));
$child_item->save();
// Edit the first node.
- $this->drupalGet('node/'. $node->id() .'/edit');
+ $this->drupalGet('node/' . $node->id() . '/edit');
// Assert that it is not possible to set the parent of the first node to itself or the second node.
- $this->assertNoOption('edit-menu-menu-parent', 'tools:'. $item->getPluginId());
- $this->assertNoOption('edit-menu-menu-parent', 'tools:'. $child_item->getPluginId());
+ $this->assertNoOption('edit-menu-menu-parent', 'tools:' . $item->getPluginId());
+ $this->assertNoOption('edit-menu-menu-parent', 'tools:' . $child_item->getPluginId());
// Assert that unallowed Administration menu is not available in options.
$this->assertNoOption('edit-menu-menu-parent', 'admin:');
}
@@ -337,4 +337,5 @@ class MenuNodeTest extends WebTestBase {
$this->drupalGet($url);
$this->assertFieldById('edit-menu-title', $translated_node_title);
}
+
}
diff --git a/core/modules/menu_ui/src/Tests/MenuTest.php b/core/modules/menu_ui/src/Tests/MenuTest.php
index 74c09af0e..f640cc749 100644
--- a/core/modules/menu_ui/src/Tests/MenuTest.php
+++ b/core/modules/menu_ui/src/Tests/MenuTest.php
@@ -571,7 +571,7 @@ class MenuTest extends MenuWebTestBase {
$id = 'block:block=' . $block->id() . ':langcode=en|menu:menu=' . $custom_menu->id() . ':langcode=en';
// @see \Drupal\contextual\Tests\ContextualDynamicContextTest:assertContextualLinkPlaceHolder()
- $this->assertRaw('', format_string('Contextual link placeholder with id @id exists.', array('@id' => $id)));
+ $this->assertRaw('', format_string('Contextual link placeholder with id @id exists.', array('@id' => $id)));
// Get server-rendered contextual links.
// @see \Drupal\contextual\Tests\ContextualDynamicContextTest:renderContextualLinks()
diff --git a/core/modules/migrate/src/Annotation/MigrateProcessPlugin.php b/core/modules/migrate/src/Annotation/MigrateProcessPlugin.php
index 121276c49..f08da3bd9 100644
--- a/core/modules/migrate/src/Annotation/MigrateProcessPlugin.php
+++ b/core/modules/migrate/src/Annotation/MigrateProcessPlugin.php
@@ -44,4 +44,5 @@ class MigrateProcessPlugin extends Plugin {
* @var bool (optional)
*/
public $handle_multiples = FALSE;
+
}
diff --git a/core/modules/migrate/src/MigrateBuildDependencyInterface.php b/core/modules/migrate/src/MigrateBuildDependencyInterface.php
index 5c52998f1..bb02c8887 100644
--- a/core/modules/migrate/src/MigrateBuildDependencyInterface.php
+++ b/core/modules/migrate/src/MigrateBuildDependencyInterface.php
@@ -18,4 +18,5 @@ interface MigrateBuildDependencyInterface {
* An array of migrations.
*/
public function buildDependencyMigration(array $migrations, array $dynamic_ids);
+
}
diff --git a/core/modules/migrate/src/MigrateExecutable.php b/core/modules/migrate/src/MigrateExecutable.php
index 89eb0e4b2..c0b3537ac 100644
--- a/core/modules/migrate/src/MigrateExecutable.php
+++ b/core/modules/migrate/src/MigrateExecutable.php
@@ -378,6 +378,7 @@ class MigrateExecutable implements MigrateExecutableInterface {
$new_value[] = $plugin->transform($scalar_value, $this, $row, $destination);
}
catch (MigrateSkipProcessException $e) {
+ $new_value[] = NULL;
$break = TRUE;
}
}
@@ -391,6 +392,7 @@ class MigrateExecutable implements MigrateExecutableInterface {
$value = $plugin->transform($value, $this, $row, $destination);
}
catch (MigrateSkipProcessException $e) {
+ $value = NULL;
break;
}
$multiple = $multiple || $plugin->multiple();
diff --git a/core/modules/migrate/src/MigrateMessageInterface.php b/core/modules/migrate/src/MigrateMessageInterface.php
index 2b55651ca..628a684fe 100644
--- a/core/modules/migrate/src/MigrateMessageInterface.php
+++ b/core/modules/migrate/src/MigrateMessageInterface.php
@@ -14,4 +14,5 @@ interface MigrateMessageInterface {
* The type of message, for example: status or warning.
*/
public function display($message, $type = 'status');
+
}
diff --git a/core/modules/migrate/src/Plugin/MigrateIdMapInterface.php b/core/modules/migrate/src/Plugin/MigrateIdMapInterface.php
index 58ec334d6..d3bdb8923 100644
--- a/core/modules/migrate/src/Plugin/MigrateIdMapInterface.php
+++ b/core/modules/migrate/src/Plugin/MigrateIdMapInterface.php
@@ -209,10 +209,32 @@ interface MigrateIdMapInterface extends \Iterator, PluginInspectionInterface {
* The source identifier keyed values of the record, e.g. ['nid' => 5].
*
* @return array
- * The destination identifier values of the record, or NULL on failure.
+ * The destination identifier values of the record, or empty on failure.
+ *
+ * @deprecated in Drupal 8.1.x, will be removed before Drupal 9.0.x. Use
+ * lookupDestinationIds() instead.
*/
public function lookupDestinationId(array $source_id_values);
+ /**
+ * Looks up the destination identifiers corresponding to a source key.
+ *
+ * This can look up a subset of source keys if only some are provided, and
+ * will return all destination keys that match.
+ *
+ * @param array $source_id_values
+ * The source identifier keyed values of the records, e.g. ['nid' => 5].
+ * If unkeyed, the first count($source_id_values) keys will be assumed.
+ *
+ * @return array
+ * An array of arrays of destination identifier values.
+ *
+ * @throws \Drupal\migrate\MigrateException
+ * Thrown when $source_id_values contains unknown keys, or is the wrong
+ * length.
+ */
+ public function lookupDestinationIds(array $source_id_values);
+
/**
* Looks up the destination identifier currently being iterated.
*
diff --git a/core/modules/migrate/src/Plugin/Migration.php b/core/modules/migrate/src/Plugin/Migration.php
index 9b22e359f..86294b540 100644
--- a/core/modules/migrate/src/Plugin/Migration.php
+++ b/core/modules/migrate/src/Plugin/Migration.php
@@ -217,7 +217,7 @@ class Migration extends PluginBase implements MigrationInterface, RequirementsIn
protected $migrationPluginManager;
/**
- * The source plugin manager.
+ * The source plugin manager.
*
* @var \Drupal\migrate\Plugin\MigratePluginManager
*/
@@ -712,4 +712,5 @@ class Migration extends PluginBase implements MigrationInterface, RequirementsIn
public function getDestinationIds() {
$this->destinationIds;
}
+
}
diff --git a/core/modules/migrate/src/Plugin/MigrationInterface.php b/core/modules/migrate/src/Plugin/MigrationInterface.php
index f61add01b..7572760b5 100644
--- a/core/modules/migrate/src/Plugin/MigrationInterface.php
+++ b/core/modules/migrate/src/Plugin/MigrationInterface.php
@@ -279,7 +279,7 @@ interface MigrationInterface extends PluginInspectionInterface, DerivativeInspec
* @return $this
* The migration entity.
*
- * @see Drupal\migrate_drupal\Plugin\migrate\load\LoadEntity::processLinkField().
+ * @see Drupal\migrate_drupal\Plugin\migrate\load\LoadEntity::processLinkField()
*/
public function mergeProcessOfProperty($property, array $process_of_property);
diff --git a/core/modules/migrate/src/Plugin/MigrationPluginManager.php b/core/modules/migrate/src/Plugin/MigrationPluginManager.php
index f0e6493d8..d082c11d7 100644
--- a/core/modules/migrate/src/Plugin/MigrationPluginManager.php
+++ b/core/modules/migrate/src/Plugin/MigrationPluginManager.php
@@ -157,6 +157,7 @@ class MigrationPluginManager extends DefaultPluginManager implements MigrationPl
// current migration.
$dependency_graph = [];
$required_dependency_graph = [];
+ $have_optional = FALSE;
foreach ($migrations as $migration) {
/** @var \Drupal\migrate\Plugin\MigrationInterface $migration */
$id = $migration->id();
@@ -172,14 +173,15 @@ class MigrationPluginManager extends DefaultPluginManager implements MigrationPl
$this->addDependency($dependency_graph, $id, $dependency, $dynamic_ids);
}
}
- if (isset($migration_dependencies['optional'])) {
+ if (!empty($migration_dependencies['optional'])) {
foreach ($migration_dependencies['optional'] as $dependency) {
$this->addDependency($dependency_graph, $id, $dependency, $dynamic_ids);
}
+ $have_optional = TRUE;
}
}
$dependency_graph = (new Graph($dependency_graph))->searchAndSort();
- if (!empty($migration_dependencies['optional'])) {
+ if ($have_optional) {
$required_dependency_graph = (new Graph($required_dependency_graph))->searchAndSort();
}
else {
diff --git a/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php b/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
index 82699570d..cf39275f8 100644
--- a/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
+++ b/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
@@ -517,16 +517,56 @@ class Sql extends PluginBase implements MigrateIdMapInterface, ContainerFactoryP
* {@inheritdoc}
*/
public function lookupDestinationId(array $source_id_values) {
+ $results = $this->lookupDestinationIds($source_id_values);
+ return $results ? reset($results) : array();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function lookupDestinationIds(array $source_id_values) {
if (empty($source_id_values)) {
return array();
}
- $query = $this->getDatabase()->select($this->mapTableName(), 'map')
- ->fields('map', $this->destinationIdFields());
- $query->condition(static::SOURCE_IDS_HASH, $this->getSourceIDsHash($source_id_values));
- $result = $query->execute();
- $destination_id = $result->fetchAssoc();
- return array_values($destination_id ?: array());
+ // Canonicalize the keys into a hash of DB-field => value.
+ $is_associative = !isset($source_id_values[0]);
+ $conditions = [];
+ foreach ($this->sourceIdFields() as $field_name => $db_field) {
+ if ($is_associative) {
+ // Associative $source_id_values can have fields out of order.
+ if (isset($source_id_values[$field_name])) {
+ $conditions[$db_field] = $source_id_values[$field_name];
+ unset($source_id_values[$field_name]);
+ }
+ }
+ else {
+ // For non-associative $source_id_values, we assume they're the first
+ // few fields.
+ if (empty($source_id_values)) {
+ break;
+ }
+ $conditions[$db_field] = array_shift($source_id_values);
+ }
+ }
+
+ if (!empty($source_id_values)) {
+ throw new MigrateException("Extra unknown items in source IDs");
+ }
+
+ $query = $this->getDatabase()->select($this->mapTableName(), 'map')
+ ->fields('map', $this->destinationIdFields());
+ if (count($this->sourceIdFields()) === count($conditions)) {
+ // Optimization: Use the primary key.
+ $query->condition(self::SOURCE_IDS_HASH, $this->getSourceIDsHash(array_values($conditions)));
+ }
+ else {
+ foreach ($conditions as $db_field => $value) {
+ $query->condition($db_field, $value);
+ }
+ }
+
+ return $query->execute()->fetchAll(\PDO::FETCH_NUM);
}
/**
diff --git a/core/modules/migrate/src/Row.php b/core/modules/migrate/src/Row.php
index 4f07ef4ab..94cb8b2bd 100644
--- a/core/modules/migrate/src/Row.php
+++ b/core/modules/migrate/src/Row.php
@@ -335,4 +335,5 @@ class Row {
public function isStub() {
return $this->isStub;
}
+
}
diff --git a/core/modules/migrate/tests/src/Unit/Exception/RequirementsExceptionTest.php b/core/modules/migrate/tests/src/Unit/Exception/RequirementsExceptionTest.php
index 97009751b..72d37ed73 100644
--- a/core/modules/migrate/tests/src/Unit/Exception/RequirementsExceptionTest.php
+++ b/core/modules/migrate/tests/src/Unit/Exception/RequirementsExceptionTest.php
@@ -47,4 +47,5 @@ class RequirementsExceptionTest extends UnitTestCase {
),
);
}
+
}
diff --git a/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php b/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php
index f0e783270..a9d1313f5 100644
--- a/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php
+++ b/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php
@@ -430,6 +430,123 @@ class MigrateSqlIdMapTest extends MigrateTestCase {
$this->assertSame(0, count($destination_id));
}
+ /**
+ * Setup a database with the given rows.
+ *
+ * @param array $source_keys
+ * The source keys for the ID map table.
+ * @param array $dest_keys
+ * The destination keys for the ID map table.
+ * @param array $rows
+ * An array of source and destination value arrays for the ID map table.
+ *
+ * @return \Drupal\Tests\migrate\Unit\TestSqlIdMap
+ * An ID map instance for testing.
+ */
+ protected function setupRows($source_keys, $dest_keys, $rows) {
+ $this->database = $this->getDatabase([]);
+ $this->sourceIds = array_fill_keys($source_keys, []);
+ $this->destinationIds = array_fill_keys($dest_keys, []);
+
+ $db_keys = [];
+ foreach (array_keys($source_keys) as $i) {
+ $db_keys[] = 'sourceid' . ($i + 1);
+ }
+ foreach (array_keys($dest_keys) as $i) {
+ $db_keys[] = 'destid' . ($i + 1);
+ }
+ foreach ($rows as $row) {
+ $values = array_combine($db_keys, $row);
+ $source_values = array_slice($row, 0, count($source_keys));
+ $values['source_ids_hash'] = $this->getIdMap()->getSourceIDsHash($source_values);
+ $this->saveMap($values);
+ }
+
+ return $this->getIdMap();
+ }
+
+ /**
+ * Tests lookupDestinationIds().
+ */
+ public function testLookupDestinationIds() {
+ // Simple map with one source and one destination ID.
+ $id_map = $this->setupRows(['nid'], ['nid'], [
+ [1, 101],
+ [2, 102],
+ [3, 103],
+ ]);
+
+ // Lookup nothing, gives nothing.
+ $this->assertEquals([], $id_map->lookupDestinationIds([]));
+ // Lookup by complete non-associative list.
+ $this->assertEquals([[101]], $id_map->lookupDestinationIds([1]));
+ $this->assertEquals([[102]], $id_map->lookupDestinationIds([2]));
+ $this->assertEquals([], $id_map->lookupDestinationIds([99]));
+ // Lookup by complete associative list.
+ $this->assertEquals([[101]], $id_map->lookupDestinationIds(['nid' => 1]));
+ $this->assertEquals([[102]], $id_map->lookupDestinationIds(['nid' => 2]));
+ $this->assertEquals([], $id_map->lookupDestinationIds(['nid' => 99]));
+
+ // Map with multiple source and destination IDs.
+ $id_map = $this->setupRows(['nid', 'language'], ['nid', 'langcode'], [
+ [1, 'en', 101, 'en'],
+ [1, 'fr', 101, 'fr'],
+ [1, 'de', 101, 'de'],
+ [2, 'en', 102, 'en'],
+ ]);
+
+ // Lookup nothing, gives nothing.
+ $this->assertEquals([], $id_map->lookupDestinationIds([]));
+ // Lookup by complete non-associative list.
+ $this->assertEquals([[101, 'en']], $id_map->lookupDestinationIds([1, 'en']));
+ $this->assertEquals([[101, 'fr']], $id_map->lookupDestinationIds([1, 'fr']));
+ $this->assertEquals([[102, 'en']], $id_map->lookupDestinationIds([2, 'en']));
+ $this->assertEquals([], $id_map->lookupDestinationIds([2, 'fr']));
+ $this->assertEquals([], $id_map->lookupDestinationIds([99, 'en']));
+ // Lookup by complete associative list.
+ $this->assertEquals([[101, 'en']], $id_map->lookupDestinationIds(['nid' => 1, 'language' => 'en']));
+ $this->assertEquals([[101, 'fr']], $id_map->lookupDestinationIds(['nid' => 1, 'language' => 'fr']));
+ $this->assertEquals([[102, 'en']], $id_map->lookupDestinationIds(['nid' => 2, 'language' => 'en']));
+ $this->assertEquals([], $id_map->lookupDestinationIds(['nid' => 2, 'language' => 'fr']));
+ $this->assertEquals([], $id_map->lookupDestinationIds(['nid' => 99, 'language' => 'en']));
+ // Lookup by partial non-associative list.
+ $this->assertEquals([[101, 'en'], [101, 'fr'], [101, 'de']], $id_map->lookupDestinationIds([1]));
+ $this->assertEquals([[102, 'en']], $id_map->lookupDestinationIds([2]));
+ $this->assertEquals([], $id_map->lookupDestinationIds([99]));
+ // Lookup by partial associative list.
+ $this->assertEquals([[101, 'en'], [101, 'fr'], [101, 'de']], $id_map->lookupDestinationIds(['nid' => 1]));
+ $this->assertEquals([[102, 'en']], $id_map->lookupDestinationIds(['nid' => 2]));
+ $this->assertEquals([], $id_map->lookupDestinationIds(['nid' => 99]));
+ // Out-of-order partial associative list.
+ $this->assertEquals([[101, 'en'], [102, 'en']], $id_map->lookupDestinationIds(['language' => 'en']));
+ $this->assertEquals([[101, 'fr']], $id_map->lookupDestinationIds(['language' => 'fr']));
+ $this->assertEquals([], $id_map->lookupDestinationIds(['language' => 'zh']));
+ // Error conditions.
+ try {
+ $id_map->lookupDestinationIds([1, 2, 3]);
+ $this->fail('Too many source IDs should throw');
+ }
+ catch (MigrateException $e) {
+ $this->assertEquals("Extra unknown items in source IDs", $e->getMessage());
+ }
+ try {
+ $id_map->lookupDestinationIds(['nid' => 1, 'aaa' => '2']);
+ $this->fail('Unknown source ID key should throw');
+ }
+ catch (MigrateException $e) {
+ $this->assertEquals("Extra unknown items in source IDs", $e->getMessage());
+ }
+
+ // Verify that we are looking up by source_id_hash when all source IDs are
+ // passed in.
+ $id_map->getDatabase()->update($id_map->mapTableName())
+ ->condition('sourceid1', 1)
+ ->condition('sourceid2', 'en')
+ ->fields([TestSqlIdMap::SOURCE_IDS_HASH => uniqid()])
+ ->execute();
+ $this->assertNotEquals([[101, 'en']], $id_map->lookupDestinationIds([1, 'en']));
+ }
+
/**
* Tests the getRowByDestination method.
*/
diff --git a/core/modules/migrate/tests/src/Unit/MigrationPluginManagerTest.php b/core/modules/migrate/tests/src/Unit/MigrationPluginManagerTest.php
new file mode 100644
index 000000000..91351cfc1
--- /dev/null
+++ b/core/modules/migrate/tests/src/Unit/MigrationPluginManagerTest.php
@@ -0,0 +1,220 @@
+getMock('Drupal\Core\Extension\ModuleHandlerInterface');
+ $cache_backend = $this->getMock('Drupal\Core\Cache\CacheBackendInterface');
+ $language_manager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
+ $this->pluginManager = new MigrationPluginManager($module_handler, $cache_backend, $language_manager);
+ }
+
+ /**
+ * Tests building dependencies for multiple migrations.
+ *
+ * @dataProvider dependencyProvider
+ */
+ public function testDependencyBuilding($migrations_data, $result_ids) {
+ $migrations = [];
+ foreach ($migrations_data as $migration_id => $migration_data) {
+ $migrations[$migration_id] = new TestMigrationMock($migration_id, $migration_data['dependencies']);
+ }
+
+ $ordered_migrations = $this->pluginManager->buildDependencyMigration($migrations, []);
+
+ // Verify results.
+ $this->assertEquals($result_ids, array_keys($ordered_migrations));
+ foreach ($migrations_data as $migration_id => $migration_data) {
+ $migration = $migrations[$migration_id];
+
+ $requirements = $migration_data['result_requirements'];
+ if (empty($requirements)) {
+ $this->assertEquals([], $migration->set);
+ }
+ else {
+ $requirements = array_combine($requirements, $requirements);
+
+ $this->assertEquals(1, count($migration->set));
+ list($set_prop, $set_requirements) = reset($migration->set);
+ $this->assertEquals('requirements', $set_prop);
+ $this->assertEquals($requirements, $set_requirements);
+ }
+ }
+ }
+
+ /**
+ * Provide dependency data for testing.
+ */
+ public function dependencyProvider() {
+ return [
+ // Just one migration, with no dependencies.
+ [
+ [
+ 'm1' => [
+ 'dependencies' => [],
+ 'result_requirements' => [],
+ ],
+ ],
+ ['m1'],
+ ],
+
+ // Just one migration, with required dependencies.
+ [
+ [
+ 'm1' => [
+ 'dependencies' => [
+ 'required' => ['required1', 'required2'],
+ ],
+ 'result_requirements' => ['required1', 'required2'],
+ ],
+ ],
+ ['m1'],
+ ],
+
+ // Just one migration, with optional dependencies.
+ [
+ [
+ 'm1' => [
+ 'dependencies' => [
+ 'optional' => ['optional1'],
+ ],
+ 'result_requirements' => [],
+ ],
+ ],
+ ['m1'],
+ ],
+
+ // Multiple migrations.
+ [
+ [
+ 'm1' => [
+ 'dependencies' => [
+ 'required' => ['required1', 'required2'],
+ ],
+ 'result_requirements' => ['required1', 'required2'],
+ ],
+ 'm2' => [
+ 'dependencies' => [
+ 'optional' => ['optional1'],
+ ],
+ 'result_requirements' => [],
+ ],
+ ],
+ ['m1', 'm2'],
+ ],
+
+ // Multiple migrations, reordered due to optional requirement.
+ [
+ [
+ 'm1' => [
+ 'dependencies' => [
+ 'optional' => ['m2'],
+ ],
+ 'result_requirements' => [],
+ ],
+ 'm2' => [
+ 'dependencies' => [
+ 'optional' => ['optional1'],
+ ],
+ 'result_requirements' => [],
+ ],
+ ],
+ ['m2', 'm1'],
+ ],
+
+ // Ensure that optional requirements aren't turned into required ones,
+ // if the last migration has no optional deps.
+ [
+ [
+ 'm1' => [
+ 'dependencies' => [
+ 'optional' => ['m2'],
+ ],
+ 'result_requirements' => [],
+ ],
+ 'm2' => [
+ 'dependencies' => [],
+ 'result_requirements' => [],
+ ],
+ ],
+ ['m2', 'm1'],
+ ],
+ ];
+ }
+
+}
+
+/**
+ * A mock migration plugin.
+ *
+ * Why are we using a custom class here?
+ *
+ * 1. The function buildDependencyMigration() calls $migration->set(), which
+ * is not actually in MigrationInterface.
+ *
+ * 2. The function buildDependencyMigration() calls array_multisort on an
+ * array with mocks in it. PHPUnit mocks are really complex, and if PHP tries
+ * to compare them it will die with "Nesting level too deep".
+ */
+class TestMigrationMock extends Migration {
+ /**
+ * The values passed into set().
+ *
+ * @var array $set
+ */
+ public $set = [];
+
+ /**
+ * TestMigrationMock constructor.
+ */
+ public function __construct($id, $dependencies) {
+ // Intentionally ignore parent constructor.
+ $this->id = $id;
+ $this->dependencies = $dependencies;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function id() {
+ return $this->id;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getMigrationDependencies() {
+ return $this->dependencies;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function set($prop, $value) {
+ $this->set[] = func_get_args();
+ }
+
+}
diff --git a/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php b/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php
index d08e035ab..da20b4920 100644
--- a/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php
+++ b/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php
@@ -115,4 +115,5 @@ class EntityTestDestination extends EntityContentBase {
protected function getEntity(Row $row, array $old_destination_id_values) {
return $this->entity;
}
+
}
diff --git a/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php b/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php
index c12478b8c..1be14bc56 100644
--- a/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php
+++ b/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php
@@ -63,4 +63,5 @@ class TestPerComponentEntityDisplay extends ComponentEntityDisplayBase {
public function getTestValues() {
return $this->testValues;
}
+
}
diff --git a/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php b/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php
index a99af4240..18df3621a 100644
--- a/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php
+++ b/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php
@@ -63,4 +63,5 @@ class TestPerComponentEntityFormDisplay extends PerComponentEntityFormDisplay {
public function getTestValues() {
return $this->testValues;
}
+
}
diff --git a/core/modules/migrate/tests/src/Unit/process/ConcatTest.php b/core/modules/migrate/tests/src/Unit/process/ConcatTest.php
index d13c33b80..1d0d4c377 100644
--- a/core/modules/migrate/tests/src/Unit/process/ConcatTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/ConcatTest.php
@@ -49,6 +49,7 @@ class ConcatTest extends MigrateProcessTestCase {
$value = $this->plugin->transform(array('foo', 'bar'), $this->migrateExecutable, $this->row, 'destinationproperty');
$this->assertSame($value, 'foo_bar');
}
+
}
class TestConcat extends Concat {
diff --git a/core/modules/migrate/tests/src/Unit/process/DedupeEntityTest.php b/core/modules/migrate/tests/src/Unit/process/DedupeEntityTest.php
index 27aad89b7..a1960deab 100644
--- a/core/modules/migrate/tests/src/Unit/process/DedupeEntityTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/DedupeEntityTest.php
@@ -160,4 +160,5 @@ class DedupeEntityTest extends MigrateProcessTestCase {
->method('execute')
->will($this->returnCallback(function () use (&$count) { return $count--;}));
}
+
}
diff --git a/core/modules/migrate/tests/src/Unit/process/GetTest.php b/core/modules/migrate/tests/src/Unit/process/GetTest.php
index bdbb551e5..316cbfc5c 100644
--- a/core/modules/migrate/tests/src/Unit/process/GetTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/GetTest.php
@@ -114,4 +114,5 @@ class TestGet extends Get {
public function setSource($source) {
$this->configuration['source'] = $source;
}
+
}
diff --git a/core/modules/migrate/tests/src/Unit/process/IteratorTest.php b/core/modules/migrate/tests/src/Unit/process/IteratorTest.php
index 48f564785..7c731a2e0 100644
--- a/core/modules/migrate/tests/src/Unit/process/IteratorTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/IteratorTest.php
@@ -78,4 +78,5 @@ class IteratorTest extends MigrateTestCase {
$this->assertSame($new_value[42]['foo'], 'test');
$this->assertSame($new_value[42]['id'], 42);
}
+
}
diff --git a/core/modules/migrate/tests/src/Unit/process/MachineNameTest.php b/core/modules/migrate/tests/src/Unit/process/MachineNameTest.php
index d11c65702..7f44157f3 100644
--- a/core/modules/migrate/tests/src/Unit/process/MachineNameTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/MachineNameTest.php
@@ -44,7 +44,7 @@ class MachineNameTest extends MigrateProcessTestCase {
// - Uppercase -> lowercase,
// - Multiple consecutive underscore -> single underscore.
$human_name_ascii = 'foo2, the.bar;2*&the%baz!YEE____HaW ';
- $human_name = $human_name_ascii .'áéő';
+ $human_name = $human_name_ascii . 'áéő';
$expected_result = 'foo2_the_bar_2_the_baz_yee_haw_aeo';
// Test for calling transliterate on mock object.
$this->transliteration
diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/cckfield/CckFieldPluginBase.php b/core/modules/migrate_drupal/src/Plugin/migrate/cckfield/CckFieldPluginBase.php
index abe3d0439..87d545730 100644
--- a/core/modules/migrate_drupal/src/Plugin/migrate/cckfield/CckFieldPluginBase.php
+++ b/core/modules/migrate_drupal/src/Plugin/migrate/cckfield/CckFieldPluginBase.php
@@ -17,7 +17,7 @@ use Drupal\migrate_drupal\Plugin\MigrateCckFieldInterface;
*
* @ingroup migration
*/
-abstract class CckFieldPluginBase extends PluginBase implements MigrateCckFieldInterface {
+abstract class CckFieldPluginBase extends PluginBase implements MigrateCckFieldInterface {
/**
* {@inheritdoc}
diff --git a/core/modules/migrate_drupal/tests/src/Unit/source/d6/Drupal6SqlBaseTest.php b/core/modules/migrate_drupal/tests/src/Unit/source/d6/Drupal6SqlBaseTest.php
index 0a43d30de..e27a35310 100644
--- a/core/modules/migrate_drupal/tests/src/Unit/source/d6/Drupal6SqlBaseTest.php
+++ b/core/modules/migrate_drupal/tests/src/Unit/source/d6/Drupal6SqlBaseTest.php
@@ -125,6 +125,7 @@ class Drupal6SqlBaseTest extends MigrateTestCase {
// Test non-default.
$this->assertSame(TRUE, $this->base->variableGetWrapper('my_variable', FALSE));
}
+
}
namespace Drupal\Tests\migrate_drupal\Unit\source\d6;
@@ -217,4 +218,5 @@ class TestDrupal6SqlBase extends DrupalSqlBase {
public function getIds() {
return array();
}
+
}
diff --git a/core/modules/migrate_drupal_ui/src/Tests/d6/MigrateUpgrade6Test.php b/core/modules/migrate_drupal_ui/src/Tests/d6/MigrateUpgrade6Test.php
index fd22c6ee4..d073c186d 100644
--- a/core/modules/migrate_drupal_ui/src/Tests/d6/MigrateUpgrade6Test.php
+++ b/core/modules/migrate_drupal_ui/src/Tests/d6/MigrateUpgrade6Test.php
@@ -43,7 +43,7 @@ class MigrateUpgrade6Test extends MigrateUpgradeTestBase {
'field_config' => 62,
'field_storage_config' => 43,
'file' => 7,
- 'filter_format' => 8,
+ 'filter_format' => 7,
'image_style' => 5,
'migration' => 105,
'node' => 9,
diff --git a/core/modules/node/src/Controller/NodeController.php b/core/modules/node/src/Controller/NodeController.php
index edb568231..9fbd60350 100644
--- a/core/modules/node/src/Controller/NodeController.php
+++ b/core/modules/node/src/Controller/NodeController.php
@@ -6,7 +6,6 @@ use Drupal\Component\Utility\Xss;
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Datetime\DateFormatterInterface;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
-use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Render\RendererInterface;
use Drupal\Core\Url;
use Drupal\node\NodeTypeInterface;
@@ -157,8 +156,8 @@ class NodeController extends ControllerBase implements ContainerInjectionInterfa
*/
public function revisionOverview(NodeInterface $node) {
$account = $this->currentUser();
- $langcode = $this->languageManager()->getCurrentLanguage(LanguageInterface::TYPE_CONTENT)->getId();
- $langname = $this->languageManager()->getLanguageName($langcode);
+ $langcode = $node->language()->getId();
+ $langname = $node->language()->getName();
$languages = $node->getTranslationLanguages();
$has_translations = (count($languages) > 1);
$node_storage = $this->entityManager()->getStorage('node');
@@ -179,6 +178,8 @@ class NodeController extends ControllerBase implements ContainerInjectionInterfa
foreach (array_reverse($vids) as $vid) {
/** @var \Drupal\node\NodeInterface $revision */
$revision = $node_storage->loadRevision($vid);
+ // Only show revisions that are affected by the language that is being
+ // displayed.
if ($revision->hasTranslation($langcode) && $revision->getTranslation($langcode)->isRevisionTranslationAffected()) {
$username = [
'#theme' => 'username',
diff --git a/core/modules/node/src/NodeStorageInterface.php b/core/modules/node/src/NodeStorageInterface.php
index 70562ff46..b09d7b767 100644
--- a/core/modules/node/src/NodeStorageInterface.php
+++ b/core/modules/node/src/NodeStorageInterface.php
@@ -64,4 +64,5 @@ interface NodeStorageInterface extends ContentEntityStorageInterface {
* The language object.
*/
public function clearRevisionsLanguage(LanguageInterface $language);
+
}
diff --git a/core/modules/node/src/NodeTypeInterface.php b/core/modules/node/src/NodeTypeInterface.php
index 7e657bddd..c034ffbee 100644
--- a/core/modules/node/src/NodeTypeInterface.php
+++ b/core/modules/node/src/NodeTypeInterface.php
@@ -80,4 +80,5 @@ interface NodeTypeInterface extends ConfigEntityInterface {
* The description of this node type.
*/
public function getDescription();
+
}
diff --git a/core/modules/node/src/Plugin/Condition/NodeType.php b/core/modules/node/src/Plugin/Condition/NodeType.php
index dccf5862e..ace42e620 100644
--- a/core/modules/node/src/Plugin/Condition/NodeType.php
+++ b/core/modules/node/src/Plugin/Condition/NodeType.php
@@ -18,7 +18,6 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
* "node" = @ContextDefinition("entity:node", label = @Translation("Node"))
* }
* )
- *
*/
class NodeType extends ConditionPluginBase implements ContainerFactoryPluginInterface {
diff --git a/core/modules/node/src/Plugin/Search/NodeSearch.php b/core/modules/node/src/Plugin/Search/NodeSearch.php
index 1a1f0529d..d161a0a0d 100644
--- a/core/modules/node/src/Plugin/Search/NodeSearch.php
+++ b/core/modules/node/src/Plugin/Search/NodeSearch.php
@@ -151,6 +151,8 @@ class NodeSearch extends ConfigurableSearchPluginBase implements AccessibleInter
* A config object for 'search.settings'.
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager.
+ * @param \Drupal\Core\Render\RendererInterface $renderer
+ * The renderer.
* @param \Drupal\Core\Session\AccountInterface $account
* The $account object to use for checking for access to advanced search.
*/
@@ -621,7 +623,7 @@ class NodeSearch extends ConfigurableSearchPluginBase implements AccessibleInter
}
}
- /*
+ /**
* {@inheritdoc}
*/
public function buildSearchUrlQuery(FormStateInterface $form_state) {
diff --git a/core/modules/node/src/Plugin/views/argument_default/Node.php b/core/modules/node/src/Plugin/views/argument_default/Node.php
index b65ed4128..e5149f652 100644
--- a/core/modules/node/src/Plugin/views/argument_default/Node.php
+++ b/core/modules/node/src/Plugin/views/argument_default/Node.php
@@ -35,7 +35,6 @@ class Node extends ArgumentDefaultPluginBase implements CacheableDependencyInter
* The plugin_id for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
- *
* @param \Drupal\Core\Routing\RouteMatchInterface $route_match
* The route match.
*/
diff --git a/core/modules/node/src/Plugin/views/field/RevisionLinkRevert.php b/core/modules/node/src/Plugin/views/field/RevisionLinkRevert.php
index 248b15ca9..33b20b888 100644
--- a/core/modules/node/src/Plugin/views/field/RevisionLinkRevert.php
+++ b/core/modules/node/src/Plugin/views/field/RevisionLinkRevert.php
@@ -29,4 +29,5 @@ class RevisionLinkRevert extends RevisionLink {
protected function getDefaultLabel() {
return $this->t('Revert');
}
+
}
diff --git a/core/modules/node/src/Plugin/views/row/Rss.php b/core/modules/node/src/Plugin/views/row/Rss.php
index c2a5f0a65..097655a20 100644
--- a/core/modules/node/src/Plugin/views/row/Rss.php
+++ b/core/modules/node/src/Plugin/views/row/Rss.php
@@ -22,12 +22,12 @@ use Drupal\views\Plugin\views\row\RssPluginBase;
class Rss extends RssPluginBase {
// Basic properties that let the row style follow relationships.
- var $base_table = 'node_field_data';
+ public $base_table = 'node_field_data';
- var $base_field = 'nid';
+ public $base_field = 'nid';
// Stores the nodes loaded with preRender.
- var $nodes = array();
+ public $nodes = array();
/**
* {@inheritdoc}
diff --git a/core/modules/node/src/Tests/AssertButtonsTrait.php b/core/modules/node/src/Tests/AssertButtonsTrait.php
index 89d3bcedf..58d484d9e 100644
--- a/core/modules/node/src/Tests/AssertButtonsTrait.php
+++ b/core/modules/node/src/Tests/AssertButtonsTrait.php
@@ -44,4 +44,5 @@ trait AssertButtonsTrait {
$this->assertNoRaw('dropbutton-wrapper');
}
}
+
}
diff --git a/core/modules/node/src/Tests/NodeAccessBaseTableTest.php b/core/modules/node/src/Tests/NodeAccessBaseTableTest.php
index e84fc0e99..74e2340ca 100644
--- a/core/modules/node/src/Tests/NodeAccessBaseTableTest.php
+++ b/core/modules/node/src/Tests/NodeAccessBaseTableTest.php
@@ -222,4 +222,5 @@ class NodeAccessBaseTableTest extends NodeTestBase {
}
}
}
+
}
diff --git a/core/modules/node/src/Tests/NodeAccessFieldTest.php b/core/modules/node/src/Tests/NodeAccessFieldTest.php
index e3a775414..dcfa43d9b 100644
--- a/core/modules/node/src/Tests/NodeAccessFieldTest.php
+++ b/core/modules/node/src/Tests/NodeAccessFieldTest.php
@@ -109,4 +109,5 @@ class NodeAccessFieldTest extends NodeTestBase {
$this->drupalGet('node/add/page');
$this->assertRaw($default, 'The updated default value is displayed when creating a new node.');
}
+
}
diff --git a/core/modules/node/src/Tests/NodeAccessPagerTest.php b/core/modules/node/src/Tests/NodeAccessPagerTest.php
index cfd351b51..7db264cd9 100644
--- a/core/modules/node/src/Tests/NodeAccessPagerTest.php
+++ b/core/modules/node/src/Tests/NodeAccessPagerTest.php
@@ -96,4 +96,5 @@ class NodeAccessPagerTest extends WebTestBase {
$this->assertRaw('page=1');
$this->assertNoRaw('page=2');
}
+
}
diff --git a/core/modules/node/src/Tests/NodeAccessRebuildTest.php b/core/modules/node/src/Tests/NodeAccessRebuildTest.php
index b6c3723f7..187f3a059 100644
--- a/core/modules/node/src/Tests/NodeAccessRebuildTest.php
+++ b/core/modules/node/src/Tests/NodeAccessRebuildTest.php
@@ -32,4 +32,5 @@ class NodeAccessRebuildTest extends NodeTestBase {
$this->drupalPostForm(NULL, array(), t('Rebuild permissions'));
$this->assertText(t('Content permissions have been rebuilt.'));
}
+
}
diff --git a/core/modules/node/src/Tests/NodeAccessRecordsTest.php b/core/modules/node/src/Tests/NodeAccessRecordsTest.php
index 9e05d84c7..412653905 100644
--- a/core/modules/node/src/Tests/NodeAccessRecordsTest.php
+++ b/core/modules/node/src/Tests/NodeAccessRecordsTest.php
@@ -80,4 +80,5 @@ class NodeAccessRecordsTest extends NodeTestBase {
$records = db_query('SELECT realm, gid FROM {node_access} WHERE nid = :nid', array(':nid' => $node6->id()))->fetchAll();
$this->assertEqual(count($records), 0, 'Returned no records for unpublished node.');
}
+
}
diff --git a/core/modules/node/src/Tests/NodeEditFormTest.php b/core/modules/node/src/Tests/NodeEditFormTest.php
index 659567dc8..b1ed31956 100644
--- a/core/modules/node/src/Tests/NodeEditFormTest.php
+++ b/core/modules/node/src/Tests/NodeEditFormTest.php
@@ -73,10 +73,8 @@ class NodeEditFormTest extends NodeTestBase {
$this->assertUrl($node->url('edit-form', ['absolute' => TRUE]));
// Check that the title and body fields are displayed with the correct values.
- // As you see the expected link text has no HTML, but we are using
- $link_text = 'Edit(active tab)';
// @todo Ideally assertLink would support HTML, but it doesn't.
- $this->assertRaw($link_text, 'Edit tab found and marked active.');
+ $this->assertRaw('Edit(active tab)', 'Edit tab found and marked active.');
$this->assertFieldByName($title_key, $edit[$title_key], 'Title field displayed.');
$this->assertFieldByName($body_key, $edit[$body_key], 'Body field displayed.');
diff --git a/core/modules/node/src/Tests/NodeEntityViewModeAlterTest.php b/core/modules/node/src/Tests/NodeEntityViewModeAlterTest.php
index 3ffd3a33b..25ae6b68b 100644
--- a/core/modules/node/src/Tests/NodeEntityViewModeAlterTest.php
+++ b/core/modules/node/src/Tests/NodeEntityViewModeAlterTest.php
@@ -46,4 +46,5 @@ class NodeEntityViewModeAlterTest extends NodeTestBase {
$build = $this->drupalBuildEntityView($node);
$this->assertEqual($build['#view_mode'], 'teaser', 'The view mode has correctly been set to teaser.');
}
+
}
diff --git a/core/modules/node/src/Tests/NodeFieldMultilingualTest.php b/core/modules/node/src/Tests/NodeFieldMultilingualTest.php
index e9a96a95c..9beae5df8 100644
--- a/core/modules/node/src/Tests/NodeFieldMultilingualTest.php
+++ b/core/modules/node/src/Tests/NodeFieldMultilingualTest.php
@@ -97,7 +97,7 @@ class NodeFieldMultilingualTest extends WebTestBase {
$this->assertRaw($body_value, 'Body correctly displayed using English as requested language');
}
- /*
+ /**
* Tests multilingual field display settings.
*/
function testMultilingualDisplaySettings() {
diff --git a/core/modules/node/src/Tests/NodeFormButtonsTest.php b/core/modules/node/src/Tests/NodeFormButtonsTest.php
index bf555d66f..9f6732bfc 100644
--- a/core/modules/node/src/Tests/NodeFormButtonsTest.php
+++ b/core/modules/node/src/Tests/NodeFormButtonsTest.php
@@ -131,4 +131,5 @@ class NodeFormButtonsTest extends NodeTestBase {
$node_3 = $node_storage->load(3);
$this->assertFalse($node_3->isPublished(), 'Node is unpublished');
}
+
}
diff --git a/core/modules/node/src/Tests/NodeFormSaveChangedTimeTest.php b/core/modules/node/src/Tests/NodeFormSaveChangedTimeTest.php
index 69f3963f2..aecf8a93e 100644
--- a/core/modules/node/src/Tests/NodeFormSaveChangedTimeTest.php
+++ b/core/modules/node/src/Tests/NodeFormSaveChangedTimeTest.php
@@ -68,4 +68,5 @@ class NodeFormSaveChangedTimeTest extends WebTestBase {
$node = entity_load('node', 1, TRUE);
$this->assertNotEqual($changed_timestamp, $node->getChangedTime(), "The entity's changed time was updated after form save without changes.");
}
+
}
diff --git a/core/modules/node/src/Tests/NodeHelpTest.php b/core/modules/node/src/Tests/NodeHelpTest.php
index 9ede4abcd..29460111c 100644
--- a/core/modules/node/src/Tests/NodeHelpTest.php
+++ b/core/modules/node/src/Tests/NodeHelpTest.php
@@ -73,4 +73,5 @@ class NodeHelpTest extends WebTestBase {
$this->assertResponse(200);
$this->assertText($this->testText);
}
+
}
diff --git a/core/modules/node/src/Tests/NodeLoadMultipleTest.php b/core/modules/node/src/Tests/NodeLoadMultipleTest.php
index d7c4360c3..31a30eea8 100644
--- a/core/modules/node/src/Tests/NodeLoadMultipleTest.php
+++ b/core/modules/node/src/Tests/NodeLoadMultipleTest.php
@@ -58,4 +58,5 @@ class NodeLoadMultipleTest extends NodeTestBase {
$this->assertTrue(is_object($node), 'Node is an object');
}
}
+
}
diff --git a/core/modules/node/src/Tests/NodePostSettingsTest.php b/core/modules/node/src/Tests/NodePostSettingsTest.php
index 3cfca2abb..bc3dd9943 100644
--- a/core/modules/node/src/Tests/NodePostSettingsTest.php
+++ b/core/modules/node/src/Tests/NodePostSettingsTest.php
@@ -54,4 +54,5 @@ class NodePostSettingsTest extends NodeTestBase {
$elements = $this->xpath('//div[contains(@class, :class)]', array(':class' => 'node__submitted'));
$this->assertEqual(count($elements), 0, 'Post information is not displayed.');
}
+
}
diff --git a/core/modules/node/src/Tests/NodeQueryAlterTest.php b/core/modules/node/src/Tests/NodeQueryAlterTest.php
index 2f1b11b8f..022625bdc 100644
--- a/core/modules/node/src/Tests/NodeQueryAlterTest.php
+++ b/core/modules/node/src/Tests/NodeQueryAlterTest.php
@@ -193,4 +193,5 @@ class NodeQueryAlterTest extends NodeTestBase {
}
\Drupal::state()->delete('node_access_test.no_access_uid');
}
+
}
diff --git a/core/modules/node/src/Tests/NodeRevisionPermissionsTest.php b/core/modules/node/src/Tests/NodeRevisionPermissionsTest.php
index 1f5c9b786..e000fb808 100644
--- a/core/modules/node/src/Tests/NodeRevisionPermissionsTest.php
+++ b/core/modules/node/src/Tests/NodeRevisionPermissionsTest.php
@@ -165,4 +165,5 @@ class NodeRevisionPermissionsTest extends NodeTestBase {
$this->assertFalse($node_revision_access->checkAccess($revision, $case['account'], $case['op']), "{$this->typeMap[$case['op']]} did not grant revision permission for articles.");
}
}
+
}
diff --git a/core/modules/node/src/Tests/NodeRevisionsAllTest.php b/core/modules/node/src/Tests/NodeRevisionsAllTest.php
index f7b81bcbe..582ca5bef 100644
--- a/core/modules/node/src/Tests/NodeRevisionsAllTest.php
+++ b/core/modules/node/src/Tests/NodeRevisionsAllTest.php
@@ -146,4 +146,5 @@ class NodeRevisionsAllTest extends NodeTestBase {
'%revision-date' => format_date($old_revision_date),
)));
}
+
}
diff --git a/core/modules/node/src/Tests/NodeRevisionsTest.php b/core/modules/node/src/Tests/NodeRevisionsTest.php
index a1047f59d..de8288e8d 100644
--- a/core/modules/node/src/Tests/NodeRevisionsTest.php
+++ b/core/modules/node/src/Tests/NodeRevisionsTest.php
@@ -42,6 +42,8 @@ class NodeRevisionsTest extends NodeTestBase {
protected function setUp() {
parent::setUp();
+ // Enable additional languages.
+ ConfigurableLanguage::createFromLangcode('de')->save();
ConfigurableLanguage::createFromLangcode('it')->save();
$field_storage_definition = array(
@@ -70,6 +72,7 @@ class NodeRevisionsTest extends NodeTestBase {
'edit any page content',
'delete any page content',
'translate any entity',
+ 'administer content types',
)
);
@@ -211,6 +214,60 @@ class NodeRevisionsTest extends NodeTestBase {
->fetchCol();
$default_revision_vid = $default_revision[0];
$this->assertTrue($new_node_revision->getRevisionId() > $default_revision_vid, 'Revision vid is greater than default revision vid.');
+
+ // Create an 'EN' node with a revision log message.
+ $node = $this->drupalCreateNode();
+ $node->title = 'Node title in EN';
+ $node->revision_log = 'Simple revision message (EN)';
+ $node->save();
+
+ $this->drupalGet("node/" . $node->id() . "/revisions");
+ $this->assertResponse(403);
+
+ // Create a new revision and new log message.
+ $node = Node::load($node->id());
+ $node->body->value = 'New text (EN)';
+ $node->revision_log = 'New revision message (EN)';
+ $node->setNewRevision();
+ $node->save();
+
+ // Check both revisions are shown on the node revisions overview page.
+ $this->drupalGet("node/" . $node->id() . "/revisions");
+ $this->assertText('Simple revision message (EN)');
+ $this->assertText('New revision message (EN)');
+
+ // Create an 'EN' node with a revision log message.
+ $node = $this->drupalCreateNode();
+ $node->langcode = 'en';
+ $node->title = 'Node title in EN';
+ $node->revision_log = 'Simple revision message (EN)';
+ $node->save();
+
+ $this->drupalGet("node/" . $node->id() . "/revisions");
+ $this->assertResponse(403);
+
+ // Add a translation in 'DE' and create a new revision and new log message.
+ $translation = $node->addTranslation('de');
+ $translation->title->value = 'Node title in DE';
+ $translation->body->value = 'New text (DE)';
+ $translation->revision_log = 'New revision message (DE)';
+ $translation->setNewRevision();
+ $translation->save();
+
+ // View the revision UI in 'IT', only the original node revision is shown.
+ $this->drupalGet("it/node/" . $node->id() . "/revisions");
+ $this->assertText('Simple revision message (EN)');
+ $this->assertNoText('New revision message (DE)');
+
+ // View the revision UI in 'DE', only the translated node revision is shown.
+ $this->drupalGet("de/node/" . $node->id() . "/revisions");
+ $this->assertNoText('Simple revision message (EN)');
+ $this->assertText('New revision message (DE)');
+
+ // View the revision UI in 'EN', only the original node revision is shown.
+ $this->drupalGet("node/" . $node->id() . "/revisions");
+ $this->assertText('Simple revision message (EN)');
+ $this->assertNoText('New revision message (DE)');
}
/**
diff --git a/core/modules/node/src/Tests/NodeSaveTest.php b/core/modules/node/src/Tests/NodeSaveTest.php
index 9c7d70fd5..f01724bbc 100644
--- a/core/modules/node/src/Tests/NodeSaveTest.php
+++ b/core/modules/node/src/Tests/NodeSaveTest.php
@@ -178,4 +178,5 @@ class NodeSaveTest extends NodeTestBase {
$node = $this->drupalCreateNode(array('title' => 'new'));
$this->assertEqual($node->getTitle(), 'Node ' . $node->id(), 'Node saved on node insert.');
}
+
}
diff --git a/core/modules/node/src/Tests/NodeTitleTest.php b/core/modules/node/src/Tests/NodeTitleTest.php
index 93a02d835..59ee02149 100644
--- a/core/modules/node/src/Tests/NodeTitleTest.php
+++ b/core/modules/node/src/Tests/NodeTitleTest.php
@@ -41,7 +41,7 @@ class NodeTitleTest extends NodeTestBase {
}
/**
- * Creates one node and tests if the node title has the correct value.
+ * Creates one node and tests if the node title has the correct value.
*/
function testNodeTitle() {
// Create "Basic page" content with title.
@@ -56,7 +56,7 @@ class NodeTitleTest extends NodeTestBase {
// Test tag.
$this->drupalGet('node/' . $node->id());
$xpath = '//title';
- $this->assertEqual(current($this->xpath($xpath)), $node->label() .' | Drupal', 'Page title is equal to node title.', 'Node');
+ $this->assertEqual(current($this->xpath($xpath)), $node->label() . ' | Drupal', 'Page title is equal to node title.', 'Node');
// Test breadcrumb in comment preview.
$this->drupalGet('comment/reply/node/' . $node->id() . '/comment');
@@ -99,4 +99,5 @@ class NodeTitleTest extends NodeTestBase {
$this->assertTitle($edge_case_title_escaped . ' | Drupal', 'Page title is equal to article\'s "title".', 'Node');
}
+
}
diff --git a/core/modules/node/src/Tests/NodeTitleXSSTest.php b/core/modules/node/src/Tests/NodeTitleXSSTest.php
index 2a3e94f1a..c41027514 100644
--- a/core/modules/node/src/Tests/NodeTitleXSSTest.php
+++ b/core/modules/node/src/Tests/NodeTitleXSSTest.php
@@ -38,4 +38,5 @@ class NodeTitleXSSTest extends NodeTestBase {
$this->drupalGet('node/' . $node->id() . '/edit');
$this->assertNoRaw($xss, 'Harmful tags are escaped when editing a node.');
}
+
}
diff --git a/core/modules/node/src/Tests/PageViewTest.php b/core/modules/node/src/Tests/PageViewTest.php
index 6cac96325..086b3e17c 100644
--- a/core/modules/node/src/Tests/PageViewTest.php
+++ b/core/modules/node/src/Tests/PageViewTest.php
@@ -38,4 +38,5 @@ class PageViewTest extends NodeTestBase {
$this->drupalGet("node/" . $node->id() . "/edit");
$this->assertResponse(200);
}
+
}
diff --git a/core/modules/node/src/Tests/Views/BulkFormAccessTest.php b/core/modules/node/src/Tests/Views/BulkFormAccessTest.php
index d24539973..050068b25 100644
--- a/core/modules/node/src/Tests/Views/BulkFormAccessTest.php
+++ b/core/modules/node/src/Tests/Views/BulkFormAccessTest.php
@@ -169,4 +169,5 @@ class BulkFormAccessTest extends NodeTestBase {
$own_node = Node::load($own_node->id());
$this->assertNull($own_node, 'The own node is deleted.');
}
+
}
diff --git a/core/modules/node/src/Tests/Views/NodeFieldFilterTest.php b/core/modules/node/src/Tests/Views/NodeFieldFilterTest.php
index 682280761..6b6d5e246 100644
--- a/core/modules/node/src/Tests/Views/NodeFieldFilterTest.php
+++ b/core/modules/node/src/Tests/Views/NodeFieldFilterTest.php
@@ -105,4 +105,5 @@ class NodeFieldFilterTest extends NodeTestBase {
$this->assertEqual(substr_count($text, $this->nodeTitles[$langcode]), 2 * $count, 'Translation ' . $langcode . ' has count ' . $count . ' with ' . $message);
}
}
+
}
diff --git a/core/modules/node/tests/modules/node_test/node_test.module b/core/modules/node/tests/modules/node_test/node_test.module
index ab1777ea1..00cff3b95 100644
--- a/core/modules/node/tests/modules/node_test/node_test.module
+++ b/core/modules/node/tests/modules/node_test/node_test.module
@@ -170,7 +170,7 @@ function node_test_entity_view_mode_alter(&$view_mode, EntityInterface $entity,
function node_test_node_insert(NodeInterface $node) {
// Set the node title to the node ID and save.
if ($node->getTitle() == 'new') {
- $node->setTitle('Node '. $node->id());
+ $node->setTitle('Node ' . $node->id());
$node->setNewRevision(FALSE);
$node->save();
}
diff --git a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php
index 24676ddf5..60fb6be81 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php
@@ -13,7 +13,7 @@ use Drupal\node\NodeInterface;
*/
class MigrateNodeTest extends MigrateDrupal7TestBase {
- static $modules = array(
+ public static $modules = array(
'comment',
'datetime',
'filter',
diff --git a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTypeTest.php b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTypeTest.php
index 118b08a4e..8b98ec304 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTypeTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTypeTest.php
@@ -35,6 +35,7 @@ class MigrateNodeTypeTest extends MigrateDrupal7TestBase {
* Tests a single node type.
*
* @dataProvider testNodeTypeDataProvider
+ *
* @param string $id
* The node type ID.
* @param string $label
diff --git a/core/modules/node/tests/src/Kernel/NodeConditionTest.php b/core/modules/node/tests/src/Kernel/NodeConditionTest.php
index 07986cc6a..7636d5298 100644
--- a/core/modules/node/tests/src/Kernel/NodeConditionTest.php
+++ b/core/modules/node/tests/src/Kernel/NodeConditionTest.php
@@ -79,4 +79,5 @@ class NodeConditionTest extends EntityKernelTestBase {
$condition = $manager->createInstance('node_type', array('bundles' => array('article' => 'article'), 'context' => array('node' => $article)));
$this->assertTrue($condition->execute(), 'Constructor injection of context and configuration working as anticipated.');
}
+
}
diff --git a/core/modules/node/tests/src/Kernel/NodeValidationTest.php b/core/modules/node/tests/src/Kernel/NodeValidationTest.php
index ae0bf0144..9fd646e61 100644
--- a/core/modules/node/tests/src/Kernel/NodeValidationTest.php
+++ b/core/modules/node/tests/src/Kernel/NodeValidationTest.php
@@ -68,4 +68,5 @@ class NodeValidationTest extends EntityKernelTestBase {
$this->assertEqual($violations[0]->getPropertyPath(), '');
$this->assertEqual($violations[0]->getMessage(), 'The content has either been modified by another user, or you have already submitted modifications. As a result, your changes cannot be saved.');
}
+
}
diff --git a/core/modules/node/tests/src/Kernel/Views/RevisionCreateTimestampTest.php b/core/modules/node/tests/src/Kernel/Views/RevisionCreateTimestampTest.php
index 8ceb7a7ea..287bf4839 100644
--- a/core/modules/node/tests/src/Kernel/Views/RevisionCreateTimestampTest.php
+++ b/core/modules/node/tests/src/Kernel/Views/RevisionCreateTimestampTest.php
@@ -71,5 +71,4 @@ class RevisionCreateTimestampTest extends ViewsKernelTestBase {
], ['vid' => 'vid', 'revision_timestamp' => 'revision_timestamp']);
}
-
}
diff --git a/core/modules/options/options.api.php b/core/modules/options/options.api.php
index f17f102ce..a4ac605d4 100644
--- a/core/modules/options/options.api.php
+++ b/core/modules/options/options.api.php
@@ -18,7 +18,6 @@ use Drupal\Core\Field\FieldStorageDefinitionInterface;
* \Drupal\Core\TypedData\OptionsProviderInterface::getSettableOptions(). An
* empty option (_none) might have been added, depending on the field
* properties.
- *
* @param array $context
* An associative array containing:
* - field_definition: The field definition
diff --git a/core/modules/options/src/Tests/OptionsDynamicValuesTestBase.php b/core/modules/options/src/Tests/OptionsDynamicValuesTestBase.php
index 9015758bc..2d3f0fbed 100644
--- a/core/modules/options/src/Tests/OptionsDynamicValuesTestBase.php
+++ b/core/modules/options/src/Tests/OptionsDynamicValuesTestBase.php
@@ -75,4 +75,5 @@ abstract class OptionsDynamicValuesTestBase extends FieldTestBase {
'uri' => $this->entity->url(),
];
}
+
}
diff --git a/core/modules/options/src/Tests/OptionsSelectDynamicValuesTest.php b/core/modules/options/src/Tests/OptionsSelectDynamicValuesTest.php
index 4c571a8ee..df3365ca0 100644
--- a/core/modules/options/src/Tests/OptionsSelectDynamicValuesTest.php
+++ b/core/modules/options/src/Tests/OptionsSelectDynamicValuesTest.php
@@ -30,4 +30,5 @@ class OptionsSelectDynamicValuesTest extends OptionsDynamicValuesTestBase {
}
}
}
+
}
diff --git a/core/modules/options/tests/options_test/options_test.module b/core/modules/options/tests/options_test/options_test.module
index 59b8e1c26..d20401af6 100644
--- a/core/modules/options/tests/options_test/options_test.module
+++ b/core/modules/options/tests/options_test/options_test.module
@@ -11,7 +11,7 @@ use Drupal\Core\Field\FieldStorageDefinitionInterface;
/**
* Implements callback_allowed_values_function().
*
- * @see options_allowed_values().
+ * @see options_allowed_values()
*/
function options_test_allowed_values_callback(FieldStorageDefinitionInterface $definition, FieldableEntityInterface $entity = NULL) {
$values = array(
@@ -38,7 +38,7 @@ function options_test_allowed_values_callback(FieldStorageDefinitionInterface $d
* NULL. Since this is not yet used for testing Views integration, that is
* alright for now. Fix this in https://www.drupal.org/node/2012130.
*
- * @see options_allowed_values().
+ * @see options_allowed_values()
*/
function options_test_dynamic_values_callback(FieldStorageDefinitionInterface $definition, FieldableEntityInterface $entity = NULL, &$cacheable = NULL) {
$values = array();
diff --git a/core/modules/options/tests/src/Kernel/OptionsFieldTest.php b/core/modules/options/tests/src/Kernel/OptionsFieldTest.php
index b3437f32b..89ac12716 100644
--- a/core/modules/options/tests/src/Kernel/OptionsFieldTest.php
+++ b/core/modules/options/tests/src/Kernel/OptionsFieldTest.php
@@ -96,4 +96,5 @@ class OptionsFieldTest extends OptionsFieldUnitTestBase {
$entity->{$this->fieldName}->generateSampleItems();
$this->entityValidateAndSave($entity);
}
+
}
diff --git a/core/modules/page_cache/page_cache.module b/core/modules/page_cache/page_cache.module
index 96abbcb18..3b8baf4ca 100644
--- a/core/modules/page_cache/page_cache.module
+++ b/core/modules/page_cache/page_cache.module
@@ -23,7 +23,7 @@ function page_cache_help($route_name, RouteMatchInterface $route_match) {
$output .= '
' . t('Pages are usually identical for all anonymous users, while they can be personalized for each authenticated user. This is why entire pages can be cached for anonymous users, whereas they will have to be rebuilt for every authenticated user.') . '
';
$output .= '
' . t('To speed up your site for authenticated users, see the Dynamic Page Cache module.', [':dynamic_page_cache-help' => (\Drupal::moduleHandler()->moduleExists('dynamic_page_cache')) ? Url::fromRoute('help.page', ['name' => 'dynamic_page_cache'])->toString() : '#']) . '';
$output .= '
' . t('Configuring the internal page cache') . '
';
- $output .= '
' . t('On the Performance page, you can configure how long browsers and proxies may cache pages; that setting is also respected by the Internal Page Cache module. There is no other configuration.', array(':cache-settings' => \Drupal::url('system.performance_settings'))) . '
';
+ $output .= '
' . t('On the Performance page, you can configure how long browsers and proxies may cache pages; that setting is also respected by the Internal Page Cache module. There is no other configuration.', array(':cache-settings' => \Drupal::url('system.performance_settings'))) . '
';
$output .= '';
return $output;
diff --git a/core/modules/path/path.module b/core/modules/path/path.module
index 06efa7bfe..3d7f1d053 100644
--- a/core/modules/path/path.module
+++ b/core/modules/path/path.module
@@ -38,7 +38,7 @@ function path_help($route_name, RouteMatchInterface $route_match) {
}
/**
- * Implements hook_form_BASE_FORM_ID_alter() for node_form().
+ * Implements hook_form_BASE_FORM_ID_alter() for \Drupal\node\NodeForm.
*/
function path_form_node_form_alter(&$form, FormStateInterface $form_state) {
$node = $form_state->getFormObject()->getEntity();
diff --git a/core/modules/path/src/Plugin/Field/FieldType/PathItem.php b/core/modules/path/src/Plugin/Field/FieldType/PathItem.php
index 4a1a779d3..ef9a2d178 100644
--- a/core/modules/path/src/Plugin/Field/FieldType/PathItem.php
+++ b/core/modules/path/src/Plugin/Field/FieldType/PathItem.php
@@ -90,4 +90,11 @@ class PathItem extends FieldItemBase {
return $values;
}
+ /**
+ * {@inheritdoc}
+ */
+ public static function mainPropertyName() {
+ return 'alias';
+ }
+
}
diff --git a/core/modules/path/src/Tests/PathAliasTest.php b/core/modules/path/src/Tests/PathAliasTest.php
index e6b17385b..df4e18db6 100644
--- a/core/modules/path/src/Tests/PathAliasTest.php
+++ b/core/modules/path/src/Tests/PathAliasTest.php
@@ -59,7 +59,7 @@ class PathAliasTest extends PathTestBase {
// @todo Remove this once https://www.drupal.org/node/2480077 lands.
Cache::invalidateTags(['rendered']);
$this->drupalGet(trim($edit['alias'], '/'));
- $this->assertTrue(\Drupal::cache('data')->get('preload-paths:' . $edit['source']), 'Cache entry was created.');
+ $this->assertTrue(\Drupal::cache('data')->get('preload-paths:' . $edit['source']), 'Cache entry was created.');
}
/**
@@ -345,4 +345,5 @@ class PathAliasTest extends PathTestBase {
$this->assertText(t('The alias is already in use.'));
$this->assertFieldByXPath("//input[@name='path[0][alias]' and contains(@class, 'error')]", $edit['path[0][alias]'], 'Textfield exists and has the error class.');
}
+
}
diff --git a/core/modules/path/src/Tests/PathLanguageTest.php b/core/modules/path/src/Tests/PathLanguageTest.php
index 028d3593d..695f6be61 100644
--- a/core/modules/path/src/Tests/PathLanguageTest.php
+++ b/core/modules/path/src/Tests/PathLanguageTest.php
@@ -187,4 +187,5 @@ class PathLanguageTest extends PathTestBase {
$english_node->save();
$this->assertFalse($this->container->get('path.alias_storage')->aliasExists('/' . $french_alias, 'fr'), 'Alias for French translation is removed when translation is deleted.');
}
+
}
diff --git a/core/modules/path/src/Tests/PathLanguageUiTest.php b/core/modules/path/src/Tests/PathLanguageUiTest.php
index 9ff0ea2ee..540cc85db 100644
--- a/core/modules/path/src/Tests/PathLanguageUiTest.php
+++ b/core/modules/path/src/Tests/PathLanguageUiTest.php
@@ -77,4 +77,5 @@ class PathLanguageUiTest extends PathTestBase {
$this->drupalGet('fr/' . $name);
$this->assertText(t('Filter aliases'), 'Foreign URL alias works');
}
+
}
diff --git a/core/modules/path/src/Tests/PathTaxonomyTermTest.php b/core/modules/path/src/Tests/PathTaxonomyTermTest.php
index faeceabc7..f62fb6c4c 100644
--- a/core/modules/path/src/Tests/PathTaxonomyTermTest.php
+++ b/core/modules/path/src/Tests/PathTaxonomyTermTest.php
@@ -82,4 +82,5 @@ class PathTaxonomyTermTest extends PathTestBase {
$this->assertNoText($description, 'Old URL alias has been removed after altering.');
$this->assertResponse(404, 'Old URL alias returns 404.');
}
+
}
diff --git a/core/modules/path/src/Tests/PathTestBase.php b/core/modules/path/src/Tests/PathTestBase.php
index c16c4d149..c4a88af7d 100644
--- a/core/modules/path/src/Tests/PathTestBase.php
+++ b/core/modules/path/src/Tests/PathTestBase.php
@@ -25,4 +25,5 @@ abstract class PathTestBase extends WebTestBase {
$this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article'));
}
}
+
}
diff --git a/core/modules/quickedit/src/Tests/QuickEditAutocompleteTermTest.php b/core/modules/quickedit/src/Tests/QuickEditAutocompleteTermTest.php
index a88490a7d..aa46a77bf 100644
--- a/core/modules/quickedit/src/Tests/QuickEditAutocompleteTermTest.php
+++ b/core/modules/quickedit/src/Tests/QuickEditAutocompleteTermTest.php
@@ -128,7 +128,7 @@ class QuickEditAutocompleteTermTest extends WebTestBase {
public function testAutocompleteQuickEdit() {
$this->drupalLogin($this->editorUser);
- $quickedit_uri = 'quickedit/form/node/'. $this->node->id() . '/' . $this->fieldName . '/' . $this->node->language()->getId() . '/full';
+ $quickedit_uri = 'quickedit/form/node/' . $this->node->id() . '/' . $this->fieldName . '/' . $this->node->language()->getId() . '/full';
$post = array('nocssjs' => 'true') + $this->getAjaxPageStatePostData();
$response = $this->drupalPost($quickedit_uri, 'application/vnd.drupal-ajax', $post);
$ajax_commands = Json::decode($response);
@@ -159,7 +159,7 @@ class QuickEditAutocompleteTermTest extends WebTestBase {
// Load the form again, which should now get it back from
// PrivateTempStore.
- $quickedit_uri = 'quickedit/form/node/'. $this->node->id() . '/' . $this->fieldName . '/' . $this->node->language()->getId() . '/full';
+ $quickedit_uri = 'quickedit/form/node/' . $this->node->id() . '/' . $this->fieldName . '/' . $this->node->language()->getId() . '/full';
$post = array('nocssjs' => 'true') + $this->getAjaxPageStatePostData();
$response = $this->drupalPost($quickedit_uri, 'application/vnd.drupal-ajax', $post);
$ajax_commands = Json::decode($response);
diff --git a/core/modules/quickedit/src/Tests/QuickEditLoadingTest.php b/core/modules/quickedit/src/Tests/QuickEditLoadingTest.php
index b9ebf1228..6baaed354 100644
--- a/core/modules/quickedit/src/Tests/QuickEditLoadingTest.php
+++ b/core/modules/quickedit/src/Tests/QuickEditLoadingTest.php
@@ -559,4 +559,5 @@ class QuickEditLoadingTest extends WebTestBase {
$ajax_commands = Json::decode($response);
$this->assertIdentical('