diff --git a/core/modules/aggregator/src/Entity/Feed.php b/core/modules/aggregator/src/Entity/Feed.php index 4c3a5b856e..8f41ffc702 100644 --- a/core/modules/aggregator/src/Entity/Feed.php +++ b/core/modules/aggregator/src/Entity/Feed.php @@ -169,7 +169,23 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { ->setDisplayConfigurable('form', TRUE) ->addConstraint('FeedUrl'); - $intervals = [900, 1800, 3600, 7200, 10800, 21600, 32400, 43200, 64800, 86400, 172800, 259200, 604800, 1209600, 2419200]; + $intervals = [ + 900, + 1800, + 3600, + 7200, + 10800, + 21600, + 32400, + 43200, + 64800, + 86400, + 172800, + 259200, + 604800, + 1209600, + 2419200, + ]; $period = array_map([\Drupal::service('date.formatter'), 'formatInterval'], array_combine($intervals, $intervals)); $period[FeedStorageInterface::CLEAR_NEVER] = t('Never'); diff --git a/core/modules/aggregator/src/FeedForm.php b/core/modules/aggregator/src/FeedForm.php index 86978e346a..622f81a571 100644 --- a/core/modules/aggregator/src/FeedForm.php +++ b/core/modules/aggregator/src/FeedForm.php @@ -27,7 +27,11 @@ public function save(array $form, FormStateInterface $form_state) { $form_state->setRedirectUrl($feed->toUrl('canonical')); } else { - $this->logger('aggregator')->notice('Feed %feed added.', ['%feed' => $feed->label(), 'link' => Link::fromTextAndUrl($this->t('View'), new Url('aggregator.admin_overview'))->toString()]); + $this->logger('aggregator')->notice('Feed %feed added.', [ + '%feed' => $feed->label(), + 'link' => Link::fromTextAndUrl($this->t('View'), + new Url('aggregator.admin_overview'))->toString(), + ]); $this->messenger()->addStatus($this->t('The feed %feed has been added.', ['%feed' => $view_link])); } } diff --git a/core/modules/aggregator/src/Form/OpmlFeedAdd.php b/core/modules/aggregator/src/Form/OpmlFeedAdd.php index 19090ad039..9e0a26a4e6 100644 --- a/core/modules/aggregator/src/Form/OpmlFeedAdd.php +++ b/core/modules/aggregator/src/Form/OpmlFeedAdd.php @@ -66,7 +66,23 @@ public function getFormId() { * {@inheritdoc} */ public function buildForm(array $form, FormStateInterface $form_state) { - $intervals = [900, 1800, 3600, 7200, 10800, 21600, 32400, 43200, 64800, 86400, 172800, 259200, 604800, 1209600, 2419200]; + $intervals = [ + 900, + 1800, + 3600, + 7200, + 10800, + 21600, + 32400, + 43200, + 64800, + 86400, + 172800, + 259200, + 604800, + 1209600, + 2419200, + ]; $period = array_map([\Drupal::service('date.formatter'), 'formatInterval'], array_combine($intervals, $intervals)); $form['upload'] = [ diff --git a/core/modules/aggregator/tests/src/Functional/AggregatorTestBase.php b/core/modules/aggregator/tests/src/Functional/AggregatorTestBase.php index baac8f69bf..5371515139 100644 --- a/core/modules/aggregator/tests/src/Functional/AggregatorTestBase.php +++ b/core/modules/aggregator/tests/src/Functional/AggregatorTestBase.php @@ -27,7 +27,13 @@ * * @var array */ - public static $modules = ['block', 'node', 'aggregator', 'aggregator_test', 'views']; + public static $modules = [ + 'block', + 'node', + 'aggregator', + 'aggregator_test', + 'views', + ]; /** * {@inheritdoc} @@ -40,7 +46,12 @@ protected function setUp() { $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']); } - $this->adminUser = $this->drupalCreateUser(['access administration pages', 'administer news feeds', 'access news feeds', 'create article content']); + $this->adminUser = $this->drupalCreateUser([ + 'access administration pages', + 'administer news feeds', + 'access news feeds', + 'create article content', + ]); $this->drupalLogin($this->adminUser); $this->drupalPlaceBlock('local_tasks_block'); } diff --git a/core/modules/aggregator/tests/src/Functional/FeedLanguageTest.php b/core/modules/aggregator/tests/src/Functional/FeedLanguageTest.php index aeb7b99795..1f729cb1e2 100644 --- a/core/modules/aggregator/tests/src/Functional/FeedLanguageTest.php +++ b/core/modules/aggregator/tests/src/Functional/FeedLanguageTest.php @@ -55,7 +55,13 @@ protected function setUp() { * Tests creation of feeds with a language. */ public function testFeedLanguage() { - $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages', 'administer news feeds', 'access news feeds', 'create article content']); + $admin_user = $this->drupalCreateUser([ + 'administer languages', + 'access administration pages', + 'administer news feeds', + 'access news feeds', + 'create article content', + ]); $this->drupalLogin($admin_user); // Enable language selection for feeds. diff --git a/core/modules/aggregator/tests/src/Functional/ImportOpmlTest.php b/core/modules/aggregator/tests/src/Functional/ImportOpmlTest.php index 89cc07eaca..ba03d6e053 100644 --- a/core/modules/aggregator/tests/src/Functional/ImportOpmlTest.php +++ b/core/modules/aggregator/tests/src/Functional/ImportOpmlTest.php @@ -29,7 +29,12 @@ class ImportOpmlTest extends AggregatorTestBase { protected function setUp() { parent::setUp(); - $admin_user = $this->drupalCreateUser(['administer news feeds', 'access news feeds', 'create article content', 'administer blocks']); + $admin_user = $this->drupalCreateUser([ + 'administer news feeds', + 'access news feeds', + 'create article content', + 'administer blocks', + ]); $this->drupalLogin($admin_user); } diff --git a/core/modules/aggregator/tests/src/Kernel/Views/IntegrationTest.php b/core/modules/aggregator/tests/src/Kernel/Views/IntegrationTest.php index 7459cee66d..1b1029d87f 100644 --- a/core/modules/aggregator/tests/src/Kernel/Views/IntegrationTest.php +++ b/core/modules/aggregator/tests/src/Kernel/Views/IntegrationTest.php @@ -22,7 +22,14 @@ class IntegrationTest extends ViewsKernelTestBase { * * @var array */ - public static $modules = ['aggregator', 'aggregator_test_views', 'system', 'field', 'options', 'user']; + public static $modules = [ + 'aggregator', + 'aggregator_test_views', + 'system', + 'field', + 'options', + 'user', + ]; /** * Views used by this test. diff --git a/core/modules/aggregator/tests/src/Unit/Menu/AggregatorLocalTasksTest.php b/core/modules/aggregator/tests/src/Unit/Menu/AggregatorLocalTasksTest.php index d1f91dfe27..fe7b6e1a7f 100644 --- a/core/modules/aggregator/tests/src/Unit/Menu/AggregatorLocalTasksTest.php +++ b/core/modules/aggregator/tests/src/Unit/Menu/AggregatorLocalTasksTest.php @@ -47,7 +47,11 @@ public function getAggregatorAdminRoutes() { */ public function testAggregatorSourceLocalTasks($route) { $this->assertLocalTasks($route, [ - 0 => ['entity.aggregator_feed.canonical', 'entity.aggregator_feed.edit_form', 'entity.aggregator_feed.delete_form'], + 0 => [ + 'entity.aggregator_feed.canonical', + 'entity.aggregator_feed.edit_form', + 'entity.aggregator_feed.delete_form', + ], ]); } diff --git a/core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php b/core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php index a6918a2127..61b924b38b 100644 --- a/core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php +++ b/core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php @@ -84,7 +84,11 @@ public function testSettingsForm() { ]); $test_processor = $this->getMockBuilder('Drupal\aggregator_test\Plugin\aggregator\processor\TestProcessor') - ->setMethods(['buildConfigurationForm', 'validateConfigurationForm', 'submitConfigurationForm']) + ->setMethods([ + 'buildConfigurationForm', + 'validateConfigurationForm', + 'submitConfigurationForm', + ]) ->setConstructorArgs([[], 'aggregator_test', ['description' => ''], $this->configFactory]) ->getMock(); $test_processor->expects($this->at(0)) diff --git a/core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php b/core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php index 16446ad332..267903fd52 100644 --- a/core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php +++ b/core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php @@ -23,7 +23,12 @@ class BasicAuthTest extends BrowserTestBase { * * @var array */ - public static $modules = ['basic_auth', 'router_test', 'locale', 'basic_auth_test']; + public static $modules = [ + 'basic_auth', + 'router_test', + 'locale', + 'basic_auth_test', + ]; /** * {@inheritdoc} diff --git a/core/modules/big_pipe/src/Render/Placeholder/BigPipeStrategy.php b/core/modules/big_pipe/src/Render/Placeholder/BigPipeStrategy.php index 3e0f460e9a..af712f127c 100644 --- a/core/modules/big_pipe/src/Render/Placeholder/BigPipeStrategy.php +++ b/core/modules/big_pipe/src/Render/Placeholder/BigPipeStrategy.php @@ -277,7 +277,11 @@ protected static function generateBigPipePlaceholderId($original_placeholder, ar $callback = $placeholder_render_array['#lazy_builder'][0]; $arguments = $placeholder_render_array['#lazy_builder'][1]; $token = Crypt::hashBase64(serialize($placeholder_render_array)); - return UrlHelper::buildQuery(['callback' => $callback, 'args' => $arguments, 'token' => $token]); + return UrlHelper::buildQuery([ + 'callback' => $callback, + 'args' => $arguments, + 'token' => $token, + ]); } // When the placeholder's render array is not using a #lazy_builder, // anything could be in there: only #lazy_builder has a strict contract that diff --git a/core/modules/big_pipe/tests/modules/big_pipe_test/src/BigPipePlaceholderTestCases.php b/core/modules/big_pipe/tests/modules/big_pipe_test/src/BigPipePlaceholderTestCases.php index d1ba348e12..5cf86db811 100644 --- a/core/modules/big_pipe/tests/modules/big_pipe_test/src/BigPipePlaceholderTestCases.php +++ b/core/modules/big_pipe/tests/modules/big_pipe_test/src/BigPipePlaceholderTestCases.php @@ -242,7 +242,10 @@ public static function cases(ContainerInterface $container = NULL, AccountInterf ], '', [ - '#lazy_builder' => ['\Drupal\big_pipe_test\BigPipeTestController::exception', ['llamas', 'suck']], + '#lazy_builder' => [ + '\Drupal\big_pipe_test\BigPipeTestController::exception', + ['llamas', 'suck'], + ], ] ); $exception->bigPipePlaceholderId = 'callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3Aexception&args%5B0%5D=llamas&args%5B1%5D=suck&token=uhKFNfT4eF449_W-kDQX8E5z4yHyt0-nSHUlwaGAQeU'; diff --git a/core/modules/big_pipe/tests/modules/big_pipe_test/src/BigPipeTestController.php b/core/modules/big_pipe/tests/modules/big_pipe_test/src/BigPipeTestController.php index b15fa160ec..fe58d87d25 100644 --- a/core/modules/big_pipe/tests/modules/big_pipe_test/src/BigPipeTestController.php +++ b/core/modules/big_pipe/tests/modules/big_pipe_test/src/BigPipeTestController.php @@ -162,7 +162,13 @@ public static function counter() { * {@inheritdoc} */ public static function trustedCallbacks() { - return ['currentTime', 'helloOrYarhar', 'exception', 'responseException', 'counter']; + return [ + 'currentTime', + 'helloOrYarhar', + 'exception', + 'responseException', + 'counter', + ]; } } diff --git a/core/modules/big_pipe/tests/src/Unit/Render/BigPipeResponseAttachmentsProcessorTest.php b/core/modules/big_pipe/tests/src/Unit/Render/BigPipeResponseAttachmentsProcessorTest.php index 2f77684e55..c6b9535678 100644 --- a/core/modules/big_pipe/tests/src/Unit/Render/BigPipeResponseAttachmentsProcessorTest.php +++ b/core/modules/big_pipe/tests/src/Unit/Render/BigPipeResponseAttachmentsProcessorTest.php @@ -90,7 +90,16 @@ public function attachmentsProvider() { 'libraries + drupalSettings' => [['library' => ['core/drupal'], 'drupalSettings' => ['foo' => 'bar']]], ]; - $official_attachment_types = ['html_head', 'feed', 'html_head_link', 'http_header', 'library', 'placeholders', 'drupalSettings', 'html_response_attachment_placeholders']; + $official_attachment_types = [ + 'html_head', + 'feed', + 'html_head_link', + 'http_header', + 'library', + 'placeholders', + 'drupalSettings', + 'html_response_attachment_placeholders', + ]; $official_attachments_with_random_values = []; foreach ($official_attachment_types as $type) { $official_attachments_with_random_values[$type] = $this->randomMachineName(); diff --git a/core/modules/block/src/BlockViewBuilder.php b/core/modules/block/src/BlockViewBuilder.php index d8d2f23ff8..67e82079d1 100644 --- a/core/modules/block/src/BlockViewBuilder.php +++ b/core/modules/block/src/BlockViewBuilder.php @@ -73,7 +73,10 @@ public function viewMultiple(array $entities = [], $view_mode = 'full', $langcod // Assign a #lazy_builder callback, which will generate a #pre_render- // able block lazily (when necessary). $build[$entity_id] += [ - '#lazy_builder' => [static::class . '::lazyBuilder', [$entity_id, $view_mode, $langcode]], + '#lazy_builder' => [ + static::class . '::lazyBuilder', + [$entity_id, $view_mode, $langcode], + ], ]; } } diff --git a/core/modules/block/tests/src/Functional/BlockTestBase.php b/core/modules/block/tests/src/Functional/BlockTestBase.php index e1ccd1a365..1cb1a34dbf 100644 --- a/core/modules/block/tests/src/Functional/BlockTestBase.php +++ b/core/modules/block/tests/src/Functional/BlockTestBase.php @@ -15,7 +15,13 @@ * * @var array */ - public static $modules = ['block', 'filter', 'test_page_test', 'help', 'block_test']; + public static $modules = [ + 'block', + 'filter', + 'test_page_test', + 'help', + 'block_test', + ]; /** * A list of theme regions to test. diff --git a/core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php b/core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php index 211847c5d0..3b3770f638 100644 --- a/core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php +++ b/core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php @@ -31,7 +31,12 @@ class DisplayBlockTest extends ViewTestBase { * * @var array */ - public static $modules = ['node', 'block_test_views', 'test_page_test', 'contextual', 'views_ui']; + public static $modules = [ + 'node', 'block_test_views', + 'test_page_test', + 'contextual', + 'views_ui', + ]; /** * {@inheritdoc} diff --git a/core/modules/block/tests/src/Unit/BlockFormTest.php b/core/modules/block/tests/src/Unit/BlockFormTest.php index 47f9e7aec9..d1935f56a0 100644 --- a/core/modules/block/tests/src/Unit/BlockFormTest.php +++ b/core/modules/block/tests/src/Unit/BlockFormTest.php @@ -130,7 +130,12 @@ public function testGetUniqueMachineName() { $query->expects($this->exactly(5)) ->method('execute') - ->will($this->returnValue(['test', 'other_test', 'other_test_1', 'other_test_2'])); + ->will($this->returnValue([ + 'test', + 'other_test', + 'other_test_1', + 'other_test_2', + ])); $this->storage->expects($this->exactly(5)) ->method('getQuery') diff --git a/core/modules/block_content/tests/src/Functional/BlockContentCacheTagsTest.php b/core/modules/block_content/tests/src/Functional/BlockContentCacheTagsTest.php index c6778cab98..44d63678af 100644 --- a/core/modules/block_content/tests/src/Functional/BlockContentCacheTagsTest.php +++ b/core/modules/block_content/tests/src/Functional/BlockContentCacheTagsTest.php @@ -91,7 +91,10 @@ public function testBlock() { // Expected keys, contexts, and tags for the block. // @see \Drupal\block\BlockViewBuilder::viewMultiple() $expected_block_cache_keys = ['entity_view', 'block', $block->id()]; - $expected_block_cache_contexts = ['languages:' . LanguageInterface::TYPE_INTERFACE, 'theme', 'user.permissions']; + $expected_block_cache_contexts = [ + 'languages:' . LanguageInterface::TYPE_INTERFACE, + 'theme', 'user.permissions', + ]; $expected_block_cache_tags = Cache::mergeTags(['block_view', 'rendered'], $block->getCacheTags()); $expected_block_cache_tags = Cache::mergeTags($expected_block_cache_tags, $block->getPlugin()->getCacheTags()); diff --git a/core/modules/block_content/tests/src/Functional/Views/BlockContentFieldFilterTest.php b/core/modules/block_content/tests/src/Functional/Views/BlockContentFieldFilterTest.php index 2a612839af..643aeedf1c 100644 --- a/core/modules/block_content/tests/src/Functional/Views/BlockContentFieldFilterTest.php +++ b/core/modules/block_content/tests/src/Functional/Views/BlockContentFieldFilterTest.php @@ -60,7 +60,14 @@ public function setUp($import_test_views = TRUE) { ]; // Create block_content with translations. - $block_content = $this->createBlockContent(['info' => $this->blockContentInfos['en'], 'langcode' => 'en', 'type' => 'basic', 'body' => [['value' => $this->blockContentInfos['en']]]]); + $block_content = $this->createBlockContent([ + 'info' => $this->blockContentInfos['en'], + 'langcode' => 'en', + 'type' => 'basic', + 'body' => [ + ['value' => $this->blockContentInfos['en']], + ], + ]); foreach (['es', 'fr'] as $langcode) { $translation = $block_content->addTranslation($langcode, ['info' => $this->blockContentInfos[$langcode]]); $translation->body->value = $this->blockContentInfos[$langcode]; diff --git a/core/modules/book/book.install b/core/modules/book/book.install index 7704483365..3b437cf2e6 100644 --- a/core/modules/book/book.install +++ b/core/modules/book/book.install @@ -127,7 +127,18 @@ function book_schema() { ], 'primary key' => ['nid'], 'indexes' => [ - 'book_parents' => ['bid', 'p1', 'p2', 'p3', 'p4', 'p5', 'p6', 'p7', 'p8', 'p9'], + 'book_parents' => [ + 'bid', + 'p1', + 'p2', + 'p3', + 'p4', + 'p5', + 'p6', + 'p7', + 'p8', + 'p9', + ], ], ]; diff --git a/core/modules/book/book.module b/core/modules/book/book.module index 8bb1bb38a5..8c4ee6f303 100644 --- a/core/modules/book/book.module +++ b/core/modules/book/book.module @@ -443,7 +443,14 @@ function template_preprocess_book_navigation(&$variables) { $variables['has_links'] = FALSE; // Link variables to filter for values and set state of the flag variable. - $links = ['prev_url', 'prev_title', 'parent_url', 'parent_title', 'next_url', 'next_title']; + $links = [ + 'prev_url', + 'prev_title', + 'parent_url', + 'parent_title', + 'next_url', + 'next_title', + ]; foreach ($links as $link) { if (isset($variables[$link])) { // Flag when there is a value. diff --git a/core/modules/book/tests/src/Functional/BookBreadcrumbTest.php b/core/modules/book/tests/src/Functional/BookBreadcrumbTest.php index e539867a23..2eb2b2490a 100644 --- a/core/modules/book/tests/src/Functional/BookBreadcrumbTest.php +++ b/core/modules/book/tests/src/Functional/BookBreadcrumbTest.php @@ -53,8 +53,24 @@ protected function setUp() { $this->drupalPlaceBlock('page_title_block'); // Create users. - $this->bookAuthor = $this->drupalCreateUser(['create new books', 'create book content', 'edit own book content', 'add content to books']); - $this->adminUser = $this->drupalCreateUser(['create new books', 'create book content', 'edit any book content', 'delete any book content', 'add content to books', 'administer blocks', 'administer permissions', 'administer book outlines', 'administer content types', 'administer site configuration']); + $this->bookAuthor = $this->drupalCreateUser([ + 'create new books', + 'create book content', + 'edit own book content', + 'add content to books', + ]); + $this->adminUser = $this->drupalCreateUser([ + 'create new books', + 'create book content', + 'edit any book content', + 'delete any book content', + 'add content to books', + 'administer blocks', + 'administer permissions', + 'administer book outlines', + 'administer content types', + 'administer site configuration', + ]); } /** diff --git a/core/modules/book/tests/src/Functional/BookContentModerationTest.php b/core/modules/book/tests/src/Functional/BookContentModerationTest.php index 6a1ce9c78b..8762691e6d 100644 --- a/core/modules/book/tests/src/Functional/BookContentModerationTest.php +++ b/core/modules/book/tests/src/Functional/BookContentModerationTest.php @@ -41,7 +41,16 @@ protected function setUp() { $workflow->save(); // We need a user with additional content moderation permissions. - $this->bookAuthor = $this->drupalCreateUser(['create new books', 'create book content', 'edit own book content', 'add content to books', 'access printer-friendly version', 'view any unpublished content', 'use editorial transition create_new_draft', 'use editorial transition publish']); + $this->bookAuthor = $this->drupalCreateUser([ + 'create new books', + 'create book content', + 'edit own book content', + 'add content to books', + 'access printer-friendly version', + 'view any unpublished content', + 'use editorial transition create_new_draft', + 'use editorial transition publish', + ]); } /** diff --git a/core/modules/book/tests/src/Functional/BookTest.php b/core/modules/book/tests/src/Functional/BookTest.php index e1e81955d2..4ba1f28058 100644 --- a/core/modules/book/tests/src/Functional/BookTest.php +++ b/core/modules/book/tests/src/Functional/BookTest.php @@ -61,10 +61,32 @@ protected function setUp() { node_access_rebuild(); // Create users. - $this->bookAuthor = $this->drupalCreateUser(['create new books', 'create book content', 'edit own book content', 'add content to books']); - $this->webUser = $this->drupalCreateUser(['access printer-friendly version', 'node test view']); - $this->webUserWithoutNodeAccess = $this->drupalCreateUser(['access printer-friendly version']); - $this->adminUser = $this->drupalCreateUser(['create new books', 'create book content', 'edit any book content', 'delete any book content', 'add content to books', 'administer blocks', 'administer permissions', 'administer book outlines', 'node test view', 'administer content types', 'administer site configuration']); + $this->bookAuthor = $this->drupalCreateUser([ + 'create new books', + 'create book content', + 'edit own book content', + 'add content to books', + ]); + $this->webUser = $this->drupalCreateUser([ + 'access printer-friendly version', + 'node test view', + ]); + $this->webUserWithoutNodeAccess = $this->drupalCreateUser([ + 'access printer-friendly version', + ]); + $this->adminUser = $this->drupalCreateUser([ + 'create new books', + 'create book content', + 'edit any book content', + 'delete any book content', + 'add content to books', + 'administer blocks', + 'administer permissions', + 'administer book outlines', + 'node test view', + 'administer content types', + 'administer site configuration', + ]); } /** @@ -299,13 +321,27 @@ public function testGetTableOfContents() { /** @var \Drupal\book\BookManagerInterface $manager */ $manager = $this->container->get('book.manager'); $options = $manager->getTableOfContents($book->id(), 3); - $expected_nids = [$book->id(), $nodes[0]->id(), $nodes[1]->id(), $nodes[2]->id(), $nodes[3]->id(), $nodes[6]->id(), $nodes[4]->id()]; + $expected_nids = [ + $book->id(), + $nodes[0]->id(), + $nodes[1]->id(), + $nodes[2]->id(), + $nodes[3]->id(), + $nodes[6]->id(), + $nodes[4]->id(), + ]; $this->assertEqual(count($options), count($expected_nids)); $diff = array_diff($expected_nids, array_keys($options)); $this->assertTrue(empty($diff), 'Found all expected option keys'); // Exclude Node 3. $options = $manager->getTableOfContents($book->id(), 3, [$nodes[3]->id()]); - $expected_nids = [$book->id(), $nodes[0]->id(), $nodes[1]->id(), $nodes[2]->id(), $nodes[4]->id()]; + $expected_nids = [ + $book->id(), + $nodes[0]->id(), + $nodes[1]->id(), + $nodes[2]->id(), + $nodes[4]->id(), + ]; $this->assertEqual(count($options), count($expected_nids)); $diff = array_diff($expected_nids, array_keys($options)); $this->assertTrue(empty($diff), 'Found all expected option keys after excluding Node 3'); @@ -455,7 +491,15 @@ public function testSaveBookLink() { $book_manager = \Drupal::service('book.manager'); // Mock a link for a new book. - $link = ['nid' => 1, 'has_children' => 0, 'original_bid' => 0, 'parent_depth_limit' => 8, 'pid' => 0, 'weight' => 0, 'bid' => 1]; + $link = [ + 'nid' => 1, + 'has_children' => 0, + 'original_bid' => 0, + 'parent_depth_limit' => 8, + 'pid' => 0, + 'weight' => 0, + 'bid' => 1, + ]; $new = TRUE; // Save the link. @@ -555,7 +599,11 @@ public function testBookNavigationBlockOnUnpublishedBook() { $this->createBook(); // Create administrator user. - $administratorUser = $this->drupalCreateUser(['administer blocks', 'administer nodes', 'bypass node access']); + $administratorUser = $this->drupalCreateUser([ + 'administer blocks', + 'administer nodes', + 'bypass node access', + ]); $this->drupalLogin($administratorUser); // Enable the block with "Show block only on book pages" mode. diff --git a/core/modules/book/tests/src/Kernel/BookPendingRevisionTest.php b/core/modules/book/tests/src/Kernel/BookPendingRevisionTest.php index ababb3daaa..d20da61554 100644 --- a/core/modules/book/tests/src/Kernel/BookPendingRevisionTest.php +++ b/core/modules/book/tests/src/Kernel/BookPendingRevisionTest.php @@ -18,7 +18,15 @@ class BookPendingRevisionTest extends KernelTestBase { * * @var array */ - public static $modules = ['system', 'user', 'field', 'filter', 'text', 'node', 'book']; + public static $modules = [ + 'system', + 'user', + 'field', + 'filter', + 'text', + 'node', + 'book', + ]; /** * {@inheritdoc} diff --git a/core/modules/book/tests/src/Kernel/BookUninstallTest.php b/core/modules/book/tests/src/Kernel/BookUninstallTest.php index 13cbb42287..71af212568 100644 --- a/core/modules/book/tests/src/Kernel/BookUninstallTest.php +++ b/core/modules/book/tests/src/Kernel/BookUninstallTest.php @@ -18,7 +18,15 @@ class BookUninstallTest extends KernelTestBase { * * @var array */ - public static $modules = ['system', 'user', 'field', 'filter', 'text', 'node', 'book']; + public static $modules = [ + 'system', + 'user', + 'field', + 'filter', + 'text', + 'node', + 'book', + ]; /** * {@inheritdoc} diff --git a/core/modules/book/tests/src/Unit/Menu/BookLocalTasksTest.php b/core/modules/book/tests/src/Unit/Menu/BookLocalTasksTest.php index 7abbc5c0ea..f759f12057 100644 --- a/core/modules/book/tests/src/Unit/Menu/BookLocalTasksTest.php +++ b/core/modules/book/tests/src/Unit/Menu/BookLocalTasksTest.php @@ -48,7 +48,13 @@ public function getBookAdminRoutes() { */ public function testBookNodeLocalTasks($route) { $this->assertLocalTasks($route, [ - 0 => ['entity.node.book_outline_form', 'entity.node.canonical', 'entity.node.edit_form', 'entity.node.delete_form', 'entity.node.version_history'], + 0 => [ + 'entity.node.book_outline_form', + 'entity.node.canonical', + 'entity.node.edit_form', + 'entity.node.delete_form', + 'entity.node.version_history', + ], ]); } diff --git a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/DrupalImage.php b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/DrupalImage.php index 587cf85e78..d6ff514e7c 100644 --- a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/DrupalImage.php +++ b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/DrupalImage.php @@ -80,7 +80,13 @@ public function settingsForm(array $form, FormStateInterface $form_state, Editor * @see editor_image_upload_settings_form() */ public function validateImageUploadSettings(array $element, FormStateInterface $form_state) { - $settings = &$form_state->getValue(['editor', 'settings', 'plugins', 'drupalimage', 'image_upload']); + $settings = &$form_state->getValue([ + 'editor', + 'settings', + 'plugins', + 'drupalimage', + 'image_upload', + ]); $form_state->get('editor')->setImageUploadSettings($settings); $form_state->unsetValue(['editor', 'settings', 'plugins', 'drupalimage']); } diff --git a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php index ec286a68ec..83d37b67bb 100644 --- a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php +++ b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php @@ -105,7 +105,12 @@ public function getConfig(Editor $editor) { 'customConfig' => '', 'pasteFromWordPromptCleanup' => TRUE, 'resize_dir' => 'vertical', - 'justifyClasses' => ['text-align-left', 'text-align-center', 'text-align-right', 'text-align-justify'], + 'justifyClasses' => [ + 'text-align-left', + 'text-align-center', + 'text-align-right', + 'text-align-justify', + ], 'entities' => FALSE, 'disableNativeSpellChecker' => FALSE, ]; diff --git a/core/modules/ckeditor/tests/src/Kernel/CKEditorPluginManagerTest.php b/core/modules/ckeditor/tests/src/Kernel/CKEditorPluginManagerTest.php index 5664728ec3..2d403e3808 100644 --- a/core/modules/ckeditor/tests/src/Kernel/CKEditorPluginManagerTest.php +++ b/core/modules/ckeditor/tests/src/Kernel/CKEditorPluginManagerTest.php @@ -75,7 +75,19 @@ public function testEnabledPlugins() { // Case 2: CKEditor plugins are available. $plugin_ids = array_keys($this->manager->getDefinitions()); sort($plugin_ids); - $this->assertIdentical(['drupalimage', 'drupalimagecaption', 'drupallink', 'internal', 'language', 'llama', 'llama_button', 'llama_contextual', 'llama_contextual_and_button', 'llama_css', 'stylescombo'], $plugin_ids, 'Additional CKEditor plugins found.'); + $this->assertIdentical([ + 'drupalimage', + 'drupalimagecaption', + 'drupallink', + 'internal', + 'language', + 'llama', + 'llama_button', + 'llama_contextual', + 'llama_contextual_and_button', + 'llama_css', + 'stylescombo', + ], $plugin_ids, 'Additional CKEditor plugins found.'); $this->assertIdentical($enabled_plugins, $this->manager->getEnabledPluginFiles($editor), 'Only the internal plugins are enabled.'); $this->assertIdentical(['internal' => NULL] + $enabled_plugins, $this->manager->getEnabledPluginFiles($editor, TRUE), 'Only the "internal" plugin is enabled.'); diff --git a/core/modules/ckeditor/tests/src/Kernel/CKEditorTest.php b/core/modules/ckeditor/tests/src/Kernel/CKEditorTest.php index a3d3e41a5a..fc5452d3dd 100644 --- a/core/modules/ckeditor/tests/src/Kernel/CKEditorTest.php +++ b/core/modules/ckeditor/tests/src/Kernel/CKEditorTest.php @@ -19,7 +19,14 @@ class CKEditorTest extends KernelTestBase { * * @var array */ - public static $modules = ['system', 'user', 'filter', 'editor', 'ckeditor', 'filter_test']; + public static $modules = [ + 'system', + 'user', + 'filter', + 'editor', + 'ckeditor', + 'filter_test', + ]; /** * An instance of the "CKEditor" text editor plugin. @@ -122,10 +129,26 @@ public function testGetJSSettings() { $format->filters('filter_html')->settings['allowed_html'] .= '
 

'; $format->save(); - $expected_config['allowedContent']['pre'] = ['attributes' => 'class', 'styles' => FALSE, 'classes' => TRUE]; - $expected_config['allowedContent']['h1'] = ['attributes' => FALSE, 'styles' => FALSE, 'classes' => FALSE]; - $expected_config['allowedContent']['blockquote'] = ['attributes' => 'class', 'styles' => FALSE, 'classes' => TRUE]; - $expected_config['allowedContent']['address'] = ['attributes' => 'class', 'styles' => FALSE, 'classes' => 'foo,bar-*']; + $expected_config['allowedContent']['pre'] = [ + 'attributes' => 'class', + 'styles' => FALSE, + 'classes' => TRUE, + ]; + $expected_config['allowedContent']['h1'] = [ + 'attributes' => FALSE, + 'styles' => FALSE, + 'classes' => FALSE, + ]; + $expected_config['allowedContent']['blockquote'] = [ + 'attributes' => 'class', + 'styles' => FALSE, + 'classes' => TRUE, + ]; + $expected_config['allowedContent']['address'] = [ + 'attributes' => 'class', + 'styles' => FALSE, + 'classes' => 'foo,bar-*', + ]; $expected_config['format_tags'] = 'p;h1;h2;h3;h4;h5;h6;pre'; ksort($expected_config['allowedContent']); $this->assertIdentical($expected_config, $this->castSafeStrings($this->ckeditor->getJSSettings($editor)), 'Generated JS settings are correct for customized configuration.'); @@ -156,7 +179,11 @@ public function testGetJSSettings() { 'class' => ['dodo' => FALSE], 'property' => ['dc:*' => TRUE], 'rel' => ['foaf:*' => FALSE], - 'style' => ['underline' => FALSE, 'color' => FALSE, 'font-size' => TRUE], + 'style' => [ + 'underline' => FALSE, + 'color' => FALSE, + 'font-size' => TRUE, + ], ], '*' => [ 'style' => FALSE, @@ -435,7 +462,12 @@ protected function getDefaultInternalConfig() { 'customConfig' => '', 'pasteFromWordPromptCleanup' => TRUE, 'resize_dir' => 'vertical', - 'justifyClasses' => ['text-align-left', 'text-align-center', 'text-align-right', 'text-align-justify'], + 'justifyClasses' => [ + 'text-align-left', + 'text-align-center', + 'text-align-right', + 'text-align-justify', + ], 'entities' => FALSE, 'disableNativeSpellChecker' => FALSE, ]; diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index db68f43cd8..d44f1da388 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -439,7 +439,9 @@ function comment_node_search_result(EntityInterface $node) { // Do not make a string if there are no comment fields, or no comments exist // or all comment fields are hidden. if ($comments > 0 || $open) { - return ['comment' => \Drupal::translation()->formatPlural($comments, '1 comment', '@count comments')]; + return [ + 'comment' => \Drupal::translation()->formatPlural($comments, '1 comment', '@count comments'), + ]; } } diff --git a/core/modules/comment/src/CommentForm.php b/core/modules/comment/src/CommentForm.php index 48c72712df..21c42a8bbd 100644 --- a/core/modules/comment/src/CommentForm.php +++ b/core/modules/comment/src/CommentForm.php @@ -118,7 +118,11 @@ public function form(array $form, FormStateInterface $form_state) { // If not replying to a comment, use our dedicated page callback for new // Comments on entities. if (!$comment->id() && !$comment->hasParentComment()) { - $form['#action'] = Url::fromRoute('comment.reply', ['entity_type' => $entity->getEntityTypeId(), 'entity' => $entity->id(), 'field_name' => $field_name])->toString(); + $form['#action'] = Url::fromRoute('comment.reply', [ + 'entity_type' => $entity->getEntityTypeId(), + 'entity' => $entity->id(), + 'field_name' => $field_name, + ])->toString(); } $comment_preview = $form_state->get('comment_preview'); diff --git a/core/modules/comment/src/CommentLinkBuilder.php b/core/modules/comment/src/CommentLinkBuilder.php index 4725f88237..878f3329ad 100644 --- a/core/modules/comment/src/CommentLinkBuilder.php +++ b/core/modules/comment/src/CommentLinkBuilder.php @@ -212,7 +212,13 @@ public function buildCommentedEntityLinks(FieldableEntityInterface $entity, arra 'fragment' => 'new', ])->toString(), ]; - $parents = ['comment', 'newCommentsLinks', $entity->getEntityTypeId(), $field_name, $entity->id()]; + $parents = [ + 'comment', + 'newCommentsLinks', + $entity->getEntityTypeId(), + $field_name, + $entity->id(), + ]; NestedArray::setValue($entity_links['comment__' . $field_name]['#attached']['drupalSettings'], $parents, $value); } } diff --git a/core/modules/comment/src/CommentManager.php b/core/modules/comment/src/CommentManager.php index 41556aa759..50ef097d2d 100644 --- a/core/modules/comment/src/CommentManager.php +++ b/core/modules/comment/src/CommentManager.php @@ -169,10 +169,17 @@ public function forbiddenMessage(EntityInterface $entity, $field_name) { 'entity' => $entity->id(), 'field_name' => $field_name, ]; - $destination = ['destination' => Url::fromRoute('comment.reply', $comment_reply_parameters, ['fragment' => 'comment-form'])->toString()]; + $destination = [ + 'destination' => Url::fromRoute('comment.reply', + $comment_reply_parameters, + ['fragment' => 'comment-form'])->toString(), + ]; } else { - $destination = ['destination' => $entity->toUrl('canonical', ['fragment' => 'comment-form'])->toString()]; + $destination = [ + 'destination' => $entity->toUrl('canonical', + ['fragment' => 'comment-form'])->toString(), + ]; } if ($this->userConfig->get('register') != UserInterface::REGISTER_ADMINISTRATORS_ONLY) { diff --git a/core/modules/comment/tests/src/Functional/CommentBookTest.php b/core/modules/comment/tests/src/Functional/CommentBookTest.php index b461f7098a..76230d1f3c 100644 --- a/core/modules/comment/tests/src/Functional/CommentBookTest.php +++ b/core/modules/comment/tests/src/Functional/CommentBookTest.php @@ -60,7 +60,11 @@ public function testBookCommentPrint() { ]); $comment->save(); - $commenting_user = $this->drupalCreateUser(['access printer-friendly version', 'access comments', 'post comments']); + $commenting_user = $this->drupalCreateUser([ + 'access printer-friendly version', + 'access comments', + 'post comments', + ]); $this->drupalLogin($commenting_user); $this->drupalGet('node/' . $book_node->id()); diff --git a/core/modules/comment/tests/src/Functional/CommentEntityTest.php b/core/modules/comment/tests/src/Functional/CommentEntityTest.php index 79ab591a4a..9aa45296ec 100644 --- a/core/modules/comment/tests/src/Functional/CommentEntityTest.php +++ b/core/modules/comment/tests/src/Functional/CommentEntityTest.php @@ -23,7 +23,15 @@ class CommentEntityTest extends CommentTestBase { * * @var array */ - public static $modules = ['block', 'comment', 'node', 'history', 'field_ui', 'datetime', 'taxonomy']; + public static $modules = [ + 'block', + 'comment', + 'node', + 'history', + 'field_ui', + 'datetime', + 'taxonomy', + ]; /** * {@inheritdoc} diff --git a/core/modules/comment/tests/src/Functional/CommentFieldsTest.php b/core/modules/comment/tests/src/Functional/CommentFieldsTest.php index 1dd250d506..56e1c61c93 100644 --- a/core/modules/comment/tests/src/Functional/CommentFieldsTest.php +++ b/core/modules/comment/tests/src/Functional/CommentFieldsTest.php @@ -233,7 +233,12 @@ public function testCommentInstallAfterContentModule() { // Try to post a comment on each node. A failure will be triggered if the // comment body is missing on one of these forms, due to postComment() // asserting that the body is actually posted correctly. - $this->webUser = $this->drupalCreateUser(['access content', 'access comments', 'post comments', 'skip comment approval']); + $this->webUser = $this->drupalCreateUser([ + 'access content', + 'access comments', + 'post comments', + 'skip comment approval', + ]); $this->drupalLogin($this->webUser); $this->postComment($book_node, $this->randomMachineName(), $this->randomMachineName()); } diff --git a/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php b/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php index 2d3dcaa5d1..544ab27f80 100644 --- a/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php +++ b/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php @@ -73,7 +73,12 @@ public function testCommentInterface() { // Comment as anonymous with preview required. $this->drupalLogout(); - user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, ['access content', 'access comments', 'post comments', 'skip comment approval']); + user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, [ + 'access content', + 'access comments', + 'post comments', + 'skip comment approval', + ]); $anonymous_comment = $this->postComment($this->node, $this->randomMachineName(), $this->randomMachineName(), TRUE); $this->assertTrue($this->commentExists($anonymous_comment), 'Comment found.'); $anonymous_comment->delete(); @@ -177,7 +182,11 @@ public function testCommentInterface() { $this->assertResponse(403); // Attempt to post to node with comments disabled. - $this->node = $this->drupalCreateNode(['type' => 'article', 'promote' => 1, 'comment' => [['status' => CommentItemInterface::HIDDEN]]]); + $this->node = $this->drupalCreateNode([ + 'type' => 'article', + 'promote' => 1, + 'comment' => [['status' => CommentItemInterface::HIDDEN]], + ]); $this->assertNotNull($this->node, 'Article node created.'); $this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment'); $this->assertResponse(403); diff --git a/core/modules/comment/tests/src/Functional/CommentLanguageTest.php b/core/modules/comment/tests/src/Functional/CommentLanguageTest.php index 000ecd28c8..b8dd2aee21 100644 --- a/core/modules/comment/tests/src/Functional/CommentLanguageTest.php +++ b/core/modules/comment/tests/src/Functional/CommentLanguageTest.php @@ -40,7 +40,17 @@ protected function setUp() { $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']); // Create and log in user. - $admin_user = $this->drupalCreateUser(['administer site configuration', 'administer languages', 'access administration pages', 'administer content types', 'administer comments', 'create article content', 'access comments', 'post comments', 'skip comment approval']); + $admin_user = $this->drupalCreateUser([ + 'administer site configuration', + 'administer languages', + 'access administration pages', + 'administer content types', + 'administer comments', + 'create article content', + 'access comments', + 'post comments', + 'skip comment approval', + ]); $this->drupalLogin($admin_user); // Add language. @@ -124,7 +134,11 @@ public function testCommentLanguage() { ->range(0, 1) ->execute(); $comment = Comment::load(reset($cids)); - $args = ['%node_language' => $node_langcode, '%comment_language' => $comment->langcode->value, '%langcode' => $langcode]; + $args = [ + '%node_language' => $node_langcode, + '%comment_language' => $comment->langcode->value, + '%langcode' => $langcode, + ]; $this->assertEqual($comment->langcode->value, $langcode, new FormattableMarkup('The comment posted with content language %langcode and belonging to the node with language %node_language has language %comment_language', $args)); $this->assertEqual($comment->comment_body->value, $comment_values[$node_langcode][$langcode], 'Comment body correctly stored.'); } diff --git a/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php b/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php index 318e0ca9a7..18748e127b 100644 --- a/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php +++ b/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php @@ -26,7 +26,13 @@ class CommentNonNodeTest extends BrowserTestBase { use FieldUiTestTrait; use CommentTestTrait; - public static $modules = ['comment', 'user', 'field_ui', 'entity_test', 'block']; + public static $modules = [ + 'comment', + 'user', + 'field_ui', + 'entity_test', + 'block', + ]; /** * {@inheritdoc} diff --git a/core/modules/comment/tests/src/Functional/CommentPreviewTest.php b/core/modules/comment/tests/src/Functional/CommentPreviewTest.php index c64eeaa6db..57d8cc0628 100644 --- a/core/modules/comment/tests/src/Functional/CommentPreviewTest.php +++ b/core/modules/comment/tests/src/Functional/CommentPreviewTest.php @@ -128,7 +128,12 @@ public function testCommentPreviewDuplicateSubmission() { * Tests comment edit, preview, and save. */ public function testCommentEditPreviewSave() { - $web_user = $this->drupalCreateUser(['access comments', 'post comments', 'skip comment approval', 'edit own comments']); + $web_user = $this->drupalCreateUser([ + 'access comments', + 'post comments', + 'skip comment approval', + 'edit own comments', + ]); $this->drupalLogin($this->adminUser); $this->setCommentPreview(DRUPAL_OPTIONAL); $this->setCommentForm(TRUE); diff --git a/core/modules/comment/tests/src/Functional/CommentTestBase.php b/core/modules/comment/tests/src/Functional/CommentTestBase.php index 245228de0d..c0433891b5 100644 --- a/core/modules/comment/tests/src/Functional/CommentTestBase.php +++ b/core/modules/comment/tests/src/Functional/CommentTestBase.php @@ -24,7 +24,14 @@ * * @var array */ - public static $modules = ['block', 'comment', 'node', 'history', 'field_ui', 'datetime']; + public static $modules = [ + 'block', + 'comment', + 'node', + 'history', + 'field_ui', + 'datetime', + ]; /** * An administrative user with permission to configure comment settings. diff --git a/core/modules/comment/tests/src/Functional/CommentTitleTest.php b/core/modules/comment/tests/src/Functional/CommentTitleTest.php index a6af71fd0a..0145c02050 100644 --- a/core/modules/comment/tests/src/Functional/CommentTitleTest.php +++ b/core/modules/comment/tests/src/Functional/CommentTitleTest.php @@ -29,7 +29,11 @@ public function testCommentEmptyTitles() { // Create a node. $this->drupalLogin($this->webUser); - $this->node = $this->drupalCreateNode(['type' => 'article', 'promote' => 1, 'uid' => $this->webUser->id()]); + $this->node = $this->drupalCreateNode([ + 'type' => 'article', + 'promote' => 1, + 'uid' => $this->webUser->id(), + ]); // Post comment #1 and verify that h3's are not rendered. $subject_text = $this->randomMachineName(); @@ -61,7 +65,11 @@ public function testCommentPopulatedTitles() { // Create a node. $this->drupalLogin($this->webUser); - $this->node = $this->drupalCreateNode(['type' => 'article', 'promote' => 1, 'uid' => $this->webUser->id()]); + $this->node = $this->drupalCreateNode([ + 'type' => 'article', + 'promote' => 1, + 'uid' => $this->webUser->id(), + ]); // Post comment #1 and verify that title is rendered in h3. $subject_text = $this->randomMachineName(); diff --git a/core/modules/comment/tests/src/Functional/CommentTokenReplaceTest.php b/core/modules/comment/tests/src/Functional/CommentTokenReplaceTest.php index b402da57f8..592b6f4ce8 100644 --- a/core/modules/comment/tests/src/Functional/CommentTokenReplaceTest.php +++ b/core/modules/comment/tests/src/Functional/CommentTokenReplaceTest.php @@ -185,7 +185,12 @@ public function testCommentTokenReplacement() { $tests['[term:comment-count-new]'] = 1; foreach ($tests as $input => $expected) { - $output = $token_service->replace($input, ['entity' => $node, 'node' => $node, 'user' => $user, 'term' => $term], ['langcode' => $language_interface->getId()]); + $output = $token_service->replace($input, [ + 'entity' => $node, + 'node' => $node, + 'user' => $user, + 'term' => $term, + ], ['langcode' => $language_interface->getId()]); $this->assertEqual($output, $expected, new FormattableMarkup('Comment token %token replaced.', ['%token' => $input])); } } diff --git a/core/modules/comment/tests/src/Functional/CommentTranslationUITest.php b/core/modules/comment/tests/src/Functional/CommentTranslationUITest.php index 8f47909403..4707d9d3dd 100644 --- a/core/modules/comment/tests/src/Functional/CommentTranslationUITest.php +++ b/core/modules/comment/tests/src/Functional/CommentTranslationUITest.php @@ -87,7 +87,11 @@ public function setupBundle() { * {@inheritdoc} */ protected function getTranslatorPermissions() { - return array_merge(parent::getTranslatorPermissions(), ['post comments', 'administer comments', 'access comments']); + return array_merge(parent::getTranslatorPermissions(), [ + 'post comments', + 'administer comments', + 'access comments', + ]); } /** diff --git a/core/modules/comment/tests/src/Functional/Rest/CommentResourceTestBase.php b/core/modules/comment/tests/src/Functional/Rest/CommentResourceTestBase.php index 1edbb7b302..32ccef0218 100644 --- a/core/modules/comment/tests/src/Functional/Rest/CommentResourceTestBase.php +++ b/core/modules/comment/tests/src/Functional/Rest/CommentResourceTestBase.php @@ -252,7 +252,11 @@ protected function getNormalizedPostEntity() { * {@inheritdoc} */ protected function getNormalizedPatchEntity() { - return array_diff_key($this->getNormalizedPostEntity(), ['entity_type' => TRUE, 'entity_id' => TRUE, 'field_name' => TRUE]); + return array_diff_key($this->getNormalizedPostEntity(), [ + 'entity_type' => TRUE, + 'entity_id' => TRUE, + 'field_name' => TRUE, + ]); } /** diff --git a/core/modules/comment/tests/src/Functional/Views/CommentRestExportTest.php b/core/modules/comment/tests/src/Functional/Views/CommentRestExportTest.php index d5046a396e..e5166c7f4b 100644 --- a/core/modules/comment/tests/src/Functional/Views/CommentRestExportTest.php +++ b/core/modules/comment/tests/src/Functional/Views/CommentRestExportTest.php @@ -27,7 +27,13 @@ class CommentRestExportTest extends CommentTestBase { /** * {@inheritdoc} */ - public static $modules = ['node', 'comment', 'comment_test_views', 'rest', 'hal']; + public static $modules = [ + 'node', + 'comment', + 'comment_test_views', + 'rest', + 'hal', + ]; protected function setUp($import_test_views = TRUE) { parent::setUp($import_test_views); diff --git a/core/modules/comment/tests/src/Kernel/CommentFieldAccessTest.php b/core/modules/comment/tests/src/Kernel/CommentFieldAccessTest.php index 41acbf4e1d..94fe65572b 100644 --- a/core/modules/comment/tests/src/Kernel/CommentFieldAccessTest.php +++ b/core/modules/comment/tests/src/Kernel/CommentFieldAccessTest.php @@ -203,7 +203,13 @@ public function testAccessToAdministrativeFields() { // Generate permutations. $combinations = [ 'comment' => [$comment1, $comment2, $comment3, $comment4], - 'user' => [$comment_admin_user, $comment_enabled_user, $comment_no_edit_user, $comment_disabled_user, $anonymous_user], + 'user' => [ + $comment_admin_user, + $comment_enabled_user, + $comment_no_edit_user, + $comment_disabled_user, + $anonymous_user, + ], ]; $permutations = $this->generatePermutations($combinations); diff --git a/core/modules/comment/tests/src/Kernel/CommentIntegrationTest.php b/core/modules/comment/tests/src/Kernel/CommentIntegrationTest.php index 6f62845f73..f8515549cd 100644 --- a/core/modules/comment/tests/src/Kernel/CommentIntegrationTest.php +++ b/core/modules/comment/tests/src/Kernel/CommentIntegrationTest.php @@ -24,7 +24,14 @@ class CommentIntegrationTest extends KernelTestBase { /** * {@inheritdoc} */ - public static $modules = ['comment', 'field', 'entity_test', 'user', 'system', 'dblog']; + public static $modules = [ + 'comment', + 'field', + 'entity_test', + 'user', + 'system', + 'dblog', + ]; /** * {@inheritdoc} diff --git a/core/modules/comment/tests/src/Unit/CommentLinkBuilderTest.php b/core/modules/comment/tests/src/Unit/CommentLinkBuilderTest.php index b4e914feb6..a7c5d0ebe8 100644 --- a/core/modules/comment/tests/src/Unit/CommentLinkBuilderTest.php +++ b/core/modules/comment/tests/src/Unit/CommentLinkBuilderTest.php @@ -235,7 +235,11 @@ public function getLinkCombinations() { } else { // On a separate page. - $expected['comment-add']['url'] = Url::fromRoute('comment.reply', ['entity_type' => 'node', 'entity' => 1, 'field_name' => 'comment']); + $expected['comment-add']['url'] = Url::fromRoute('comment.reply', [ + 'entity_type' => 'node', + 'entity' => 1, + 'field_name' => 'comment', + ]); } } } diff --git a/core/modules/config/src/Form/ConfigSingleImportForm.php b/core/modules/config/src/Form/ConfigSingleImportForm.php index 59c4298e2b..dc7bf74948 100644 --- a/core/modules/config/src/Form/ConfigSingleImportForm.php +++ b/core/modules/config/src/Form/ConfigSingleImportForm.php @@ -419,7 +419,10 @@ public function submitForm(array &$form, FormStateInterface $form_state) { 'error_message' => $this->t('Configuration import has encountered an error.'), ]; foreach ($sync_steps as $sync_step) { - $batch['operations'][] = [[ConfigImporterBatch::class, 'process'], [$config_importer, $sync_step]]; + $batch['operations'][] = [ + [ConfigImporterBatch::class, 'process'], + [$config_importer, $sync_step], + ]; } batch_set($batch); diff --git a/core/modules/config/src/Form/ConfigSync.php b/core/modules/config/src/Form/ConfigSync.php index 2d8be27114..c143b1a795 100644 --- a/core/modules/config/src/Form/ConfigSync.php +++ b/core/modules/config/src/Form/ConfigSync.php @@ -371,7 +371,10 @@ public function submitForm(array &$form, FormStateInterface $form_state) { 'error_message' => t('Configuration synchronization has encountered an error.'), ]; foreach ($sync_steps as $sync_step) { - $batch['operations'][] = [[ConfigImporterBatch::class, 'process'], [$config_importer, $sync_step]]; + $batch['operations'][] = [ + [ConfigImporterBatch::class, 'process'], + [$config_importer, $sync_step], + ]; } batch_set($batch); diff --git a/core/modules/config/tests/config_import_test/src/EventSubscriber.php b/core/modules/config/tests/config_import_test/src/EventSubscriber.php index 6b72b8ac99..0877aa5a50 100644 --- a/core/modules/config/tests/config_import_test/src/EventSubscriber.php +++ b/core/modules/config/tests/config_import_test/src/EventSubscriber.php @@ -135,7 +135,10 @@ public static function getSubscribedEvents() { $events[ConfigEvents::SAVE][] = ['onConfigSave', 40]; $events[ConfigEvents::DELETE][] = ['onConfigDelete', 40]; $events[ConfigEvents::IMPORT_VALIDATE] = ['onConfigImporterValidate']; - $events[ConfigEvents::IMPORT_MISSING_CONTENT] = [['onConfigImporterMissingContentOne'], ['onConfigImporterMissingContentTwo', -100]]; + $events[ConfigEvents::IMPORT_MISSING_CONTENT] = [ + ['onConfigImporterMissingContentOne'], + ['onConfigImporterMissingContentTwo', -100], + ]; return $events; } diff --git a/core/modules/config/tests/src/Functional/ConfigEntityListTest.php b/core/modules/config/tests/src/Functional/ConfigEntityListTest.php index 51611f78b4..c9a62b5245 100644 --- a/core/modules/config/tests/src/Functional/ConfigEntityListTest.php +++ b/core/modules/config/tests/src/Functional/ConfigEntityListTest.php @@ -121,7 +121,12 @@ public function testList() { ]); $entity->save(); $list = $controller->load(); - $this->assertIdentical(array_keys($list), ['beta', 'dotted.default', 'alpha', 'omega']); + $this->assertIdentical(array_keys($list), [ + 'beta', + 'dotted.default', + 'alpha', + 'omega', + ]); // Test that config entities that do not support status, do not have // enable/disable operations. diff --git a/core/modules/config/tests/src/Functional/ConfigImportUITest.php b/core/modules/config/tests/src/Functional/ConfigImportUITest.php index 3dd18fca36..f21dc2de12 100644 --- a/core/modules/config/tests/src/Functional/ConfigImportUITest.php +++ b/core/modules/config/tests/src/Functional/ConfigImportUITest.php @@ -19,7 +19,13 @@ class ConfigImportUITest extends BrowserTestBase { * * @var array */ - public static $modules = ['config', 'config_test', 'config_import_test', 'text', 'options']; + public static $modules = [ + 'config', + 'config_test', + 'config_import_test', + 'text', + 'options', + ]; /** * {@inheritdoc} diff --git a/core/modules/config/tests/src/Functional/ConfigInstallWebTest.php b/core/modules/config/tests/src/Functional/ConfigInstallWebTest.php index 52a26837e1..cd466ccbb5 100644 --- a/core/modules/config/tests/src/Functional/ConfigInstallWebTest.php +++ b/core/modules/config/tests/src/Functional/ConfigInstallWebTest.php @@ -34,7 +34,11 @@ class ConfigInstallWebTest extends BrowserTestBase { protected function setUp() { parent::setUp(); - $this->adminUser = $this->drupalCreateUser(['administer modules', 'administer themes', 'administer site configuration']); + $this->adminUser = $this->drupalCreateUser([ + 'administer modules', + 'administer themes', + 'administer site configuration', + ]); // Ensure the global variable being asserted by this test does not exist; // a previous test executed in this request/process might have set it. diff --git a/core/modules/config_translation/src/FormElement/DateFormat.php b/core/modules/config_translation/src/FormElement/DateFormat.php index d0ae033a42..f93f30b367 100644 --- a/core/modules/config_translation/src/FormElement/DateFormat.php +++ b/core/modules/config_translation/src/FormElement/DateFormat.php @@ -16,7 +16,9 @@ public function getTranslationElement(LanguageInterface $translation_language, $ /** @var \Drupal\Core\Datetime\DateFormatterInterface $date_formatter */ $date_formatter = \Drupal::service('date.formatter'); $description = $this->t('A user-defined date format. See the PHP manual for available options.'); - $format = $this->t('Displayed as %date_format', ['%date_format' => $date_formatter->format(REQUEST_TIME, 'custom', $translation_config)]); + $format = $this->t('Displayed as %date_format', [ + '%date_format' => $date_formatter->format(REQUEST_TIME, 'custom', $translation_config), + ]); return [ '#type' => 'textfield', diff --git a/core/modules/contact/tests/src/Functional/ContactPersonalTest.php b/core/modules/contact/tests/src/Functional/ContactPersonalTest.php index d21e8e2b54..777196c94c 100644 --- a/core/modules/contact/tests/src/Functional/ContactPersonalTest.php +++ b/core/modules/contact/tests/src/Functional/ContactPersonalTest.php @@ -57,7 +57,12 @@ protected function setUp() { parent::setUp(); // Create an admin user. - $this->adminUser = $this->drupalCreateUser(['administer contact forms', 'administer users', 'administer account settings', 'access site reports']); + $this->adminUser = $this->drupalCreateUser([ + 'administer contact forms', + 'administer users', + 'administer account settings', + 'access site reports', + ]); // Create some normal users with their contact forms enabled by default. $this->config('contact.settings')->set('user_default_enabled', TRUE)->save(); diff --git a/core/modules/contact/tests/src/Functional/ContactSitewideTest.php b/core/modules/contact/tests/src/Functional/ContactSitewideTest.php index 7960c2dcb5..a63b6514b8 100644 --- a/core/modules/contact/tests/src/Functional/ContactSitewideTest.php +++ b/core/modules/contact/tests/src/Functional/ContactSitewideTest.php @@ -29,7 +29,15 @@ class ContactSitewideTest extends BrowserTestBase { * * @var array */ - public static $modules = ['text', 'contact', 'field_ui', 'contact_test', 'block', 'error_service_test', 'dblog']; + public static $modules = [ + 'text', + 'contact', + 'field_ui', + 'contact_test', + 'block', + 'error_service_test', + 'dblog', + ]; /** * {@inheritdoc} @@ -139,10 +147,18 @@ public function testSiteWideContact() { // Add forms. // Test invalid recipients. - $invalid_recipients = ['invalid', 'invalid@', 'invalid@site.', '@site.', '@site.com']; + $invalid_recipients = [ + 'invalid', + 'invalid@', + 'invalid@site.', + '@site.', + '@site.com', + ]; foreach ($invalid_recipients as $invalid_recipient) { $this->addContactForm($this->randomMachineName(16), $this->randomMachineName(16), $invalid_recipient, '', FALSE); - $this->assertRaw(t('%recipient is an invalid email address.', ['%recipient' => $invalid_recipient])); + $this->assertRaw(t('%recipient is an invalid email address.', [ + '%recipient' => $invalid_recipient, + ])); } // Test validation of empty form and recipients fields. @@ -152,7 +168,11 @@ public function testSiteWideContact() { $this->assertText(t('Recipients field is required.')); // Test validation of max_length machine name. - $recipients = ['simpletest&@example.com', 'simpletest2@example.com', 'simpletest3@example.com']; + $recipients = [ + 'simpletest&@example.com', + 'simpletest2@example.com', + 'simpletest3@example.com', + ]; $max_length = EntityTypeInterface::BUNDLE_MAX_LENGTH; $max_length_exceeded = $max_length + 1; $this->addContactForm($id = mb_strtolower($this->randomMachineName($max_length_exceeded)), $label = $this->randomMachineName($max_length_exceeded), implode(',', [$recipients[0]]), '', TRUE); diff --git a/core/modules/content_moderation/src/EntityTypeInfo.php b/core/modules/content_moderation/src/EntityTypeInfo.php index 363ecaac91..ac58fc2a25 100644 --- a/core/modules/content_moderation/src/EntityTypeInfo.php +++ b/core/modules/content_moderation/src/EntityTypeInfo.php @@ -367,7 +367,11 @@ public function formAlter(array &$form, FormStateInterface $form_state, $form_id */ protected function isModeratedEntityEditForm(FormInterface $form_object) { return $form_object instanceof ContentEntityFormInterface && - in_array($form_object->getOperation(), ['edit', 'default', 'layout_builder'], TRUE) && + in_array($form_object->getOperation(), [ + 'edit', + 'default', + 'layout_builder', + ], TRUE) && $this->moderationInfo->isModeratedEntity($form_object->getEntity()); } diff --git a/core/modules/content_moderation/tests/src/Functional/ModeratedContentViewTest.php b/core/modules/content_moderation/tests/src/Functional/ModeratedContentViewTest.php index 0faf532f3c..a53c2002b8 100644 --- a/core/modules/content_moderation/tests/src/Functional/ModeratedContentViewTest.php +++ b/core/modules/content_moderation/tests/src/Functional/ModeratedContentViewTest.php @@ -54,7 +54,12 @@ public function setUp() { $workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'article'); $workflow->save(); - $this->adminUser = $this->drupalCreateUser(['access administration pages', 'view any unpublished content', 'administer nodes', 'bypass node access']); + $this->adminUser = $this->drupalCreateUser([ + 'access administration pages', + 'view any unpublished content', + 'administer nodes', + 'bypass node access', + ]); } /** @@ -70,16 +75,32 @@ public function testModeratedContentPage() { // table style configuration with a default sort on the 'changed' field // descending. $time = \Drupal::time()->getRequestTime(); - $excluded_nodes['published_page'] = $this->drupalCreateNode(['type' => 'page', 'changed' => $time--, 'moderation_state' => 'published']); - $excluded_nodes['published_article'] = $this->drupalCreateNode(['type' => 'article', 'changed' => $time--, 'moderation_state' => 'published']); + $excluded_nodes['published_page'] = $this->drupalCreateNode([ + 'type' => 'page', + 'changed' => $time--, + 'moderation_state' => 'published', + ]); + $excluded_nodes['published_article'] = $this->drupalCreateNode([ + 'type' => 'article', + 'changed' => $time--, + 'moderation_state' => 'published', + ]); - $excluded_nodes['unmoderated_type'] = $this->drupalCreateNode(['type' => 'unmoderated_type', 'changed' => $time--]); + $excluded_nodes['unmoderated_type'] = $this->drupalCreateNode([ + 'type' => 'unmoderated_type', + 'changed' => $time--, + ]); $excluded_nodes['unmoderated_type']->setNewRevision(TRUE); $excluded_nodes['unmoderated_type']->isDefaultRevision(FALSE); $excluded_nodes['unmoderated_type']->changed->value = $time--; $excluded_nodes['unmoderated_type']->save(); - $nodes['published_then_draft_article'] = $this->drupalCreateNode(['type' => 'article', 'changed' => $time--, 'moderation_state' => 'published', 'title' => 'first article - published']); + $nodes['published_then_draft_article'] = $this->drupalCreateNode([ + 'type' => 'article', + 'changed' => $time--, + 'moderation_state' => 'published', + 'title' => 'first article - published', + ]); $nodes['published_then_draft_article']->setNewRevision(TRUE); $nodes['published_then_draft_article']->setTitle('first article - draft'); $nodes['published_then_draft_article']->moderation_state->value = 'draft'; @@ -92,9 +113,21 @@ public function testModeratedContentPage() { $nodes['published_then_archived_article']->changed->value = $time--; $nodes['published_then_archived_article']->save(); - $nodes['draft_article'] = $this->drupalCreateNode(['type' => 'article', 'changed' => $time--, 'moderation_state' => 'draft']); - $nodes['draft_page_1'] = $this->drupalCreateNode(['type' => 'page', 'changed' => $time--, 'moderation_state' => 'draft']); - $nodes['draft_page_2'] = $this->drupalCreateNode(['type' => 'page', 'changed' => $time, 'moderation_state' => 'draft']); + $nodes['draft_article'] = $this->drupalCreateNode([ + 'type' => 'article', + 'changed' => $time--, + 'moderation_state' => 'draft', + ]); + $nodes['draft_page_1'] = $this->drupalCreateNode([ + 'type' => 'page', + 'changed' => $time--, + 'moderation_state' => 'draft', + ]); + $nodes['draft_page_2'] = $this->drupalCreateNode([ + 'type' => 'page', + 'changed' => $time, + 'moderation_state' => 'draft', + ]); // Verify view, edit, and delete links for any content. $this->drupalGet('admin/content/moderated'); diff --git a/core/modules/content_moderation/tests/src/Functional/ViewsModerationStateFilterTest.php b/core/modules/content_moderation/tests/src/Functional/ViewsModerationStateFilterTest.php index 9598e1bd08..d7f9a466ce 100644 --- a/core/modules/content_moderation/tests/src/Functional/ViewsModerationStateFilterTest.php +++ b/core/modules/content_moderation/tests/src/Functional/ViewsModerationStateFilterTest.php @@ -262,7 +262,12 @@ public function testFilterRenderCache() { $this->drupalPostForm('admin/config/workflow/workflows/manage/editorial/type/node', [ 'bundles[example_a]' => TRUE, ], 'Save'); - $this->assertFilterStates(['All', 'editorial-draft', 'editorial-published', 'editorial-archived']); + $this->assertFilterStates([ + 'All', + 'editorial-draft', + 'editorial-published', + 'editorial-archived', + ]); // Adding a new state to the editorial workflow will display that state in // the list of filters. @@ -270,13 +275,28 @@ public function testFilterRenderCache() { 'label' => 'Foo', 'id' => 'foo', ], 'Save'); - $this->assertFilterStates(['All', 'editorial-draft', 'editorial-published', 'editorial-archived', 'editorial-foo']); + $this->assertFilterStates([ + 'All', + 'editorial-draft', + 'editorial-published', + 'editorial-archived', + 'editorial-foo', + ]); // Adding a second workflow to nodes will also show new states. $this->drupalPostForm('admin/config/workflow/workflows/manage/new_workflow/type/node', [ 'bundles[example_b]' => TRUE, ], 'Save'); - $this->assertFilterStates(['All', 'editorial-draft', 'editorial-published', 'editorial-archived', 'editorial-foo', 'new_workflow-draft', 'new_workflow-published', 'new_workflow-bar']); + $this->assertFilterStates([ + 'All', + 'editorial-draft', + 'editorial-published', + 'editorial-archived', + 'editorial-foo', + 'new_workflow-draft', + 'new_workflow-published', + 'new_workflow-bar', + ]); // Add a few more states and change the exposed filter to allow multiple // selections so we can check that the size of the select element does not @@ -295,7 +315,17 @@ public function testFilterRenderCache() { $this->drupalPostForm("admin/structure/views/nojs/handler/$view_id/default/filter/moderation_state", $edit, 'Apply'); $this->drupalPostForm("admin/structure/views/view/$view_id", [], 'Save'); - $this->assertFilterStates(['editorial-draft', 'editorial-published', 'editorial-archived', 'editorial-foo', 'editorial-foo2', 'editorial-foo3', 'new_workflow-draft', 'new_workflow-published', 'new_workflow-bar'], TRUE); + $this->assertFilterStates([ + 'editorial-draft', + 'editorial-published', + 'editorial-archived', + 'editorial-foo', + 'editorial-foo2', + 'editorial-foo3', + 'new_workflow-draft', + 'new_workflow-published', + 'new_workflow-bar', + ], TRUE); } /** diff --git a/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php b/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php index 6011f9f209..722de7fe95 100644 --- a/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php +++ b/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php @@ -80,7 +80,15 @@ protected function setUp() { $this->installEntitySchema('content_moderation_state'); $this->installConfig('content_moderation'); $this->installSchema('file', 'file_usage'); - $this->installConfig(['field', 'file', 'filter', 'image', 'media', 'node', 'system']); + $this->installConfig([ + 'field', + 'file', + 'filter', + 'image', + 'media', + 'node', + 'system', + ]); // Add the French language. ConfigurableLanguage::createFromLangcode('fr')->save(); diff --git a/core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateFilterTest.php b/core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateFilterTest.php index 58d1ab0edc..0d33e665aa 100644 --- a/core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateFilterTest.php +++ b/core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateFilterTest.php @@ -220,7 +220,11 @@ public function testStateFilterStatesList() { // Adding a new content moderation workflow will add additional states to // filter. - $workflow = Workflow::create(['id' => 'moderation_test', 'type' => 'content_moderation', 'label' => 'Moderation test']); + $workflow = Workflow::create([ + 'id' => 'moderation_test', + 'type' => 'content_moderation', + 'label' => 'Moderation test', + ]); $workflow->getTypePlugin()->addState('foo', 'Foo State'); $workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'example'); $workflow->save(); diff --git a/core/modules/content_moderation/tests/src/Kernel/WorkspacesContentModerationStateTest.php b/core/modules/content_moderation/tests/src/Kernel/WorkspacesContentModerationStateTest.php index 09e6cdbcd7..af250f0997 100644 --- a/core/modules/content_moderation/tests/src/Kernel/WorkspacesContentModerationStateTest.php +++ b/core/modules/content_moderation/tests/src/Kernel/WorkspacesContentModerationStateTest.php @@ -80,18 +80,42 @@ public function testContentModerationIntegrationWithWorkspaces() { // Create three entities for each bundle, covering all the available // moderation states. - $page_archived = Node::create(['type' => 'page', 'title' => 'Test page - archived', 'moderation_state' => 'archived']); + $page_archived = Node::create([ + 'type' => 'page', + 'title' => 'Test page - archived', + 'moderation_state' => 'archived', + ]); $page_archived->save(); - $page_draft = Node::create(['type' => 'page', 'title' => 'Test page - draft', 'moderation_state' => 'draft']); + $page_draft = Node::create([ + 'type' => 'page', + 'title' => 'Test page - draft', + 'moderation_state' => 'draft', + ]); $page_draft->save(); - $page_published = Node::create(['type' => 'page', 'title' => 'Test page - published', 'moderation_state' => 'published']); + $page_published = Node::create([ + 'type' => 'page', + 'title' => 'Test page - published', + 'moderation_state' => 'published', + ]); $page_published->save(); - $article_archived = Node::create(['type' => 'article', 'title' => 'Test article - archived', 'moderation_state' => 'archived']); + $article_archived = Node::create([ + 'type' => 'article', + 'title' => 'Test article - archived', + 'moderation_state' => 'archived', + ]); $article_archived->save(); - $article_draft = Node::create(['type' => 'article', 'title' => 'Test article - draft', 'moderation_state' => 'draft']); + $article_draft = Node::create([ + 'type' => 'article', + 'title' => 'Test article - draft', + 'moderation_state' => 'draft', + ]); $article_draft->save(); - $article_published = Node::create(['type' => 'article', 'title' => 'Test article - published', 'moderation_state' => 'published']); + $article_published = Node::create([ + 'type' => 'article', + 'title' => 'Test article - published', + 'moderation_state' => 'published', + ]); $article_published->save(); // We have three items in a non-default moderation state: diff --git a/core/modules/content_translation/src/ContentTranslationHandler.php b/core/modules/content_translation/src/ContentTranslationHandler.php index 08c3ab3f8a..f23a0db9ca 100644 --- a/core/modules/content_translation/src/ContentTranslationHandler.php +++ b/core/modules/content_translation/src/ContentTranslationHandler.php @@ -331,7 +331,11 @@ public function entityFormAlter(array &$form, FormStateInterface $form_state, En $title = $this->entityFormTitle($entity); // When editing the original values display just the entity label. if ($is_translation) { - $t_args = ['%language' => $languages[$form_langcode]->getName(), '%title' => $entity->label(), '@title' => $title]; + $t_args = [ + '%language' => $languages[$form_langcode]->getName(), + '%title' => $entity->label(), + '@title' => $title, + ]; $title = $new_translation ? t('Create %language translation of %title', $t_args) : t('@title [%language translation]', $t_args); } $form['#title'] = $title; @@ -343,7 +347,9 @@ public function entityFormAlter(array &$form, FormStateInterface $form_state, En $source_langcode = $metadata->getSource(); $form['source_langcode'] = [ '#type' => 'details', - '#title' => t('Source language: @language', ['@language' => $languages[$source_langcode]->getName()]), + '#title' => t('Source language: @language', [ + '@language' => $languages[$source_langcode]->getName(), + ]), '#tree' => TRUE, '#weight' => -100, '#multilingual' => TRUE, @@ -562,7 +568,15 @@ public function entityFormSharedElements($element, FormStateInterface $form_stat // @todo Find a more reliable way to determine if a form element concerns a // multilingual value. if (!isset($ignored_types)) { - $ignored_types = array_flip(['actions', 'value', 'hidden', 'vertical_tabs', 'token', 'details', 'link']); + $ignored_types = array_flip([ + 'actions', + 'value', + 'hidden', + 'vertical_tabs', + 'token', + 'details', + 'link', + ]); } /** @var \Drupal\Core\Entity\ContentEntityForm $form_object */ diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationContextualLinksTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationContextualLinksTest.php index e2a945b011..5af9fdebad 100644 --- a/core/modules/content_translation/tests/src/Functional/ContentTranslationContextualLinksTest.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationContextualLinksTest.php @@ -108,7 +108,11 @@ protected function setUp() { public function testContentTranslationContextualLinks() { // Create a node. $title = $this->randomString(); - $this->drupalCreateNode(['type' => $this->bundle, 'title' => $title, 'langcode' => 'en']); + $this->drupalCreateNode([ + 'type' => $this->bundle, + 'title' => $title, + 'langcode' => 'en', + ]); $node = $this->drupalGetNodeByTitle($title); // Use a UI form submission to make the node type and field translatable. diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationEntityBundleUITest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationEntityBundleUITest.php index dfd291bd85..b4d48435c0 100644 --- a/core/modules/content_translation/tests/src/Functional/ContentTranslationEntityBundleUITest.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationEntityBundleUITest.php @@ -11,7 +11,13 @@ */ class ContentTranslationEntityBundleUITest extends BrowserTestBase { - public static $modules = ['language', 'content_translation', 'node', 'comment', 'field_ui']; + public static $modules = [ + 'language', + 'content_translation', + 'node', + 'comment', + 'field_ui', + ]; /** * {@inheritdoc} @@ -20,7 +26,12 @@ class ContentTranslationEntityBundleUITest extends BrowserTestBase { protected function setUp() { parent::setUp(); - $user = $this->drupalCreateUser(['access administration pages', 'administer languages', 'administer content translation', 'administer content types']); + $user = $this->drupalCreateUser([ + 'access administration pages', + 'administer languages', + 'administer content translation', + 'administer content types', + ]); $this->drupalLogin($user); } diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationLanguageChangeTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationLanguageChangeTest.php index b72af04df8..6de3a9ed5b 100644 --- a/core/modules/content_translation/tests/src/Functional/ContentTranslationLanguageChangeTest.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationLanguageChangeTest.php @@ -22,7 +22,15 @@ class ContentTranslationLanguageChangeTest extends NodeTestBase { * * @var array */ - public static $modules = ['language', 'content_translation', 'content_translation_test', 'node', 'block', 'field_ui', 'image']; + public static $modules = [ + 'language', + 'content_translation', + 'content_translation_test', + 'node', + 'block', + 'field_ui', + 'image', + ]; /** * {@inheritdoc} diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationLinkTagTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationLinkTagTest.php index 905e26146b..cefed787d3 100644 --- a/core/modules/content_translation/tests/src/Functional/ContentTranslationLinkTagTest.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationLinkTagTest.php @@ -17,7 +17,12 @@ class ContentTranslationLinkTagTest extends BrowserTestBase { /** * {@inheritdoc} */ - public static $modules = ['entity_test', 'content_translation', 'content_translation_test', 'language']; + public static $modules = [ + 'entity_test', + 'content_translation', + 'content_translation_test', + 'language', + ]; /** * {@inheritdoc} diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationOperationsTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationOperationsTest.php index d2e4ba0224..31079d63c9 100644 --- a/core/modules/content_translation/tests/src/Functional/ContentTranslationOperationsTest.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationOperationsTest.php @@ -37,7 +37,13 @@ class ContentTranslationOperationsTest extends NodeTestBase { * * @var array */ - public static $modules = ['language', 'content_translation', 'node', 'views', 'block']; + public static $modules = [ + 'language', + 'content_translation', + 'node', + 'views', + 'block', + ]; /** * {@inheritdoc} @@ -58,7 +64,12 @@ protected function setUp() { \Drupal::service('router.builder')->rebuild(); $this->baseUser1 = $this->drupalCreateUser(['access content overview']); - $this->baseUser2 = $this->drupalCreateUser(['access content overview', 'create content translations', 'update content translations', 'delete content translations']); + $this->baseUser2 = $this->drupalCreateUser([ + 'access content overview', + 'create content translations', + 'update content translations', + 'delete content translations', + ]); } /** diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationPendingRevisionTestBase.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationPendingRevisionTestBase.php index ef0f54aeca..6d2ae93002 100644 --- a/core/modules/content_translation/tests/src/Functional/ContentTranslationPendingRevisionTestBase.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationPendingRevisionTestBase.php @@ -17,7 +17,12 @@ /** * {@inheritdoc} */ - public static $modules = ['language', 'content_translation', 'content_moderation', 'node']; + public static $modules = [ + 'language', + 'content_translation', + 'content_moderation', + 'node', + ]; /** * The entity storage. diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationSettingsTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationSettingsTest.php index 77b3c697b0..31186f24ca 100644 --- a/core/modules/content_translation/tests/src/Functional/ContentTranslationSettingsTest.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationSettingsTest.php @@ -25,7 +25,14 @@ class ContentTranslationSettingsTest extends BrowserTestBase { * * @var array */ - public static $modules = ['language', 'content_translation', 'node', 'comment', 'field_ui', 'entity_test']; + public static $modules = [ + 'language', + 'content_translation', + 'node', + 'comment', + 'field_ui', + 'entity_test', + ]; /** * {@inheritdoc} @@ -42,7 +49,17 @@ protected function setUp() { $this->addDefaultCommentField('node', 'article', 'comment_article', CommentItemInterface::OPEN, 'comment_article'); $this->addDefaultCommentField('node', 'page', 'comment_page'); - $admin_user = $this->drupalCreateUser(['access administration pages', 'administer languages', 'administer content translation', 'administer content types', 'administer node fields', 'administer comment fields', 'administer comments', 'administer comment types', 'administer account settings']); + $admin_user = $this->drupalCreateUser([ + 'access administration pages', + 'administer languages', + 'administer content translation', + 'administer content types', + 'administer node fields', + 'administer comment fields', + 'administer comments', + 'administer comment types', + 'administer account settings', + ]); $this->drupalLogin($admin_user); } @@ -243,7 +260,11 @@ public function testAccountLanguageSettingsUI() { */ protected function assertSettings($entity_type, $bundle, $enabled, $edit) { $this->drupalPostForm('admin/config/regional/content-language', $edit, t('Save configuration')); - $args = ['@entity_type' => $entity_type, '@bundle' => $bundle, '@enabled' => $enabled ? 'enabled' : 'disabled']; + $args = [ + '@entity_type' => $entity_type, + '@bundle' => $bundle, + '@enabled' => $enabled ? 'enabled' : 'disabled', + ]; $message = new FormattableMarkup('Translation for entity @entity_type (@bundle) is @enabled.', $args); return $this->assertEqual(\Drupal::service('content_translation.manager')->isEnabled($entity_type, $bundle), $enabled, $message); } diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationSyncImageTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationSyncImageTest.php index 8e5734cd82..59ebdb9785 100644 --- a/core/modules/content_translation/tests/src/Functional/ContentTranslationSyncImageTest.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationSyncImageTest.php @@ -44,7 +44,13 @@ class ContentTranslationSyncImageTest extends ContentTranslationTestBase { * * @var array */ - public static $modules = ['language', 'content_translation', 'entity_test', 'image', 'field_ui']; + public static $modules = [ + 'language', + 'content_translation', + 'entity_test', + 'image', + 'field_ui', + ]; protected function setUp() { parent::setUp(); @@ -87,7 +93,11 @@ protected function setupTestFields() { */ protected function getEditorPermissions() { // Every entity-type-specific test needs to define these. - return ['administer entity_test_mul fields', 'administer languages', 'administer content translation']; + return [ + 'administer entity_test_mul fields', + 'administer languages', + 'administer content translation', + ]; } /** diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationTestBase.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationTestBase.php index 65bb9aef3d..768f2108f8 100644 --- a/core/modules/content_translation/tests/src/Functional/ContentTranslationTestBase.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationTestBase.php @@ -114,7 +114,12 @@ protected function setupLanguages() { * Returns an array of permissions needed for the translator. */ protected function getTranslatorPermissions() { - return array_filter([$this->getTranslatePermission(), 'create content translations', 'update content translations', 'delete content translations']); + return array_filter([ + $this->getTranslatePermission(), + 'create content translations', + 'update content translations', + 'delete content translations', + ]); } /** diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php index 5e7954086f..e3d2b47a24 100644 --- a/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php @@ -47,7 +47,12 @@ * * @var string[] */ - protected $defaultCacheContexts = ['languages:language_interface', 'theme', 'url.query_args:_wrapper_format', 'user.permissions']; + protected $defaultCacheContexts = [ + 'languages:language_interface', + 'theme', + 'url.query_args:_wrapper_format', + 'user.permissions', + ]; /** * Tests the basic translation UI. diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationWorkflowsTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationWorkflowsTest.php index 2efc272143..18ad7d6406 100644 --- a/core/modules/content_translation/tests/src/Functional/ContentTranslationWorkflowsTest.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationWorkflowsTest.php @@ -79,7 +79,11 @@ protected function setupEntity() { // Create a translation. $this->drupalLogin($this->translator); - $add_translation_url = Url::fromRoute("entity.$this->entityTypeId.content_translation_add", [$this->entityTypeId => $this->entity->id(), 'source' => $default_langcode, 'target' => $this->langcodes[2]]); + $add_translation_url = Url::fromRoute("entity.$this->entityTypeId.content_translation_add", [ + $this->entityTypeId => $this->entity->id(), + 'source' => $default_langcode, + 'target' => $this->langcodes[2], + ]); $this->drupalPostForm($add_translation_url, [], t('Save')); $this->rebuildContainer(); } @@ -122,10 +126,18 @@ public function testWorkflows() { $this->doTestWorkflows($this->administrator, $expected_status); // Check that translation permissions allow the associated operations. - $ops = ['create' => t('Add'), 'update' => t('Edit'), 'delete' => t('Delete')]; + $ops = [ + 'create' => t('Add'), + 'update' => t('Edit'), + 'delete' => t('Delete'), + ]; $translations_url = $this->entity->toUrl('drupal:content-translation-overview'); foreach ($ops as $current_op => $item) { - $user = $this->drupalCreateUser([$this->getTranslatePermission(), "$current_op content translations", 'view test entity']); + $user = $this->drupalCreateUser([ + $this->getTranslatePermission(), + "$current_op content translations", + 'view test entity', + ]); $this->drupalLogin($user); $this->drupalGet($translations_url); diff --git a/core/modules/content_translation/tests/src/Functional/Views/ContentTranslationViewsUITest.php b/core/modules/content_translation/tests/src/Functional/Views/ContentTranslationViewsUITest.php index 351ff78de7..cfc4d2d7f5 100644 --- a/core/modules/content_translation/tests/src/Functional/Views/ContentTranslationViewsUITest.php +++ b/core/modules/content_translation/tests/src/Functional/Views/ContentTranslationViewsUITest.php @@ -35,7 +35,11 @@ class ContentTranslationViewsUITest extends UITestBase { */ public function testViewsUI() { $this->drupalGet('admin/structure/views/view/test_view/edit'); - $this->assertTitle(t('@label (@table) | @site-name', ['@label' => 'Test view', '@table' => 'Views test data', '@site-name' => $this->config('system.site')->get('name')])); + $this->assertTitle(t('@label (@table) | @site-name', [ + '@label' => 'Test view', + '@table' => 'Views test data', + '@site-name' => $this->config('system.site')->get('name'), + ])); } } diff --git a/core/modules/content_translation/tests/src/Kernel/ContentTranslationConfigImportTest.php b/core/modules/content_translation/tests/src/Kernel/ContentTranslationConfigImportTest.php index a3a3ad96e1..68d9c54d13 100644 --- a/core/modules/content_translation/tests/src/Kernel/ContentTranslationConfigImportTest.php +++ b/core/modules/content_translation/tests/src/Kernel/ContentTranslationConfigImportTest.php @@ -25,7 +25,13 @@ class ContentTranslationConfigImportTest extends KernelTestBase { * * @var array */ - public static $modules = ['system', 'user', 'entity_test', 'language', 'content_translation']; + public static $modules = [ + 'system', + 'user', + 'entity_test', + 'language', + 'content_translation', + ]; /** * {@inheritdoc} diff --git a/core/modules/content_translation/tests/src/Kernel/ContentTranslationFieldSyncRevisionTest.php b/core/modules/content_translation/tests/src/Kernel/ContentTranslationFieldSyncRevisionTest.php index 3d9d34d083..ea97937613 100644 --- a/core/modules/content_translation/tests/src/Kernel/ContentTranslationFieldSyncRevisionTest.php +++ b/core/modules/content_translation/tests/src/Kernel/ContentTranslationFieldSyncRevisionTest.php @@ -26,7 +26,13 @@ class ContentTranslationFieldSyncRevisionTest extends EntityKernelTestBase { /** * {@inheritdoc} */ - public static $modules = ['file', 'image', 'language', 'content_translation', 'content_translation_test']; + public static $modules = [ + 'file', + 'image', + 'language', + 'content_translation', + 'content_translation_test', + ]; /** * The synchronized field name. diff --git a/core/modules/content_translation/tests/src/Kernel/ContentTranslationSettingsApiTest.php b/core/modules/content_translation/tests/src/Kernel/ContentTranslationSettingsApiTest.php index c8fcf2d49e..31cf5aa3bb 100644 --- a/core/modules/content_translation/tests/src/Kernel/ContentTranslationSettingsApiTest.php +++ b/core/modules/content_translation/tests/src/Kernel/ContentTranslationSettingsApiTest.php @@ -17,7 +17,12 @@ class ContentTranslationSettingsApiTest extends KernelTestBase { * * @var array */ - public static $modules = ['language', 'content_translation', 'user', 'entity_test']; + public static $modules = [ + 'language', + 'content_translation', + 'user', + 'entity_test', + ]; /** * {@inheritdoc} diff --git a/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDatelistWidget.php b/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDatelistWidget.php index 276d92c431..1de1b426a3 100644 --- a/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDatelistWidget.php +++ b/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDatelistWidget.php @@ -95,7 +95,11 @@ public function settingsForm(array $form, FormStateInterface $form_state) { '#type' => 'select', '#title' => t('Date part order'), '#default_value' => $this->getSetting('date_order'), - '#options' => ['MDY' => t('Month/Day/Year'), 'DMY' => t('Day/Month/Year'), 'YMD' => t('Year/Month/Day')], + '#options' => [ + 'MDY' => t('Month/Day/Year'), + 'DMY' => t('Day/Month/Year'), + 'YMD' => t('Year/Month/Day'), + ], ]; if ($this->getFieldSetting('datetime_type') == 'datetime') { diff --git a/core/modules/datetime/tests/src/Kernel/Views/DateTimeSchemaTest.php b/core/modules/datetime/tests/src/Kernel/Views/DateTimeSchemaTest.php index f763c49a51..5f29df8c61 100644 --- a/core/modules/datetime/tests/src/Kernel/Views/DateTimeSchemaTest.php +++ b/core/modules/datetime/tests/src/Kernel/Views/DateTimeSchemaTest.php @@ -17,7 +17,11 @@ class DateTimeSchemaTest extends DateTimeHandlerTestBase { /** * {@inheritdoc} */ - public static $testViews = ['test_argument_datetime', 'test_filter_datetime', 'test_sort_datetime']; + public static $testViews = [ + 'test_argument_datetime', + 'test_filter_datetime', + 'test_sort_datetime', + ]; /** * Test argument plugin schema. diff --git a/core/modules/datetime_range/src/Plugin/Field/FieldWidget/DateRangeDatelistWidget.php b/core/modules/datetime_range/src/Plugin/Field/FieldWidget/DateRangeDatelistWidget.php index 3e0e6e4ce9..6e6de7238b 100644 --- a/core/modules/datetime_range/src/Plugin/Field/FieldWidget/DateRangeDatelistWidget.php +++ b/core/modules/datetime_range/src/Plugin/Field/FieldWidget/DateRangeDatelistWidget.php @@ -68,7 +68,11 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen break; case '12': - $date_part_order = array_merge($date_part_order, ['hour', 'minute', 'ampm']); + $date_part_order = array_merge($date_part_order, [ + 'hour', + 'minute', + 'ampm', + ]); break; case 'none': @@ -100,7 +104,11 @@ public function settingsForm(array $form, FormStateInterface $form_state) { '#type' => 'select', '#title' => $this->t('Date part order'), '#default_value' => $this->getSetting('date_order'), - '#options' => ['MDY' => $this->t('Month/Day/Year'), 'DMY' => $this->t('Day/Month/Year'), 'YMD' => $this->t('Year/Month/Day')], + '#options' => [ + 'MDY' => $this->t('Month/Day/Year'), + 'DMY' => $this->t('Day/Month/Year'), + 'YMD' => $this->t('Year/Month/Day'), + ], ]; if ($this->getFieldSetting('datetime_type') == DateRangeItem::DATETIME_TYPE_DATETIME) { diff --git a/core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php b/core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php index cdf95cce14..aa8d45e219 100644 --- a/core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php +++ b/core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php @@ -753,8 +753,20 @@ public function testDatelistWidget() { } // Submit a valid date and ensure it is accepted. - $start_date_value = ['year' => 2012, 'month' => 12, 'day' => 31, 'hour' => 5, 'minute' => 15]; - $end_date_value = ['year' => 2013, 'month' => 1, 'day' => 15, 'hour' => 3, 'minute' => 30]; + $start_date_value = [ + 'year' => 2012, + 'month' => 12, + 'day' => 31, + 'hour' => 5, + 'minute' => 15, + ]; + $end_date_value = [ + 'year' => 2013, + 'month' => 1, + 'day' => 15, + 'hour' => 3, + 'minute' => 30, + ]; $edit = []; // Add the ampm indicator since we are testing 12 hour time. @@ -878,8 +890,20 @@ public function testDatelistWidget() { // Test the widget for complete input with zeros as part of selections. $this->drupalGet('entity_test/add'); - $start_date_value = ['year' => 2012, 'month' => 12, 'day' => 31, 'hour' => 0, 'minute' => 0]; - $end_date_value = ['year' => 2013, 'month' => 1, 'day' => 15, 'hour' => 3, 'minute' => 30]; + $start_date_value = [ + 'year' => 2012, + 'month' => 12, + 'day' => 31, + 'hour' => 0, + 'minute' => 0, + ]; + $end_date_value = [ + 'year' => 2013, + 'month' => 1, + 'day' => 15, + 'hour' => 3, + 'minute' => 30, + ]; $edit = []; foreach ($start_date_value as $part => $value) { $edit["{$field_name}[0][value][$part]"] = $value; @@ -897,8 +921,20 @@ public function testDatelistWidget() { // Test the widget to ensure zeros are not deselected on validation. $this->drupalGet('entity_test/add'); - $start_date_value = ['year' => 2012, 'month' => 12, 'day' => 31, 'hour' => 0, 'minute' => 0]; - $end_date_value = ['year' => 2013, 'month' => 1, 'day' => 15, 'hour' => 3, 'minute' => 0]; + $start_date_value = [ + 'year' => 2012, + 'month' => 12, + 'day' => 31, + 'hour' => 0, + 'minute' => 0, + ]; + $end_date_value = [ + 'year' => 2013, + 'month' => 1, + 'day' => 15, + 'hour' => 3, + 'minute' => 0, + ]; $edit = []; foreach ($start_date_value as $part => $value) { $edit["{$field_name}[0][value][$part]"] = $value; @@ -923,8 +959,20 @@ protected function datelistDataProvider() { return [ // Year only selected, validation error on Month, Day, Hour, Minute. [ - ['year' => 2012, 'month' => '', 'day' => '', 'hour' => '', 'minute' => ''], - ['year' => 2013, 'month' => '1', 'day' => '15', 'hour' => '3', 'minute' => '30'], [ + [ + 'year' => 2012, + 'month' => '', + 'day' => '', + 'hour' => '', + 'minute' => '', + ], + [ + 'year' => 2013, + 'month' => '1', + 'day' => '15', + 'hour' => '3', + 'minute' => '30', + ], [ 'A value must be selected for month.', 'A value must be selected for day.', 'A value must be selected for hour.', @@ -933,8 +981,20 @@ protected function datelistDataProvider() { ], // Year and Month selected, validation error on Day, Hour, Minute. [ - ['year' => 2012, 'month' => '12', 'day' => '', 'hour' => '', 'minute' => ''], - ['year' => 2013, 'month' => '1', 'day' => '15', 'hour' => '3', 'minute' => '30'], [ + [ + 'year' => 2012, + 'month' => '12', + 'day' => '', + 'hour' => '', + 'minute' => '', + ], + [ + 'year' => 2013, + 'month' => '1', + 'day' => '15', + 'hour' => '3', + 'minute' => '30', + ], [ 'A value must be selected for day.', 'A value must be selected for hour.', 'A value must be selected for minute.', @@ -942,23 +1002,59 @@ protected function datelistDataProvider() { ], // Year, Month and Day selected, validation error on Hour, Minute. [ - ['year' => 2012, 'month' => '12', 'day' => '31', 'hour' => '', 'minute' => ''], - ['year' => 2013, 'month' => '1', 'day' => '15', 'hour' => '3', 'minute' => '30'], [ + [ + 'year' => 2012, + 'month' => '12', + 'day' => '31', + 'hour' => '', + 'minute' => '', + ], + [ + 'year' => 2013, + 'month' => '1', + 'day' => '15', + 'hour' => '3', + 'minute' => '30', + ], [ 'A value must be selected for hour.', 'A value must be selected for minute.', ], ], // Year, Month, Day and Hour selected, validation error on Minute only. [ - ['year' => 2012, 'month' => '12', 'day' => '31', 'hour' => '0', 'minute' => ''], - ['year' => 2013, 'month' => '1', 'day' => '15', 'hour' => '3', 'minute' => '30'], [ + [ + 'year' => 2012, + 'month' => '12', + 'day' => '31', + 'hour' => '0', + 'minute' => '', + ], + [ + 'year' => 2013, + 'month' => '1', + 'day' => '15', + 'hour' => '3', + 'minute' => '30', + ], [ 'A value must be selected for minute.', ], ], // Year selected, validation error on Month, Day, Hour, Minute. [ - ['year' => 2012, 'month' => '12', 'day' => '31', 'hour' => '0', 'minute' => '0'], - ['year' => 2013, 'month' => '', 'day' => '', 'hour' => '', 'minute' => ''], [ + [ + 'year' => 2012, + 'month' => '12', + 'day' => '31', + 'hour' => '0', + 'minute' => '0', + ], + [ + 'year' => 2013, + 'month' => '', + 'day' => '', + 'hour' => '', + 'minute' => '', + ], [ 'A value must be selected for month.', 'A value must be selected for day.', 'A value must be selected for hour.', @@ -967,8 +1063,20 @@ protected function datelistDataProvider() { ], // Year and Month selected, validation error on Day, Hour, Minute. [ - ['year' => 2012, 'month' => '12', 'day' => '31', 'hour' => '0', 'minute' => '0'], - ['year' => 2013, 'month' => '1', 'day' => '', 'hour' => '', 'minute' => ''], [ + [ + 'year' => 2012, + 'month' => '12', + 'day' => '31', + 'hour' => '0', + 'minute' => '0', + ], + [ + 'year' => 2013, + 'month' => '1', + 'day' => '', + 'hour' => '', + 'minute' => '', + ], [ 'A value must be selected for day.', 'A value must be selected for hour.', 'A value must be selected for minute.', @@ -976,16 +1084,40 @@ protected function datelistDataProvider() { ], // Year, Month and Day selected, validation error on Hour, Minute. [ - ['year' => 2012, 'month' => '12', 'day' => '31', 'hour' => '0', 'minute' => '0'], - ['year' => 2013, 'month' => '1', 'day' => '15', 'hour' => '', 'minute' => ''], [ + [ + 'year' => 2012, + 'month' => '12', + 'day' => '31', + 'hour' => '0', + 'minute' => '0', + ], + [ + 'year' => 2013, + 'month' => '1', + 'day' => '15', + 'hour' => '', + 'minute' => '', + ], [ 'A value must be selected for hour.', 'A value must be selected for minute.', ], ], // Year, Month, Day and Hour selected, validation error on Minute only. [ - ['year' => 2012, 'month' => '12', 'day' => '31', 'hour' => '0', 'minute' => '0'], - ['year' => 2013, 'month' => '1', 'day' => '15', 'hour' => '3', 'minute' => ''], [ + [ + 'year' => 2012, + 'month' => '12', + 'day' => '31', + 'hour' => '0', + 'minute' => '0', + ], + [ + 'year' => 2013, + 'month' => '1', + 'day' => '15', + 'hour' => '3', + 'minute' => '', + ], [ 'A value must be selected for minute.', ], ], diff --git a/core/modules/dblog/tests/src/Functional/DbLogTest.php b/core/modules/dblog/tests/src/Functional/DbLogTest.php index 79298d83bc..3ad2259b57 100644 --- a/core/modules/dblog/tests/src/Functional/DbLogTest.php +++ b/core/modules/dblog/tests/src/Functional/DbLogTest.php @@ -64,7 +64,12 @@ protected function setUp() { $this->drupalPlaceBlock('page_title_block'); // Create users with specific permissions. - $this->adminUser = $this->drupalCreateUser(['administer site configuration', 'access administration pages', 'access site reports', 'administer users']); + $this->adminUser = $this->drupalCreateUser([ + 'administer site configuration', + 'access administration pages', + 'access site reports', + 'administer users', + ]); $this->webUser = $this->drupalCreateUser([]); } @@ -437,7 +442,11 @@ private function doUser() { */ private function doNode($type) { // Create user. - $perm = ['create ' . $type . ' content', 'edit own ' . $type . ' content', 'delete own ' . $type . ' content']; + $perm = [ + 'create ' . $type . ' content', + 'edit own ' . $type . ' content', + 'delete own ' . $type . ' content', + ]; $user = $this->drupalCreateUser($perm); // Log in user. $this->drupalLogin($user); @@ -802,9 +811,21 @@ public function testOverviewLinks() { public function testSameTimestampEntries() { $this->drupalLogin($this->adminUser); - $this->generateLogEntries(1, ['timestamp' => 1498062000, 'type' => 'same_time', 'message' => 'First']); - $this->generateLogEntries(1, ['timestamp' => 1498062000, 'type' => 'same_time', 'message' => 'Second']); - $this->generateLogEntries(1, ['timestamp' => 1498062000, 'type' => 'same_time', 'message' => 'Third']); + $this->generateLogEntries(1, [ + 'timestamp' => 1498062000, + 'type' => 'same_time', + 'message' => 'First', + ]); + $this->generateLogEntries(1, [ + 'timestamp' => 1498062000, + 'type' => 'same_time', + 'message' => 'Second', + ]); + $this->generateLogEntries(1, [ + 'timestamp' => 1498062000, + 'type' => 'same_time', + 'message' => 'Third', + ]); $this->drupalGet('admin/reports/dblog'); diff --git a/core/modules/editor/editor.api.php b/core/modules/editor/editor.api.php index 1d44a9f8d8..003cfc46a2 100644 --- a/core/modules/editor/editor.api.php +++ b/core/modules/editor/editor.api.php @@ -36,7 +36,11 @@ function hook_editor_info_alter(array &$editors) { function hook_editor_js_settings_alter(array &$settings) { if (isset($settings['editor']['formats']['basic_html'])) { $settings['editor']['formats']['basic_html']['editor'] = 'MyDifferentEditor'; - $settings['editor']['formats']['basic_html']['editorSettings']['buttons'] = ['strong', 'italic', 'underline']; + $settings['editor']['formats']['basic_html']['editorSettings']['buttons'] = [ + 'strong', + 'italic', + 'underline', + ]; } } diff --git a/core/modules/editor/editor.module b/core/modules/editor/editor.module index 4ccea91890..e3fc8aec21 100644 --- a/core/modules/editor/editor.module +++ b/core/modules/editor/editor.module @@ -599,7 +599,11 @@ function _editor_get_formatted_text_fields(FieldableEntityInterface $entity) { // Only return formatted text fields. return array_keys(array_filter($field_definitions, function (FieldDefinitionInterface $definition) { - return in_array($definition->getType(), ['text', 'text_long', 'text_with_summary'], TRUE); + return in_array($definition->getType(), [ + 'text', + 'text_long', + 'text_with_summary', + ], TRUE); })); } diff --git a/core/modules/editor/tests/src/Kernel/EditorFileReferenceFilterTest.php b/core/modules/editor/tests/src/Kernel/EditorFileReferenceFilterTest.php index a70a232aa8..f9bdcfa9df 100644 --- a/core/modules/editor/tests/src/Kernel/EditorFileReferenceFilterTest.php +++ b/core/modules/editor/tests/src/Kernel/EditorFileReferenceFilterTest.php @@ -19,7 +19,14 @@ class EditorFileReferenceFilterTest extends KernelTestBase { * * @var array */ - public static $modules = ['system', 'filter', 'editor', 'field', 'file', 'user']; + public static $modules = [ + 'system', + 'filter', + 'editor', + 'field', + 'file', + 'user', + ]; /** * @var \Drupal\filter\Plugin\FilterInterface[] diff --git a/core/modules/editor/tests/src/Kernel/EditorImageDialogTest.php b/core/modules/editor/tests/src/Kernel/EditorImageDialogTest.php index 0d0ecaaa60..cce78c5444 100644 --- a/core/modules/editor/tests/src/Kernel/EditorImageDialogTest.php +++ b/core/modules/editor/tests/src/Kernel/EditorImageDialogTest.php @@ -28,7 +28,14 @@ class EditorImageDialogTest extends EntityKernelTestBase { * * @var array */ - public static $modules = ['node', 'file', 'editor', 'editor_test', 'user', 'system']; + public static $modules = [ + 'node', + 'file', + 'editor', + 'editor_test', + 'user', + 'system', + ]; /** * Sets up the test. diff --git a/core/modules/field/src/Plugin/migrate/process/d7/FieldSettings.php b/core/modules/field/src/Plugin/migrate/process/d7/FieldSettings.php index cb4be4dab6..d911451266 100644 --- a/core/modules/field/src/Plugin/migrate/process/d7/FieldSettings.php +++ b/core/modules/field/src/Plugin/migrate/process/d7/FieldSettings.php @@ -32,7 +32,11 @@ public function transform($value, MigrateExecutableInterface $migrate_executable $collected_date_attributes = is_numeric(array_keys($value['granularity'])[0]) ? $value['granularity'] : array_keys(array_filter($value['granularity'])); - if (empty(array_intersect($collected_date_attributes, ['hour', 'minute', 'second']))) { + if (empty(array_intersect($collected_date_attributes, [ + 'hour', + 'minute', + 'second', + ]))) { $value['datetime_type'] = 'date'; } break; diff --git a/core/modules/field/tests/src/Functional/Boolean/BooleanFormatterSettingsTest.php b/core/modules/field/tests/src/Functional/Boolean/BooleanFormatterSettingsTest.php index 532c399296..e1799450df 100644 --- a/core/modules/field/tests/src/Functional/Boolean/BooleanFormatterSettingsTest.php +++ b/core/modules/field/tests/src/Functional/Boolean/BooleanFormatterSettingsTest.php @@ -50,7 +50,14 @@ protected function setUp() { $type = $this->drupalCreateContentType(['name' => $type_name, 'type' => $type_name]); $this->bundle = $type->id(); - $admin_user = $this->drupalCreateUser(['access content', 'administer content types', 'administer node fields', 'administer node display', 'bypass node access', 'administer nodes']); + $admin_user = $this->drupalCreateUser([ + 'access content', + 'administer content types', + 'administer node fields', + 'administer node display', + 'bypass node access', + 'administer nodes', + ]); $this->drupalLogin($admin_user); $this->fieldName = mb_strtolower($this->randomMachineName(8)); diff --git a/core/modules/field/tests/src/Functional/FormTest.php b/core/modules/field/tests/src/Functional/FormTest.php index b409456cf9..27dc98ca48 100644 --- a/core/modules/field/tests/src/Functional/FormTest.php +++ b/core/modules/field/tests/src/Functional/FormTest.php @@ -25,7 +25,13 @@ class FormTest extends FieldTestBase { * * @var array */ - public static $modules = ['node', 'field_test', 'options', 'entity_test', 'locale']; + public static $modules = [ + 'node', + 'field_test', + 'options', + 'entity_test', + 'locale', + ]; /** * {@inheritdoc} diff --git a/core/modules/field/tests/src/Functional/String/StringFieldTest.php b/core/modules/field/tests/src/Functional/String/StringFieldTest.php index d12fd33819..28f3a21cdb 100644 --- a/core/modules/field/tests/src/Functional/String/StringFieldTest.php +++ b/core/modules/field/tests/src/Functional/String/StringFieldTest.php @@ -37,7 +37,11 @@ class StringFieldTest extends BrowserTestBase { protected function setUp() { parent::setUp(); - $this->webUser = $this->drupalCreateUser(['view test entity', 'administer entity_test content', 'access content']); + $this->webUser = $this->drupalCreateUser([ + 'view test entity', + 'administer entity_test content', + 'access content', + ]); $this->drupalLogin($this->webUser); } diff --git a/core/modules/field/tests/src/FunctionalJavascript/EntityReference/EntityReferenceAdminTest.php b/core/modules/field/tests/src/FunctionalJavascript/EntityReference/EntityReferenceAdminTest.php index f5eab5a408..6864113801 100644 --- a/core/modules/field/tests/src/FunctionalJavascript/EntityReference/EntityReferenceAdminTest.php +++ b/core/modules/field/tests/src/FunctionalJavascript/EntityReference/EntityReferenceAdminTest.php @@ -25,7 +25,14 @@ class EntityReferenceAdminTest extends WebDriverTestBase { * * @var array */ - public static $modules = ['node', 'field_ui', 'path', 'taxonomy', 'block', 'views_ui']; + public static $modules = [ + 'node', + 'field_ui', + 'path', + 'taxonomy', + 'block', + 'views_ui', + ]; /** * {@inheritdoc} diff --git a/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceItemTest.php b/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceItemTest.php index f8f57dfe8b..50c8011232 100644 --- a/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceItemTest.php +++ b/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceItemTest.php @@ -39,7 +39,16 @@ class EntityReferenceItemTest extends FieldKernelTestBase { * * @var array */ - public static $modules = ['node', 'comment', 'file', 'taxonomy', 'text', 'filter', 'views', 'field']; + public static $modules = [ + 'node', + 'comment', + 'file', + 'taxonomy', + 'text', + 'filter', + 'views', + 'field', + ]; /** * The taxonomy vocabulary to test with. diff --git a/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceSettingsTest.php b/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceSettingsTest.php index dc3da86dc5..cae16a4203 100644 --- a/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceSettingsTest.php +++ b/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceSettingsTest.php @@ -23,7 +23,16 @@ class EntityReferenceSettingsTest extends KernelTestBase { /** * {@inheritdoc} */ - public static $modules = ['node', 'taxonomy', 'field', 'user', 'text', 'entity_reference', 'entity_test', 'system']; + public static $modules = [ + 'node', + 'taxonomy', + 'field', + 'user', + 'text', + 'entity_reference', + 'entity_test', + 'system', + ]; /** * Testing node type. diff --git a/core/modules/field/tests/src/Kernel/EntityReference/Views/EntityReferenceRelationshipTest.php b/core/modules/field/tests/src/Kernel/EntityReference/Views/EntityReferenceRelationshipTest.php index b93a4a9c1d..84e517204b 100644 --- a/core/modules/field/tests/src/Kernel/EntityReference/Views/EntityReferenceRelationshipTest.php +++ b/core/modules/field/tests/src/Kernel/EntityReference/Views/EntityReferenceRelationshipTest.php @@ -41,7 +41,13 @@ class EntityReferenceRelationshipTest extends ViewsKernelTestBase { * * @var array */ - public static $modules = ['user', 'field', 'entity_test', 'views', 'entity_reference_test_views']; + public static $modules = [ + 'user', + 'field', + 'entity_test', + 'views', + 'entity_reference_test_views', + ]; /** * The entity_test entities used by the test. diff --git a/core/modules/field/tests/src/Kernel/FieldAttachOtherTest.php b/core/modules/field/tests/src/Kernel/FieldAttachOtherTest.php index 2c444e6a49..39cb96f9a8 100644 --- a/core/modules/field/tests/src/Kernel/FieldAttachOtherTest.php +++ b/core/modules/field/tests/src/Kernel/FieldAttachOtherTest.php @@ -303,7 +303,11 @@ public function testEntityFormDisplayExtractFormValues() { $entity_type = 'entity_test'; $entity_init = $this->container->get('entity_type.manager') ->getStorage($entity_type) - ->create(['id' => 1, 'revision_id' => 1, 'type' => $this->fieldTestData->field->getTargetBundle()]); + ->create([ + 'id' => 1, + 'revision_id' => 1, + 'type' => $this->fieldTestData->field->getTargetBundle(), + ]); // Build the form for all fields. $display = \Drupal::service('entity_display.repository') diff --git a/core/modules/field/tests/src/Kernel/FieldKernelTestBase.php b/core/modules/field/tests/src/Kernel/FieldKernelTestBase.php index fdc8940fd6..c20ee81884 100644 --- a/core/modules/field/tests/src/Kernel/FieldKernelTestBase.php +++ b/core/modules/field/tests/src/Kernel/FieldKernelTestBase.php @@ -19,7 +19,14 @@ * * @var array */ - public static $modules = ['user', 'system', 'field', 'text', 'entity_test', 'field_test']; + public static $modules = [ + 'user', + 'system', + 'field', + 'text', + 'entity_test', + 'field_test', + ]; /** * Bag of created field storages and fields. diff --git a/core/modules/field/tests/src/Kernel/String/RawStringFormatterTest.php b/core/modules/field/tests/src/Kernel/String/RawStringFormatterTest.php index d6730f9c2f..a07084912f 100644 --- a/core/modules/field/tests/src/Kernel/String/RawStringFormatterTest.php +++ b/core/modules/field/tests/src/Kernel/String/RawStringFormatterTest.php @@ -22,7 +22,13 @@ class RawStringFormatterTest extends KernelTestBase { * * @var array */ - public static $modules = ['field', 'text', 'entity_test', 'system', 'filter', 'user']; + public static $modules = [ + 'field', 'text', + 'entity_test', + 'system', + 'filter', + 'user', + ]; /** * @var string diff --git a/core/modules/field/tests/src/Kernel/String/StringFormatterTest.php b/core/modules/field/tests/src/Kernel/String/StringFormatterTest.php index faa8218905..c29b565d1a 100644 --- a/core/modules/field/tests/src/Kernel/String/StringFormatterTest.php +++ b/core/modules/field/tests/src/Kernel/String/StringFormatterTest.php @@ -22,7 +22,14 @@ class StringFormatterTest extends KernelTestBase { * * @var array */ - public static $modules = ['field', 'text', 'entity_test', 'system', 'filter', 'user']; + public static $modules = [ + 'field', + 'text', + 'entity_test', + 'system', + 'filter', + 'user', + ]; /** * The entity type manager. diff --git a/core/modules/field/tests/src/Kernel/Timestamp/TimestampFormatterTest.php b/core/modules/field/tests/src/Kernel/Timestamp/TimestampFormatterTest.php index d7a771729d..1be133b782 100644 --- a/core/modules/field/tests/src/Kernel/Timestamp/TimestampFormatterTest.php +++ b/core/modules/field/tests/src/Kernel/Timestamp/TimestampFormatterTest.php @@ -109,8 +109,16 @@ public function testTimestampFormatter() { $data[] = ['date_format' => $date_format, 'custom_date_format' => '', 'timezone' => '']; } - $data[] = ['date_format' => 'custom', 'custom_date_format' => 'r', 'timezone' => '']; - $data[] = ['date_format' => 'custom', 'custom_date_format' => 'e', 'timezone' => 'Asia/Tokyo']; + $data[] = [ + 'date_format' => 'custom', + 'custom_date_format' => 'r', + 'timezone' => '', + ]; + $data[] = [ + 'date_format' => 'custom', + 'custom_date_format' => 'e', + 'timezone' => 'Asia/Tokyo', + ]; foreach ($data as $settings) { list($date_format, $custom_date_format, $timezone) = array_values($settings); diff --git a/core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php b/core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php index 71d0aa8161..0d9d7c2394 100644 --- a/core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php +++ b/core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php @@ -199,7 +199,11 @@ public function testCalculateDependenciesIncorrectBundle() { $this->fieldTypePluginManager->expects($this->any()) ->method('getDefinition') ->with('test_field') - ->willReturn(['provider' => 'test_module', 'config_dependencies' => ['module' => ['test_module2']], 'class' => '\Drupal\Tests\field\Unit\DependencyFieldItem']); + ->willReturn([ + 'provider' => 'test_module', + 'config_dependencies' => ['module' => ['test_module2']], + 'class' => '\Drupal\Tests\field\Unit\DependencyFieldItem', + ]); $field = new FieldConfig([ 'field_name' => $this->fieldStorage->getName(), diff --git a/core/modules/field_layout/tests/src/Functional/FieldLayoutTest.php b/core/modules/field_layout/tests/src/Functional/FieldLayoutTest.php index 47458e4583..4b8a200754 100644 --- a/core/modules/field_layout/tests/src/Functional/FieldLayoutTest.php +++ b/core/modules/field_layout/tests/src/Functional/FieldLayoutTest.php @@ -14,7 +14,12 @@ class FieldLayoutTest extends BrowserTestBase { /** * {@inheritdoc} */ - public static $modules = ['field_layout', 'field_ui', 'node', 'field_layout_test']; + public static $modules = [ + 'field_layout', + 'field_ui', + 'node', + 'field_layout_test', + ]; /** * {@inheritdoc} diff --git a/core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php b/core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php index 9114b93787..c232661451 100644 --- a/core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php +++ b/core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php @@ -15,7 +15,12 @@ class FieldLayoutTest extends WebDriverTestBase { /** * {@inheritdoc} */ - public static $modules = ['field_layout', 'field_ui', 'field_layout_test', 'layout_test']; + public static $modules = [ + 'field_layout', + 'field_ui', + 'field_layout_test', + 'layout_test', + ]; /** * {@inheritdoc} diff --git a/core/modules/field_layout/tests/src/Kernel/FieldLayoutEntityDisplayTest.php b/core/modules/field_layout/tests/src/Kernel/FieldLayoutEntityDisplayTest.php index 230493db80..1f94b9da38 100644 --- a/core/modules/field_layout/tests/src/Kernel/FieldLayoutEntityDisplayTest.php +++ b/core/modules/field_layout/tests/src/Kernel/FieldLayoutEntityDisplayTest.php @@ -14,7 +14,13 @@ class FieldLayoutEntityDisplayTest extends KernelTestBase { /** * {@inheritdoc} */ - protected static $modules = ['layout_discovery', 'field_layout', 'entity_test', 'field_layout_test', 'system']; + protected static $modules = [ + 'layout_discovery', + 'field_layout', + 'entity_test', + 'field_layout_test', + 'system', + ]; /** * @covers ::preSave diff --git a/core/modules/field_ui/tests/modules/field_ui_test/field_ui_test.module b/core/modules/field_ui/tests/modules/field_ui_test/field_ui_test.module index 21b2272747..bf765a68f6 100644 --- a/core/modules/field_ui/tests/modules/field_ui_test/field_ui_test.module +++ b/core/modules/field_ui/tests/modules/field_ui_test/field_ui_test.module @@ -29,7 +29,12 @@ function field_ui_test_form_entity_view_display_edit_form_alter(&$form, FormStat } $table['indent'] = [ - '#attributes' => ['class' => ['draggable', 'field-group'], 'id' => 'indent-id'], + '#attributes' => [ + 'class' => [ + 'draggable', 'field-group', + ], + 'id' => 'indent-id', + ], '#row_type' => 'group', '#region_callback' => 'field_ui_test_region_callback', '#js_settings' => ['rowHandler' => 'group'], diff --git a/core/modules/field_ui/tests/src/Functional/FieldUIDeleteTest.php b/core/modules/field_ui/tests/src/Functional/FieldUIDeleteTest.php index ef047f6d47..1b3e2a7fa4 100644 --- a/core/modules/field_ui/tests/src/Functional/FieldUIDeleteTest.php +++ b/core/modules/field_ui/tests/src/Functional/FieldUIDeleteTest.php @@ -23,7 +23,13 @@ class FieldUIDeleteTest extends BrowserTestBase { * * @var array */ - public static $modules = ['node', 'field_ui', 'field_test', 'block', 'field_test_views']; + public static $modules = [ + 'node', + 'field_ui', + 'field_test', + 'block', + 'field_test_views', + ]; /** * {@inheritdoc} @@ -48,7 +54,17 @@ protected function setUp() { $this->drupalPlaceBlock('page_title_block'); // Create a test user. - $admin_user = $this->drupalCreateUser(['access content', 'administer content types', 'administer node fields', 'administer node form display', 'administer node display', 'administer users', 'administer account settings', 'administer user display', 'bypass node access']); + $admin_user = $this->drupalCreateUser([ + 'access content', + 'administer content types', + 'administer node fields', + 'administer node form display', + 'administer node display', + 'administer users', + 'administer account settings', + 'administer user display', + 'bypass node access', + ]); $this->drupalLogin($admin_user); } diff --git a/core/modules/field_ui/tests/src/Functional/FieldUIIndentationTest.php b/core/modules/field_ui/tests/src/Functional/FieldUIIndentationTest.php index 0eeff4bcbd..26417e8c42 100644 --- a/core/modules/field_ui/tests/src/Functional/FieldUIIndentationTest.php +++ b/core/modules/field_ui/tests/src/Functional/FieldUIIndentationTest.php @@ -30,7 +30,11 @@ protected function setUp() { parent::setUp(); // Create a test user. - $admin_user = $this->drupalCreateUser(['access content', 'administer content types', 'administer node display']); + $admin_user = $this->drupalCreateUser([ + 'access content', + 'administer content types', + 'administer node display', + ]); $this->drupalLogin($admin_user); // Create Basic page node type. diff --git a/core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php b/core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php index 60ab7c03fd..624b5cb60c 100644 --- a/core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php +++ b/core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php @@ -25,7 +25,15 @@ class ManageDisplayTest extends BrowserTestBase { * * @var array */ - public static $modules = ['node', 'field_ui', 'taxonomy', 'search', 'field_test', 'field_third_party_test', 'block']; + public static $modules = [ + 'node', + 'field_ui', + 'taxonomy', + 'search', + 'field_test', + 'field_third_party_test', + 'block', + ]; /** * {@inheritdoc} @@ -41,7 +49,20 @@ protected function setUp() { $this->drupalPlaceBlock('local_tasks_block'); // Create a test user. - $admin_user = $this->drupalCreateUser(['access content', 'administer content types', 'administer node fields', 'administer node form display', 'administer node display', 'administer taxonomy', 'administer taxonomy_term fields', 'administer taxonomy_term display', 'administer users', 'administer account settings', 'administer user display', 'bypass node access']); + $admin_user = $this->drupalCreateUser([ + 'access content', + 'administer content types', + 'administer node fields', + 'administer node form display', + 'administer node display', + 'administer taxonomy', + 'administer taxonomy_term fields', + 'administer taxonomy_term display', + 'administer users', + 'administer account settings', + 'administer user display', + 'bypass node access', + ]); $this->drupalLogin($admin_user); // Create content type, with underscores. diff --git a/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php b/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php index c9dcd3490c..bd8f631ea3 100644 --- a/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php +++ b/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php @@ -27,7 +27,14 @@ class ManageFieldsFunctionalTest extends BrowserTestBase { * * @var array */ - public static $modules = ['node', 'field_ui', 'field_test', 'taxonomy', 'image', 'block']; + public static $modules = [ + 'node', + 'field_ui', + 'field_test', + 'taxonomy', + 'image', + 'block', + ]; /** * {@inheritdoc} @@ -74,12 +81,28 @@ protected function setUp() { $this->drupalPlaceBlock('page_title_block'); // Create a test user. - $admin_user = $this->drupalCreateUser(['access content', 'administer content types', 'administer node fields', 'administer node form display', 'administer node display', 'administer taxonomy', 'administer taxonomy_term fields', 'administer taxonomy_term display', 'administer users', 'administer account settings', 'administer user display', 'bypass node access']); + $admin_user = $this->drupalCreateUser([ + 'access content', + 'administer content types', + 'administer node fields', + 'administer node form display', + 'administer node display', + 'administer taxonomy', + 'administer taxonomy_term fields', + 'administer taxonomy_term display', + 'administer users', + 'administer account settings', + 'administer user display', + 'bypass node access', + ]); $this->drupalLogin($admin_user); // Create content type, with underscores. $type_name = strtolower($this->randomMachineName(8)) . '_test'; - $type = $this->drupalCreateContentType(['name' => $type_name, 'type' => $type_name]); + $type = $this->drupalCreateContentType([ + 'name' => $type_name, + 'type' => $type_name, + ]); $this->contentType = $type->id(); // Create random field name with markup to test escaping. diff --git a/core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php b/core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php index 45fa8e818e..c5d82bbd7a 100644 --- a/core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php +++ b/core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php @@ -51,7 +51,17 @@ protected function setUp() { $this->drupalPlaceBlock('system_breadcrumb_block'); // Create a test user. - $admin_user = $this->drupalCreateUser(['access content', 'administer content types', 'administer node fields', 'administer node form display', 'administer node display', 'administer users', 'administer account settings', 'administer user display', 'bypass node access']); + $admin_user = $this->drupalCreateUser([ + 'access content', + 'administer content types', + 'administer node fields', + 'administer node form display', + 'administer node display', + 'administer users', + 'administer account settings', + 'administer user display', + 'bypass node access', + ]); $this->drupalLogin($admin_user); // Create content type, with underscores. diff --git a/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php b/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php index 2e6963e0a5..15ddc398aa 100644 --- a/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php +++ b/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php @@ -28,7 +28,16 @@ class EntityDisplayTest extends KernelTestBase { * * @var string[] */ - public static $modules = ['field_ui', 'field', 'entity_test', 'user', 'text', 'field_test', 'node', 'system']; + public static $modules = [ + 'field_ui', + 'field', + 'entity_test', + 'user', + 'text', + 'field_test', + 'node', + 'system', + ]; protected function setUp() { parent::setUp(); @@ -102,12 +111,18 @@ public function testEntityDisplayCRUD() { // Check that createCopy() creates a new component that can be correctly // saved. - EntityViewMode::create(['id' => $display->getTargetEntityTypeId() . '.other_view_mode', 'targetEntityType' => $display->getTargetEntityTypeId()])->save(); + EntityViewMode::create([ + 'id' => $display->getTargetEntityTypeId() . '.other_view_mode', + 'targetEntityType' => $display->getTargetEntityTypeId(), + ])->save(); $new_display = $display->createCopy('other_view_mode'); $new_display->save(); $new_display = EntityViewDisplay::load($new_display->id()); $dependencies = $new_display->calculateDependencies()->getDependencies(); - $this->assertEqual(['config' => ['core.entity_view_mode.entity_test.other_view_mode'], 'module' => ['entity_test']], $dependencies); + $this->assertEqual([ + 'config' => ['core.entity_view_mode.entity_test.other_view_mode'], + 'module' => ['entity_test'], + ], $dependencies); $this->assertEqual($new_display->getTargetEntityTypeId(), $display->getTargetEntityTypeId()); $this->assertEqual($new_display->getTargetBundle(), $display->getTargetBundle()); $this->assertEqual($new_display->getMode(), 'other_view_mode'); @@ -129,7 +144,12 @@ public function testEntityDisplayCRUDSort() { $display->save(); $components = array_keys($display->getComponents()); // The name field is not configurable so will be added automatically. - $expected = [0 => 'component_1', 1 => 'component_2', 2 => 'component_3', 'name']; + $expected = [ + 0 => 'component_1', + 1 => 'component_2', + 2 => 'component_3', + 'name', + ]; $this->assertIdentical($components, $expected); } @@ -276,7 +296,10 @@ public function testFieldComponent() { // Check that the display has dependencies on the field and the module that // provides the formatter. $dependencies = $display->calculateDependencies()->getDependencies(); - $this->assertEqual(['config' => ['field.field.entity_test.entity_test.test_field'], 'module' => ['entity_test', 'field_test']], $dependencies); + $this->assertEqual([ + 'config' => ['field.field.entity_test.entity_test.test_field'], + 'module' => ['entity_test', 'field_test'], + ], $dependencies); } /** @@ -382,7 +405,10 @@ public function testDeleteField() { $field->save(); // Create default and teaser entity display. - EntityViewMode::create(['id' => 'entity_test.teaser', 'targetEntityType' => 'entity_test'])->save(); + EntityViewMode::create([ + 'id' => 'entity_test.teaser', + 'targetEntityType' => 'entity_test', + ])->save(); EntityViewDisplay::create([ 'targetEntityType' => 'entity_test', 'bundle' => 'entity_test', diff --git a/core/modules/field_ui/tests/src/Kernel/EntityFormDisplayTest.php b/core/modules/field_ui/tests/src/Kernel/EntityFormDisplayTest.php index 0d14cac2b4..d0d7e58d23 100644 --- a/core/modules/field_ui/tests/src/Kernel/EntityFormDisplayTest.php +++ b/core/modules/field_ui/tests/src/Kernel/EntityFormDisplayTest.php @@ -20,7 +20,14 @@ class EntityFormDisplayTest extends KernelTestBase { * * @var string[] */ - public static $modules = ['field_ui', 'field', 'entity_test', 'field_test', 'user', 'text']; + public static $modules = [ + 'field_ui', + 'field', + 'entity_test', + 'field_test', + 'user', + 'text', + ]; protected function setUp() { parent::setUp(); diff --git a/core/modules/file/file.module b/core/modules/file/file.module index 0f8416b369..2b3781f151 100644 --- a/core/modules/file/file.module +++ b/core/modules/file/file.module @@ -611,7 +611,11 @@ function file_theme() { 'file' => 'file.field.inc', ], 'file_upload_help' => [ - 'variables' => ['description' => NULL, 'upload_validators' => NULL, 'cardinality' => NULL], + 'variables' => [ + 'description' => NULL, + 'upload_validators' => NULL, + 'cardinality' => NULL, + ], 'file' => 'file.field.inc', ], ]; diff --git a/core/modules/file/src/FileViewsData.php b/core/modules/file/src/FileViewsData.php index aad5ac23a4..b3f519b15e 100644 --- a/core/modules/file/src/FileViewsData.php +++ b/core/modules/file/src/FileViewsData.php @@ -118,7 +118,13 @@ public function getViewsData() { 'help' => $this->t('Content that is associated with this file, usually because this file is in a field on the content.'), // Only provide this field/relationship/etc., // when the 'file_managed' base table is present. - 'skip base' => ['node_field_data', 'node_field_revision', 'users_field_data', 'comment_field_data', 'taxonomy_term_field_data'], + 'skip base' => [ + 'node_field_data', + 'node_field_revision', + 'users_field_data', + 'comment_field_data', + 'taxonomy_term_field_data', + ], 'real field' => 'id', 'relationship' => [ 'title' => $this->t('Content'), @@ -134,7 +140,12 @@ public function getViewsData() { 'help' => $this->t('A file that is associated with this node, usually because it is in a field on the node.'), // Only provide this field/relationship/etc., // when the 'node' base table is present. - 'skip base' => ['file_managed', 'users_field_data', 'comment_field_data', 'taxonomy_term_field_data'], + 'skip base' => [ + 'file_managed', + 'users_field_data', + 'comment_field_data', + 'taxonomy_term_field_data', + ], 'real field' => 'fid', 'relationship' => [ 'title' => $this->t('File'), @@ -151,7 +162,13 @@ public function getViewsData() { 'help' => $this->t('A user that is associated with this file, usually because this file is in a field on the user.'), // Only provide this field/relationship/etc., // when the 'file_managed' base table is present. - 'skip base' => ['node_field_data', 'node_field_revision', 'users_field_data', 'comment_field_data', 'taxonomy_term_field_data'], + 'skip base' => [ + 'node_field_data', + 'node_field_revision', + 'users_field_data', + 'comment_field_data', + 'taxonomy_term_field_data', + ], 'real field' => 'id', 'relationship' => [ 'title' => $this->t('User'), @@ -167,7 +184,13 @@ public function getViewsData() { 'help' => $this->t('A file that is associated with this user, usually because it is in a field on the user.'), // Only provide this field/relationship/etc., // when the 'users' base table is present. - 'skip base' => ['file_managed', 'node_field_data', 'node_field_revision', 'comment_field_data', 'taxonomy_term_field_data'], + 'skip base' => [ + 'file_managed', + 'node_field_data', + 'node_field_revision', + 'comment_field_data', + 'taxonomy_term_field_data', + ], 'real field' => 'fid', 'relationship' => [ 'title' => $this->t('File'), @@ -200,7 +223,13 @@ public function getViewsData() { 'help' => $this->t('A file that is associated with this comment, usually because it is in a field on the comment.'), // Only provide this field/relationship/etc., // when the 'comment' base table is present. - 'skip base' => ['file_managed', 'node_field_data', 'node_field_revision', 'users_field_data', 'taxonomy_term_field_data'], + 'skip base' => [ + 'file_managed', + 'node_field_data', + 'node_field_revision', + 'users_field_data', + 'taxonomy_term_field_data', + ], 'real field' => 'fid', 'relationship' => [ 'title' => $this->t('File'), @@ -217,7 +246,13 @@ public function getViewsData() { 'help' => $this->t('A taxonomy term that is associated with this file, usually because this file is in a field on the taxonomy term.'), // Only provide this field/relationship/etc., // when the 'file_managed' base table is present. - 'skip base' => ['node_field_data', 'node_field_revision', 'users_field_data', 'comment_field_data', 'taxonomy_term_field_data'], + 'skip base' => [ + 'node_field_data', + 'node_field_revision', + 'users_field_data', + 'comment_field_data', + 'taxonomy_term_field_data', + ], 'real field' => 'id', 'relationship' => [ 'title' => $this->t('Taxonomy Term'), @@ -233,7 +268,13 @@ public function getViewsData() { 'help' => $this->t('A file that is associated with this taxonomy term, usually because it is in a field on the taxonomy term.'), // Only provide this field/relationship/etc., // when the 'taxonomy_term_data' base table is present. - 'skip base' => ['file_managed', 'node_field_data', 'node_field_revision', 'users_field_data', 'comment_field_data'], + 'skip base' => [ + 'file_managed', + 'node_field_data', + 'node_field_revision', + 'users_field_data', + 'comment_field_data', + ], 'real field' => 'fid', 'relationship' => [ 'title' => $this->t('File'), diff --git a/core/modules/file/tests/src/Functional/FileFieldDisplayTest.php b/core/modules/file/tests/src/Functional/FileFieldDisplayTest.php index 922985cb4e..0c8b5f944d 100644 --- a/core/modules/file/tests/src/Functional/FileFieldDisplayTest.php +++ b/core/modules/file/tests/src/Functional/FileFieldDisplayTest.php @@ -41,7 +41,12 @@ public function testNodeDisplay() { $node = $this->drupalCreateNode(['type' => $type_name]); // Check file_default last as the assertions below assume that this is the // case. - $file_formatters = ['file_table', 'file_url_plain', 'hidden', 'file_default']; + $file_formatters = [ + 'file_table', + 'file_url_plain', + 'hidden', + 'file_default', + ]; foreach ($file_formatters as $formatter) { if ($formatter === 'hidden') { $edit = [ diff --git a/core/modules/file/tests/src/Functional/FileFieldTestBase.php b/core/modules/file/tests/src/Functional/FileFieldTestBase.php index ec85536792..4d4eb5e666 100644 --- a/core/modules/file/tests/src/Functional/FileFieldTestBase.php +++ b/core/modules/file/tests/src/Functional/FileFieldTestBase.php @@ -37,7 +37,18 @@ */ protected function setUp() { parent::setUp(); - $this->adminUser = $this->drupalCreateUser(['access content', 'access administration pages', 'administer site configuration', 'administer users', 'administer permissions', 'administer content types', 'administer node fields', 'administer node display', 'administer nodes', 'bypass node access']); + $this->adminUser = $this->drupalCreateUser([ + 'access content', + 'access administration pages', + 'administer site configuration', + 'administer users', + 'administer permissions', + 'administer content types', + 'administer node fields', + 'administer node display', + 'administer nodes', + 'bypass node access', + ]); $this->drupalLogin($this->adminUser); $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']); } diff --git a/core/modules/file/tests/src/Functional/FileFieldWidgetTest.php b/core/modules/file/tests/src/Functional/FileFieldWidgetTest.php index ff14143a65..ed9a2fecb4 100644 --- a/core/modules/file/tests/src/Functional/FileFieldWidgetTest.php +++ b/core/modules/file/tests/src/Functional/FileFieldWidgetTest.php @@ -207,7 +207,12 @@ public function testMultiValuedWidget() { $this->assertTrue(empty($node->{$field_name}->target_id), 'Node was successfully saved without any files.'); // Try to upload more files than allowed on revision. - $upload_files_node_revision = [$test_file, $test_file, $test_file, $test_file]; + $upload_files_node_revision = [ + $test_file, + $test_file, + $test_file, + $test_file, + ]; foreach ($upload_files_node_revision as $i => $file) { $edit['files[test_file_field_1_0][' . $i . ']'] = \Drupal::service('file_system')->realpath($test_file->getFileUri()); } diff --git a/core/modules/file/tests/src/Functional/FileOnTranslatedEntityTest.php b/core/modules/file/tests/src/Functional/FileOnTranslatedEntityTest.php index 7bc1e0a808..948873cb6e 100644 --- a/core/modules/file/tests/src/Functional/FileOnTranslatedEntityTest.php +++ b/core/modules/file/tests/src/Functional/FileOnTranslatedEntityTest.php @@ -42,7 +42,11 @@ protected function setUp() { // Create the "Basic page" node type. // @todo Remove the disabling of new revision creation in // https://www.drupal.org/node/1239558. - $this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page', 'new_revision' => FALSE]); + $this->drupalCreateContentType([ + 'type' => 'page', + 'name' => 'Basic page', + 'new_revision' => FALSE, + ]); // Create a file field on the "Basic page" node type. $this->fieldName = strtolower($this->randomMachineName()); diff --git a/core/modules/file/tests/src/FunctionalJavascript/FileFieldWidgetTest.php b/core/modules/file/tests/src/FunctionalJavascript/FileFieldWidgetTest.php index b24b381369..c398da5cf7 100644 --- a/core/modules/file/tests/src/FunctionalJavascript/FileFieldWidgetTest.php +++ b/core/modules/file/tests/src/FunctionalJavascript/FileFieldWidgetTest.php @@ -42,7 +42,18 @@ class FileFieldWidgetTest extends WebDriverTestBase { */ protected function setUp() { parent::setUp(); - $this->adminUser = $this->drupalCreateUser(['access content', 'access administration pages', 'administer site configuration', 'administer users', 'administer permissions', 'administer content types', 'administer node fields', 'administer node display', 'administer nodes', 'bypass node access']); + $this->adminUser = $this->drupalCreateUser([ + 'access content', + 'access administration pages', + 'administer site configuration', + 'administer users', + 'administer permissions', + 'administer content types', + 'administer node fields', + 'administer node display', + 'administer nodes', + 'bypass node access', + ]); $this->drupalLogin($this->adminUser); $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']); } diff --git a/core/modules/file/tests/src/FunctionalJavascript/FileManagedFileElementTest.php b/core/modules/file/tests/src/FunctionalJavascript/FileManagedFileElementTest.php index a4f2c0ca55..625878ad88 100644 --- a/core/modules/file/tests/src/FunctionalJavascript/FileManagedFileElementTest.php +++ b/core/modules/file/tests/src/FunctionalJavascript/FileManagedFileElementTest.php @@ -33,7 +33,18 @@ class FileManagedFileElementTest extends WebDriverTestBase { */ protected function setUp() { parent::setUp(); - $this->adminUser = $this->drupalCreateUser(['access content', 'access administration pages', 'administer site configuration', 'administer users', 'administer permissions', 'administer content types', 'administer node fields', 'administer node display', 'administer nodes', 'bypass node access']); + $this->adminUser = $this->drupalCreateUser([ + 'access content', + 'access administration pages', + 'administer site configuration', + 'administer users', + 'administer permissions', + 'administer content types', + 'administer node fields', + 'administer node display', + 'administer nodes', + 'bypass node access', + ]); $this->drupalLogin($this->adminUser); $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']); } diff --git a/core/modules/file/tests/src/Kernel/FileItemValidationTest.php b/core/modules/file/tests/src/Kernel/FileItemValidationTest.php index 6fbc82f39a..5716c5ef77 100644 --- a/core/modules/file/tests/src/Kernel/FileItemValidationTest.php +++ b/core/modules/file/tests/src/Kernel/FileItemValidationTest.php @@ -20,7 +20,14 @@ class FileItemValidationTest extends KernelTestBase { /** * {@inheritdoc} */ - public static $modules = ['file', 'image', 'entity_test', 'field', 'user', 'system']; + public static $modules = [ + 'file', + 'image', + 'entity_test', + 'field', + 'user', + 'system', + ]; /** * A user. diff --git a/core/modules/filter/tests/src/Functional/FilterAdminTest.php b/core/modules/filter/tests/src/Functional/FilterAdminTest.php index 3f608265ad..b0553f967e 100644 --- a/core/modules/filter/tests/src/Functional/FilterAdminTest.php +++ b/core/modules/filter/tests/src/Functional/FilterAdminTest.php @@ -20,7 +20,13 @@ class FilterAdminTest extends BrowserTestBase { /** * {@inheritdoc} */ - public static $modules = ['block', 'filter', 'node', 'filter_test_plugin', 'dblog']; + public static $modules = [ + 'block', + 'filter', + 'node', + 'filter_test_plugin', + 'dblog', + ]; /** * {@inheritdoc} diff --git a/core/modules/filter/tests/src/Functional/FilterHooksTest.php b/core/modules/filter/tests/src/Functional/FilterHooksTest.php index a70a95f965..3fd9513c2e 100644 --- a/core/modules/filter/tests/src/Functional/FilterHooksTest.php +++ b/core/modules/filter/tests/src/Functional/FilterHooksTest.php @@ -36,7 +36,11 @@ public function testFilterHooks() { $type = $this->drupalCreateContentType(['name' => $type_name, 'type' => $type_name]); $node_permission = "create $type_name content"; - $admin_user = $this->drupalCreateUser(['administer filters', 'administer nodes', $node_permission]); + $admin_user = $this->drupalCreateUser([ + 'administer filters', + 'administer nodes', + $node_permission, + ]); $this->drupalLogin($admin_user); // Add a text format. diff --git a/core/modules/filter/tests/src/Functional/FilterSecurityTest.php b/core/modules/filter/tests/src/Functional/FilterSecurityTest.php index 103c6e3cde..1d6c10cc43 100644 --- a/core/modules/filter/tests/src/Functional/FilterSecurityTest.php +++ b/core/modules/filter/tests/src/Functional/FilterSecurityTest.php @@ -46,7 +46,11 @@ protected function setUp() { $filtered_html_permission = $filtered_html_format->getPermissionName(); user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, [$filtered_html_permission]); - $this->adminUser = $this->drupalCreateUser(['administer modules', 'administer filters', 'administer site configuration']); + $this->adminUser = $this->drupalCreateUser([ + 'administer modules', + 'administer filters', + 'administer site configuration', + ]); $this->drupalLogin($this->adminUser); } diff --git a/core/modules/filter/tests/src/Kernel/FilterAPITest.php b/core/modules/filter/tests/src/Kernel/FilterAPITest.php index 7d2d4a8e13..6a961306c7 100644 --- a/core/modules/filter/tests/src/Kernel/FilterAPITest.php +++ b/core/modules/filter/tests/src/Kernel/FilterAPITest.php @@ -110,7 +110,12 @@ public function testFilterFormatAPI() { 'br' => FALSE, 'strong' => FALSE, 'a' => ['href' => TRUE, 'hreflang' => TRUE], - '*' => ['style' => FALSE, 'on*' => FALSE, 'lang' => TRUE, 'dir' => ['ltr' => TRUE, 'rtl' => TRUE]], + '*' => [ + 'style' => FALSE, + 'on*' => FALSE, + 'lang' => TRUE, + 'dir' => ['ltr' => TRUE, 'rtl' => TRUE], + ], ], ], 'FilterFormatInterface::getHtmlRestrictions() works as expected for the filtered_html format.' @@ -197,7 +202,12 @@ public function testFilterFormatAPI() { 'p' => FALSE, 'br' => FALSE, 'a' => ['href' => TRUE], - '*' => ['style' => FALSE, 'on*' => FALSE, 'lang' => TRUE, 'dir' => ['ltr' => TRUE, 'rtl' => TRUE]], + '*' => [ + 'style' => FALSE, + 'on*' => FALSE, + 'lang' => TRUE, + 'dir' => ['ltr' => TRUE, 'rtl' => TRUE], + ], ], ], 'FilterFormatInterface::getHtmlRestrictions() works as expected for the very_restricted_html format.' @@ -232,7 +242,12 @@ public function testFilterFormatAPI() { 'b' => ['class' => TRUE], 'c' => ['class' => TRUE], 'd' => ['class' => ['foo' => TRUE, 'bar-*' => TRUE]], - '*' => ['style' => FALSE, 'on*' => FALSE, 'lang' => TRUE, 'dir' => ['ltr' => TRUE, 'rtl' => TRUE]], + '*' => [ + 'style' => FALSE, + 'on*' => FALSE, + 'lang' => TRUE, + 'dir' => ['ltr' => TRUE, 'rtl' => TRUE], + ], ], ], 'FilterFormatInterface::getHtmlRestrictions() works as expected for the nonsensical_restricted_html format.' diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module index a505c3f1d0..1530d994b9 100644 --- a/core/modules/forum/forum.module +++ b/core/modules/forum/forum.module @@ -87,13 +87,28 @@ function forum_help($route_name, RouteMatchInterface $route_match) { function forum_theme() { return [ 'forums' => [ - 'variables' => ['forums' => [], 'topics' => [], 'topics_pager' => [], 'parents' => NULL, 'term' => NULL, 'sortby' => NULL, 'forum_per_page' => NULL, 'header' => []], + 'variables' => [ + 'forums' => [], + 'topics' => [], + 'topics_pager' => [], + 'parents' => NULL, + 'term' => NULL, + 'sortby' => NULL, + 'forum_per_page' => NULL, + 'header' => [], + ], ], 'forum_list' => [ 'variables' => ['forums' => NULL, 'parents' => NULL, 'tid' => NULL], ], 'forum_icon' => [ - 'variables' => ['new_posts' => NULL, 'num_posts' => 0, 'comment_mode' => 0, 'sticky' => 0, 'first_new' => FALSE], + 'variables' => [ + 'new_posts' => NULL, + 'num_posts' => 0, + 'comment_mode' => 0, + 'sticky' => 0, + 'first_new' => FALSE, + ], ], 'forum_submitted' => [ 'variables' => ['topic' => NULL], diff --git a/core/modules/forum/src/ForumIndexStorage.php b/core/modules/forum/src/ForumIndexStorage.php index 244c223ba6..748091c21a 100644 --- a/core/modules/forum/src/ForumIndexStorage.php +++ b/core/modules/forum/src/ForumIndexStorage.php @@ -129,7 +129,15 @@ public function updateIndex(NodeInterface $node) { */ public function createIndex(NodeInterface $node) { $query = $this->database->insert('forum_index') - ->fields(['nid', 'title', 'tid', 'sticky', 'created', 'comment_count', 'last_comment_timestamp']); + ->fields([ + 'nid', + 'title', + 'tid', + 'sticky', + 'created', + 'comment_count', + 'last_comment_timestamp', + ]); foreach ($node->getTranslationLanguages() as $langcode => $language) { $translation = $node->getTranslation($langcode); foreach ($translation->taxonomy_forums as $item) { diff --git a/core/modules/forum/src/ForumSettingsForm.php b/core/modules/forum/src/ForumSettingsForm.php index 87a13bef7b..671d6b1548 100644 --- a/core/modules/forum/src/ForumSettingsForm.php +++ b/core/modules/forum/src/ForumSettingsForm.php @@ -32,7 +32,27 @@ protected function getEditableConfigNames() { public function buildForm(array $form, FormStateInterface $form_state) { $config = $this->config('forum.settings'); - $options = [5, 10, 15, 20, 25, 30, 35, 40, 50, 60, 80, 100, 150, 200, 250, 300, 350, 400, 500]; + $options = [ + 5, + 10, + 15, + 20, + 25, + 30, + 35, + 40, + 50, + 60, + 80, + 100, + 150, + 200, + 250, + 300, + 350, + 400, + 500, + ]; $form['forum_hot_topic'] = [ '#type' => 'select', '#title' => $this->t('Hot topic threshold'), diff --git a/core/modules/forum/tests/src/Functional/ForumIndexTest.php b/core/modules/forum/tests/src/Functional/ForumIndexTest.php index 3bb803a971..de07fd0c4e 100644 --- a/core/modules/forum/tests/src/Functional/ForumIndexTest.php +++ b/core/modules/forum/tests/src/Functional/ForumIndexTest.php @@ -27,7 +27,13 @@ protected function setUp() { parent::setUp(); // Create a test user. - $web_user = $this->drupalCreateUser(['create forum content', 'edit own forum content', 'edit any forum content', 'administer nodes', 'administer forums']); + $web_user = $this->drupalCreateUser([ + 'create forum content', + 'edit own forum content', + 'edit any forum content', + 'administer nodes', + 'administer forums', + ]); $this->drupalLogin($web_user); } diff --git a/core/modules/forum/tests/src/Functional/ForumNodeAccessTest.php b/core/modules/forum/tests/src/Functional/ForumNodeAccessTest.php index 212bbdd2b5..acf3f2a7e9 100644 --- a/core/modules/forum/tests/src/Functional/ForumNodeAccessTest.php +++ b/core/modules/forum/tests/src/Functional/ForumNodeAccessTest.php @@ -17,7 +17,15 @@ class ForumNodeAccessTest extends BrowserTestBase { * * @var array */ - public static $modules = ['node', 'comment', 'forum', 'taxonomy', 'tracker', 'node_access_test', 'block']; + public static $modules = [ + 'node', + 'comment', + 'forum', + 'taxonomy', + 'tracker', + 'node_access_test', + 'block', + ]; /** * {@inheritdoc} @@ -41,7 +49,12 @@ public function testForumNodeAccess() { // Create some users. $access_user = $this->drupalCreateUser(['node test view']); $no_access_user = $this->drupalCreateUser(); - $admin_user = $this->drupalCreateUser(['access administration pages', 'administer modules', 'administer blocks', 'create forum content']); + $admin_user = $this->drupalCreateUser([ + 'access administration pages', + 'administer modules', + 'administer blocks', + 'create forum content', + ]); $this->drupalLogin($admin_user); diff --git a/core/modules/forum/tests/src/Functional/ForumTest.php b/core/modules/forum/tests/src/Functional/ForumTest.php index d906baf278..f6631abdc5 100644 --- a/core/modules/forum/tests/src/Functional/ForumTest.php +++ b/core/modules/forum/tests/src/Functional/ForumTest.php @@ -26,7 +26,15 @@ class ForumTest extends BrowserTestBase { * * @var array */ - public static $modules = ['taxonomy', 'comment', 'forum', 'node', 'block', 'menu_ui', 'help']; + public static $modules = [ + 'taxonomy', + 'comment', + 'forum', + 'node', + 'block', + 'menu_ui', + 'help', + ]; /** * {@inheritdoc} diff --git a/core/modules/forum/tests/src/Functional/ForumUninstallTest.php b/core/modules/forum/tests/src/Functional/ForumUninstallTest.php index 84c81c8933..15dbe3534e 100644 --- a/core/modules/forum/tests/src/Functional/ForumUninstallTest.php +++ b/core/modules/forum/tests/src/Functional/ForumUninstallTest.php @@ -32,7 +32,13 @@ class ForumUninstallTest extends BrowserTestBase { * Tests if forum module uninstallation properly deletes the field. */ public function testForumUninstallWithField() { - $this->drupalLogin($this->drupalCreateUser(['administer taxonomy', 'administer nodes', 'administer modules', 'delete any forum content', 'administer content types'])); + $this->drupalLogin($this->drupalCreateUser([ + 'administer taxonomy', + 'administer nodes', + 'administer modules', + 'delete any forum content', + 'administer content types', + ])); // Ensure that the field exists before uninstallation. $field_storage = FieldStorageConfig::loadByName('node', 'taxonomy_forums'); $this->assertNotNull($field_storage, 'The taxonomy_forums field storage exists.'); diff --git a/core/modules/forum/tests/src/Functional/Views/ForumIntegrationTest.php b/core/modules/forum/tests/src/Functional/Views/ForumIntegrationTest.php index eda9006f9e..05e5683825 100644 --- a/core/modules/forum/tests/src/Functional/Views/ForumIntegrationTest.php +++ b/core/modules/forum/tests/src/Functional/Views/ForumIntegrationTest.php @@ -53,7 +53,11 @@ public function testForumIntegration() { // Create some nodes which are part of this forum with some comments. $nodes = []; for ($i = 0; $i < 3; $i++) { - $node = $this->drupalCreateNode(['type' => 'forum', 'taxonomy_forums' => [$term->id()], 'sticky' => $i == 0 ? NodeInterface::STICKY : NodeInterface::NOT_STICKY]); + $node = $this->drupalCreateNode([ + 'type' => 'forum', + 'taxonomy_forums' => [$term->id()], + 'sticky' => $i == 0 ? NodeInterface::STICKY : NodeInterface::NOT_STICKY, + ]); $nodes[] = $node; } @@ -63,7 +67,11 @@ public function testForumIntegration() { $comments = []; foreach ($nodes as $index => $node) { for ($i = 0; $i <= $index; $i++) { - $comment = $comment_storage->create(['entity_type' => 'node', 'entity_id' => $node->id(), 'field_name' => 'comment_forum']); + $comment = $comment_storage->create([ + 'entity_type' => 'node', + 'entity_id' => $node->id(), + 'field_name' => 'comment_forum', + ]); $comment->save(); $comments[$comment->get('entity_id')->target_id][$comment->id()] = $comment; } diff --git a/core/modules/forum/tests/src/Unit/Breadcrumb/ForumListingBreadcrumbBuilderTest.php b/core/modules/forum/tests/src/Unit/Breadcrumb/ForumListingBreadcrumbBuilderTest.php index 21fcd71e2e..194fa45706 100644 --- a/core/modules/forum/tests/src/Unit/Breadcrumb/ForumListingBreadcrumbBuilderTest.php +++ b/core/modules/forum/tests/src/Unit/Breadcrumb/ForumListingBreadcrumbBuilderTest.php @@ -215,7 +215,11 @@ public function testBuild() { $breadcrumb = $breadcrumb_builder->build($route_match); $this->assertEquals($expected1, $breadcrumb->getLinks()); $this->assertEquals(['route'], $breadcrumb->getCacheContexts()); - $this->assertEquals(['taxonomy_term:1', 'taxonomy_term:23', 'taxonomy_vocabulary:5'], $breadcrumb->getCacheTags()); + $this->assertEquals([ + 'taxonomy_term:1', + 'taxonomy_term:23', + 'taxonomy_vocabulary:5', + ], $breadcrumb->getCacheTags()); $this->assertEquals(Cache::PERMANENT, $breadcrumb->getCacheMaxAge()); // Second test. @@ -228,7 +232,12 @@ public function testBuild() { $breadcrumb = $breadcrumb_builder->build($route_match); $this->assertEquals($expected2, $breadcrumb->getLinks()); $this->assertEquals(['route'], $breadcrumb->getCacheContexts()); - $this->assertEquals(['taxonomy_term:1', 'taxonomy_term:2', 'taxonomy_term:23', 'taxonomy_vocabulary:5'], $breadcrumb->getCacheTags()); + $this->assertEquals([ + 'taxonomy_term:1', + 'taxonomy_term:2', + 'taxonomy_term:23', + 'taxonomy_vocabulary:5', + ], $breadcrumb->getCacheTags()); $this->assertEquals(Cache::PERMANENT, $breadcrumb->getCacheMaxAge()); } diff --git a/core/modules/forum/tests/src/Unit/Breadcrumb/ForumNodeBreadcrumbBuilderTest.php b/core/modules/forum/tests/src/Unit/Breadcrumb/ForumNodeBreadcrumbBuilderTest.php index 26582d2d89..707717548e 100644 --- a/core/modules/forum/tests/src/Unit/Breadcrumb/ForumNodeBreadcrumbBuilderTest.php +++ b/core/modules/forum/tests/src/Unit/Breadcrumb/ForumNodeBreadcrumbBuilderTest.php @@ -235,7 +235,11 @@ public function testBuild() { $breadcrumb = $breadcrumb_builder->build($route_match); $this->assertEquals($expected2, $breadcrumb->getLinks()); $this->assertEquals(['route'], $breadcrumb->getCacheContexts()); - $this->assertEquals(['taxonomy_term:1', 'taxonomy_term:2', 'taxonomy_vocabulary:5'], $breadcrumb->getCacheTags()); + $this->assertEquals([ + 'taxonomy_term:1', + 'taxonomy_term:2', + 'taxonomy_vocabulary:5', + ], $breadcrumb->getCacheTags()); $this->assertEquals(Cache::PERMANENT, $breadcrumb->getCacheMaxAge()); } diff --git a/core/modules/forum/tests/src/Unit/ForumUninstallValidatorTest.php b/core/modules/forum/tests/src/Unit/ForumUninstallValidatorTest.php index 6166ea91c0..3723290f00 100644 --- a/core/modules/forum/tests/src/Unit/ForumUninstallValidatorTest.php +++ b/core/modules/forum/tests/src/Unit/ForumUninstallValidatorTest.php @@ -26,7 +26,11 @@ protected function setUp() { parent::setUp(); $this->forumUninstallValidator = $this->getMockBuilder('Drupal\forum\ForumUninstallValidator') ->disableOriginalConstructor() - ->setMethods(['hasForumNodes', 'hasTermsForVocabulary', 'getForumVocabulary']) + ->setMethods([ + 'hasForumNodes', + 'hasTermsForVocabulary', + 'getForumVocabulary', + ]) ->getMock(); $this->forumUninstallValidator->setStringTranslation($this->getStringTranslationStub()); } diff --git a/core/modules/help/tests/src/Functional/ExperimentalHelpTest.php b/core/modules/help/tests/src/Functional/ExperimentalHelpTest.php index ab8d2aca2f..a3a4fb29e4 100644 --- a/core/modules/help/tests/src/Functional/ExperimentalHelpTest.php +++ b/core/modules/help/tests/src/Functional/ExperimentalHelpTest.php @@ -19,7 +19,11 @@ class ExperimentalHelpTest extends BrowserTestBase { * * @var array */ - public static $modules = ['help', 'experimental_module_test', 'help_page_test']; + public static $modules = [ + 'help', + 'experimental_module_test', + 'help_page_test', + ]; /** * {@inheritdoc} diff --git a/core/modules/help/tests/src/Functional/HelpBlockTest.php b/core/modules/help/tests/src/Functional/HelpBlockTest.php index f4f8db5b13..8400e00fc2 100644 --- a/core/modules/help/tests/src/Functional/HelpBlockTest.php +++ b/core/modules/help/tests/src/Functional/HelpBlockTest.php @@ -14,7 +14,12 @@ class HelpBlockTest extends BrowserTestBase { /** * {@inheritdoc} */ - public static $modules = ['help', 'help_page_test', 'block', 'more_help_page_test']; + public static $modules = [ + 'help', + 'help_page_test', + 'block', + 'more_help_page_test', + ]; /** * {@inheritdoc} diff --git a/core/modules/help/tests/src/Functional/HelpTest.php b/core/modules/help/tests/src/Functional/HelpTest.php index c78d18cf6f..13fc211531 100644 --- a/core/modules/help/tests/src/Functional/HelpTest.php +++ b/core/modules/help/tests/src/Functional/HelpTest.php @@ -49,7 +49,11 @@ protected function setUp() { parent::setUp(); // Create users. - $this->adminUser = $this->drupalCreateUser(['access administration pages', 'view the administration theme', 'administer permissions']); + $this->adminUser = $this->drupalCreateUser([ + 'access administration pages', + 'view the administration theme', + 'administer permissions', + ]); $this->anyUser = $this->drupalCreateUser([]); } diff --git a/core/modules/image/image.field.inc b/core/modules/image/image.field.inc index 1afdde2fdd..ebc3959ef5 100644 --- a/core/modules/image/image.field.inc +++ b/core/modules/image/image.field.inc @@ -19,7 +19,13 @@ function template_preprocess_image_widget(&$variables) { $element = $variables['element']; - $variables['attributes'] = ['class' => ['image-widget', 'js-form-managed-file', 'form-managed-file', 'clearfix']]; + $variables['attributes'] = [ + 'class' => [ + 'image-widget', 'js-form-managed-file', + 'form-managed-file', + 'clearfix', + ], + ]; $variables['data'] = []; foreach (Element::children($element) as $child) { diff --git a/core/modules/image/image.module b/core/modules/image/image.module index dbed41c93a..a97c6f8438 100644 --- a/core/modules/image/image.module +++ b/core/modules/image/image.module @@ -123,7 +123,12 @@ function image_theme() { 'file' => 'image.field.inc', ], 'image_formatter' => [ - 'variables' => ['item' => NULL, 'item_attributes' => NULL, 'url' => NULL, 'image_style' => NULL], + 'variables' => [ + 'item' => NULL, + 'item_attributes' => NULL, + 'url' => NULL, + 'image_style' => NULL, + ], 'file' => 'image.field.inc', ], ]; diff --git a/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php b/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php index 91de41f7c0..1d7d11ec9b 100644 --- a/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php +++ b/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php @@ -333,7 +333,12 @@ public static function generateSampleValue(FieldDefinitionInterface $field_defin $min_resolution = empty($settings['min_resolution']) ? '100x100' : $settings['min_resolution']; $max_resolution = empty($settings['max_resolution']) ? '600x600' : $settings['max_resolution']; - $extensions = array_intersect(explode(' ', $settings['file_extensions']), ['png', 'gif', 'jpg', 'jpeg']); + $extensions = array_intersect(explode(' ', $settings['file_extensions']), [ + 'png', + 'gif', + 'jpg', + 'jpeg', + ]); $extension = array_rand(array_combine($extensions, $extensions)); // Generate a max of 5 different images. if (!isset($images[$extension][$min_resolution][$max_resolution]) || count($images[$extension][$min_resolution][$max_resolution]) <= 5) { diff --git a/core/modules/image/src/Plugin/ImageEffect/ScaleAndCropImageEffect.php b/core/modules/image/src/Plugin/ImageEffect/ScaleAndCropImageEffect.php index 5f06674dd6..3c925fd33f 100644 --- a/core/modules/image/src/Plugin/ImageEffect/ScaleAndCropImageEffect.php +++ b/core/modules/image/src/Plugin/ImageEffect/ScaleAndCropImageEffect.php @@ -27,8 +27,18 @@ public function applyEffect(ImageInterface $image) { $x = image_filter_keyword($x, $image->getWidth() * $scale, $width); $y = image_filter_keyword($y, $image->getHeight() * $scale, $height); - if (!$image->apply('scale_and_crop', ['x' => $x, 'y' => $y, 'width' => $width, 'height' => $height])) { - $this->logger->error('Image scale and crop failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', ['%toolkit' => $image->getToolkitId(), '%path' => $image->getSource(), '%mimetype' => $image->getMimeType(), '%dimensions' => $image->getWidth() . 'x' . $image->getHeight()]); + if (!$image->apply('scale_and_crop', [ + 'x' => $x, + 'y' => $y, + 'width' => $width, + 'height' => $height, + ])) { + $this->logger->error('Image scale and crop failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', [ + '%toolkit' => $image->getToolkitId(), + '%path' => $image->getSource(), + '%mimetype' => $image->getMimeType(), + '%dimensions' => $image->getWidth() . 'x' . $image->getHeight(), + ]); return FALSE; } return TRUE; diff --git a/core/modules/image/tests/src/Functional/ImageFieldDefaultImagesTest.php b/core/modules/image/tests/src/Functional/ImageFieldDefaultImagesTest.php index f081982689..06cfa099d8 100644 --- a/core/modules/image/tests/src/Functional/ImageFieldDefaultImagesTest.php +++ b/core/modules/image/tests/src/Functional/ImageFieldDefaultImagesTest.php @@ -50,7 +50,11 @@ public function testDefaultImages() { $filename = $this->randomMachineName() . "$i"; $desired_filepath = 'public://' . $filename; \Drupal::service('file_system')->copy($files[0]->uri, $desired_filepath, FileSystemInterface::EXISTS_ERROR); - $file = File::create(['uri' => $desired_filepath, 'filename' => $filename, 'name' => $filename]); + $file = File::create([ + 'uri' => $desired_filepath, + 'filename' => $filename, + 'name' => $filename, + ]); $file->save(); } $default_images = []; diff --git a/core/modules/image/tests/src/Functional/ImageFieldTestBase.php b/core/modules/image/tests/src/Functional/ImageFieldTestBase.php index b736e8f466..3d0421e1ac 100644 --- a/core/modules/image/tests/src/Functional/ImageFieldTestBase.php +++ b/core/modules/image/tests/src/Functional/ImageFieldTestBase.php @@ -49,7 +49,19 @@ protected function setUp() { $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']); } - $this->adminUser = $this->drupalCreateUser(['access content', 'access administration pages', 'administer site configuration', 'administer content types', 'administer node fields', 'administer nodes', 'create article content', 'edit any article content', 'delete any article content', 'administer image styles', 'administer node display']); + $this->adminUser = $this->drupalCreateUser([ + 'access content', + 'access administration pages', + 'administer site configuration', + 'administer content types', + 'administer node fields', + 'administer nodes', + 'create article content', + 'edit any article content', + 'delete any article content', + 'administer image styles', + 'administer node display', + ]); $this->drupalLogin($this->adminUser); } diff --git a/core/modules/image/tests/src/Functional/ImageOnTranslatedEntityTest.php b/core/modules/image/tests/src/Functional/ImageOnTranslatedEntityTest.php index c0f01f2719..45270f76c5 100644 --- a/core/modules/image/tests/src/Functional/ImageOnTranslatedEntityTest.php +++ b/core/modules/image/tests/src/Functional/ImageOnTranslatedEntityTest.php @@ -46,7 +46,11 @@ protected function setUp() { // Create the "Basic page" node type. // @todo Remove the disabling of new revision creation in // https://www.drupal.org/node/1239558. - $this->drupalCreateContentType(['type' => 'basicpage', 'name' => 'Basic page', 'new_revision' => FALSE]); + $this->drupalCreateContentType([ + 'type' => 'basicpage', + 'name' => 'Basic page', + 'new_revision' => FALSE, + ]); // Create a image field on the "Basic page" node type. $this->fieldName = strtolower($this->randomMachineName()); diff --git a/core/modules/image/tests/src/Kernel/Views/ImageViewsDataTest.php b/core/modules/image/tests/src/Kernel/Views/ImageViewsDataTest.php index b7fe074a6b..e004432521 100644 --- a/core/modules/image/tests/src/Kernel/Views/ImageViewsDataTest.php +++ b/core/modules/image/tests/src/Kernel/Views/ImageViewsDataTest.php @@ -19,7 +19,14 @@ class ImageViewsDataTest extends ViewsKernelTestBase { * * @var array */ - public static $modules = ['image', 'file', 'views', 'entity_test', 'user', 'field']; + public static $modules = [ + 'image', + 'file', + 'views', + 'entity_test', + 'user', + 'field', + ]; /** * {@inheritdoc} @@ -65,7 +72,11 @@ public function testRelationshipViewsData() { $this->assertEqual($relationship['field field'], 'field_base_image_target_id'); $this->assertEqual($relationship['field_name'], 'field_base_image'); $this->assertEqual($relationship['entity_type'], 'entity_test'); - $this->assertEqual($relationship['join_extra'][0], ['field' => 'deleted', 'value' => 0, 'numeric' => TRUE]); + $this->assertEqual($relationship['join_extra'][0], [ + 'field' => 'deleted', + 'value' => 0, + 'numeric' => TRUE, + ]); // Create image field to entity_test_mul. FieldStorageConfig::create([ diff --git a/core/modules/jsonapi/tests/src/Kernel/ResourceType/ResourceTypeRepositoryTest.php b/core/modules/jsonapi/tests/src/Kernel/ResourceType/ResourceTypeRepositoryTest.php index c58f03f18c..9aee597fa9 100644 --- a/core/modules/jsonapi/tests/src/Kernel/ResourceType/ResourceTypeRepositoryTest.php +++ b/core/modules/jsonapi/tests/src/Kernel/ResourceType/ResourceTypeRepositoryTest.php @@ -129,7 +129,11 @@ public function testMappingNameConflictCheck($field_name_list) { $this->expectException(\LogicException::class); $this->expectExceptionMessage("The generated alias '{$field_name_list[1]}' for field name '{$field_name_list[0]}' conflicts with an existing field. Please report this in the JSON:API issue queue!"); - $reflection_method->invokeArgs($this->resourceTypeRepository, [$field_name_list, $entity_type, $bundle]); + $reflection_method->invokeArgs($this->resourceTypeRepository, [ + $field_name_list, + $entity_type, + $bundle, + ]); } /** diff --git a/core/modules/language/tests/src/Functional/LanguageBlockSettingsVisibilityTest.php b/core/modules/language/tests/src/Functional/LanguageBlockSettingsVisibilityTest.php index 1511bf1f14..afdfaa3653 100644 --- a/core/modules/language/tests/src/Functional/LanguageBlockSettingsVisibilityTest.php +++ b/core/modules/language/tests/src/Functional/LanguageBlockSettingsVisibilityTest.php @@ -19,7 +19,11 @@ class LanguageBlockSettingsVisibilityTest extends BrowserTestBase { protected $defaultTheme = 'stark'; public function testUnnecessaryLanguageSettingsVisibility() { - $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages', 'administer blocks']); + $admin_user = $this->drupalCreateUser([ + 'administer languages', + 'access administration pages', + 'administer blocks', + ]); $this->drupalLogin($admin_user); $this->drupalPostForm('admin/config/regional/language/add', ['predefined_langcode' => 'hu'], t('Add language')); $this->drupalGet('admin/structure/block/add/system_menu_block:admin/stark'); diff --git a/core/modules/language/tests/src/Functional/LanguageBrowserDetectionAcceptLanguageTest.php b/core/modules/language/tests/src/Functional/LanguageBrowserDetectionAcceptLanguageTest.php index b2ac07895f..fae8acafa5 100644 --- a/core/modules/language/tests/src/Functional/LanguageBrowserDetectionAcceptLanguageTest.php +++ b/core/modules/language/tests/src/Functional/LanguageBrowserDetectionAcceptLanguageTest.php @@ -17,7 +17,12 @@ class LanguageBrowserDetectionAcceptLanguageTest extends BrowserTestBase { * * @var array */ - public static $modules = ['language', 'locale', 'content_translation', 'system_test']; + public static $modules = [ + 'language', + 'locale', + 'content_translation', + 'system_test', + ]; /** * {@inheritdoc} diff --git a/core/modules/language/tests/src/Functional/LanguageConfigOverrideImportTest.php b/core/modules/language/tests/src/Functional/LanguageConfigOverrideImportTest.php index 03f3df28b5..e18168760a 100644 --- a/core/modules/language/tests/src/Functional/LanguageConfigOverrideImportTest.php +++ b/core/modules/language/tests/src/Functional/LanguageConfigOverrideImportTest.php @@ -17,7 +17,12 @@ class LanguageConfigOverrideImportTest extends BrowserTestBase { * * @var array */ - public static $modules = ['language', 'config', 'locale', 'config_translation']; + public static $modules = [ + 'language', + 'config', + 'locale', + 'config_translation', + ]; /** * {@inheritdoc} diff --git a/core/modules/language/tests/src/Functional/LanguageConfigurationElementTest.php b/core/modules/language/tests/src/Functional/LanguageConfigurationElementTest.php index 386f6d93e0..e9f520dbf0 100644 --- a/core/modules/language/tests/src/Functional/LanguageConfigurationElementTest.php +++ b/core/modules/language/tests/src/Functional/LanguageConfigurationElementTest.php @@ -20,7 +20,13 @@ class LanguageConfigurationElementTest extends BrowserTestBase { * * @var array */ - public static $modules = ['taxonomy', 'node', 'language', 'language_elements_test', 'field_ui']; + public static $modules = [ + 'taxonomy', + 'node', + 'language', + 'language_elements_test', + 'field_ui', + ]; /** * {@inheritdoc} @@ -29,7 +35,11 @@ class LanguageConfigurationElementTest extends BrowserTestBase { protected function setUp() { parent::setUp(); - $user = $this->drupalCreateUser(['access administration pages', 'administer languages', 'administer content types']); + $user = $this->drupalCreateUser([ + 'access administration pages', + 'administer languages', + 'administer content types', + ]); $this->drupalLogin($user); } diff --git a/core/modules/language/tests/src/Functional/LanguageListTest.php b/core/modules/language/tests/src/Functional/LanguageListTest.php index 45ec251ba2..aaa5e0e383 100644 --- a/core/modules/language/tests/src/Functional/LanguageListTest.php +++ b/core/modules/language/tests/src/Functional/LanguageListTest.php @@ -33,7 +33,10 @@ class LanguageListTest extends BrowserTestBase { public function testLanguageList() { // User to add and remove language. - $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages']); + $admin_user = $this->drupalCreateUser([ + 'administer languages', + 'access administration pages', + ]); $this->drupalLogin($admin_user); // Get the weight of the last language. @@ -205,12 +208,39 @@ public function testLanguageList() { */ public function testLanguageStates() { // Add some languages, and also lock some of them. - ConfigurableLanguage::create(['label' => $this->randomMachineName(), 'id' => 'l1'])->save(); - ConfigurableLanguage::create(['label' => $this->randomMachineName(), 'id' => 'l2', 'locked' => TRUE])->save(); - ConfigurableLanguage::create(['label' => $this->randomMachineName(), 'id' => 'l3'])->save(); - ConfigurableLanguage::create(['label' => $this->randomMachineName(), 'id' => 'l4', 'locked' => TRUE])->save(); - $expected_locked_languages = ['l4' => 'l4', 'l2' => 'l2', 'und' => 'und', 'zxx' => 'zxx']; - $expected_all_languages = ['l4' => 'l4', 'l3' => 'l3', 'l2' => 'l2', 'l1' => 'l1', 'en' => 'en', 'und' => 'und', 'zxx' => 'zxx']; + ConfigurableLanguage::create([ + 'label' => $this->randomMachineName(), + 'id' => 'l1', + ])->save(); + ConfigurableLanguage::create([ + 'label' => $this->randomMachineName(), + 'id' => 'l2', + 'locked' => TRUE, + ])->save(); + ConfigurableLanguage::create([ + 'label' => $this->randomMachineName(), + 'id' => 'l3', + ])->save(); + ConfigurableLanguage::create([ + 'label' => $this->randomMachineName(), + 'id' => 'l4', + 'locked' => TRUE, + ])->save(); + $expected_locked_languages = [ + 'l4' => 'l4', + 'l2' => 'l2', + 'und' => 'und', + 'zxx' => 'zxx', + ]; + $expected_all_languages = [ + 'l4' => 'l4', + 'l3' => 'l3', + 'l2' => 'l2', + 'l1' => 'l1', + 'en' => 'en', + 'und' => 'und', + 'zxx' => 'zxx', + ]; $expected_conf_languages = ['l3' => 'l3', 'l1' => 'l1', 'en' => 'en']; $locked_languages = $this->container->get('language_manager')->getLanguages(LanguageInterface::STATE_LOCKED); diff --git a/core/modules/language/tests/src/Functional/LanguageNegotiationContentEntityTest.php b/core/modules/language/tests/src/Functional/LanguageNegotiationContentEntityTest.php index 66ea59ac1e..45d142576e 100644 --- a/core/modules/language/tests/src/Functional/LanguageNegotiationContentEntityTest.php +++ b/core/modules/language/tests/src/Functional/LanguageNegotiationContentEntityTest.php @@ -25,7 +25,12 @@ class LanguageNegotiationContentEntityTest extends BrowserTestBase { * * @var array */ - public static $modules = ['language', 'language_test', 'entity_test', 'system']; + public static $modules = [ + 'language', + 'language_test', + 'entity_test', + 'system', + ]; /** * {@inheritdoc} diff --git a/core/modules/language/tests/src/Functional/LanguageNegotiationInfoTest.php b/core/modules/language/tests/src/Functional/LanguageNegotiationInfoTest.php index bab82fd8fd..f39593836e 100644 --- a/core/modules/language/tests/src/Functional/LanguageNegotiationInfoTest.php +++ b/core/modules/language/tests/src/Functional/LanguageNegotiationInfoTest.php @@ -31,7 +31,12 @@ class LanguageNegotiationInfoTest extends BrowserTestBase { */ protected function setUp() { parent::setUp(); - $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages', 'view the administration theme', 'administer modules']); + $admin_user = $this->drupalCreateUser([ + 'administer languages', + 'access administration pages', + 'view the administration theme', + 'administer modules', + ]); $this->drupalLogin($admin_user); $this->drupalPostForm('admin/config/regional/language/add', ['predefined_langcode' => 'it'], t('Add language')); } diff --git a/core/modules/language/tests/src/Functional/LanguagePathMonolingualTest.php b/core/modules/language/tests/src/Functional/LanguagePathMonolingualTest.php index 5c4bcfa016..e68ab8e048 100644 --- a/core/modules/language/tests/src/Functional/LanguagePathMonolingualTest.php +++ b/core/modules/language/tests/src/Functional/LanguagePathMonolingualTest.php @@ -27,7 +27,11 @@ protected function setUp() { parent::setUp(); // Create and log in user. - $web_user = $this->drupalCreateUser(['administer languages', 'access administration pages', 'administer site configuration']); + $web_user = $this->drupalCreateUser([ + 'administer languages', + 'access administration pages', + 'administer site configuration', + ]); $this->drupalLogin($web_user); // Enable French language. diff --git a/core/modules/language/tests/src/Functional/LanguageSwitchingTest.php b/core/modules/language/tests/src/Functional/LanguageSwitchingTest.php index 6e0fa3b2f0..c636f250ec 100644 --- a/core/modules/language/tests/src/Functional/LanguageSwitchingTest.php +++ b/core/modules/language/tests/src/Functional/LanguageSwitchingTest.php @@ -20,7 +20,14 @@ class LanguageSwitchingTest extends BrowserTestBase { * * @var array */ - public static $modules = ['locale', 'locale_test', 'language', 'block', 'language_test', 'menu_ui']; + public static $modules = [ + 'locale', + 'locale_test', + 'language', + 'block', + 'language_test', + 'menu_ui', + ]; /** * {@inheritdoc} @@ -31,7 +38,11 @@ protected function setUp() { parent::setUp(); // Create and log in user. - $admin_user = $this->drupalCreateUser(['administer blocks', 'administer languages', 'access administration pages']); + $admin_user = $this->drupalCreateUser([ + 'administer blocks', + 'administer languages', + 'access administration pages', + ]); $this->drupalLogin($admin_user); } diff --git a/core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php b/core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php index 239a561427..97dc06a54f 100644 --- a/core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php +++ b/core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php @@ -58,7 +58,13 @@ class LanguageUILanguageNegotiationTest extends BrowserTestBase { * * @var array */ - public static $modules = ['locale', 'language_test', 'block', 'user', 'content_translation']; + public static $modules = [ + 'locale', + 'language_test', + 'block', + 'user', + 'content_translation', + ]; /** * {@inheritdoc} @@ -68,7 +74,12 @@ class LanguageUILanguageNegotiationTest extends BrowserTestBase { protected function setUp() { parent::setUp(); - $this->adminUser = $this->drupalCreateUser(['administer languages', 'translate interface', 'access administration pages', 'administer blocks']); + $this->adminUser = $this->drupalCreateUser([ + 'administer languages', + 'translate interface', + 'access administration pages', + 'administer blocks', + ]); $this->drupalLogin($this->adminUser); } diff --git a/core/modules/language/tests/src/Kernel/EntityDefaultLanguageTest.php b/core/modules/language/tests/src/Kernel/EntityDefaultLanguageTest.php index 06047dfaf0..5c27002308 100644 --- a/core/modules/language/tests/src/Kernel/EntityDefaultLanguageTest.php +++ b/core/modules/language/tests/src/Kernel/EntityDefaultLanguageTest.php @@ -18,7 +18,14 @@ class EntityDefaultLanguageTest extends KernelTestBase { * * @var array */ - public static $modules = ['language', 'node', 'field', 'text', 'user', 'system']; + public static $modules = [ + 'language', + 'node', + 'field', + 'text', + 'user', + 'system', + ]; /** * {@inheritdoc} diff --git a/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentSettingsTest.php b/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentSettingsTest.php index 57439d588d..3e8b7ac59b 100644 --- a/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentSettingsTest.php +++ b/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentSettingsTest.php @@ -16,7 +16,13 @@ class MigrateLanguageContentSettingsTest extends MigrateDrupal6TestBase { /** * {@inheritdoc} */ - public static $modules = ['node', 'text', 'language', 'content_translation', 'menu_ui']; + public static $modules = [ + 'node', + 'text', + 'language', + 'content_translation', + 'menu_ui', + ]; /** * {@inheritdoc} diff --git a/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentSettingsTest.php b/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentSettingsTest.php index 1e05e9193d..9978b7b724 100644 --- a/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentSettingsTest.php +++ b/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentSettingsTest.php @@ -16,7 +16,13 @@ class MigrateLanguageContentSettingsTest extends MigrateDrupal7TestBase { /** * {@inheritdoc} */ - public static $modules = ['node', 'text', 'language', 'content_translation', 'menu_ui']; + public static $modules = [ + 'node', + 'text', + 'language', + 'content_translation', + 'menu_ui', + ]; /** * {@inheritdoc} diff --git a/core/modules/link/tests/src/Functional/LinkFieldUITest.php b/core/modules/link/tests/src/Functional/LinkFieldUITest.php index 65e4125dc3..dd2318e428 100644 --- a/core/modules/link/tests/src/Functional/LinkFieldUITest.php +++ b/core/modules/link/tests/src/Functional/LinkFieldUITest.php @@ -68,8 +68,14 @@ protected function setUp() { $this->firstContentType = $this->drupalCreateContentType(); $this->secondContentType = $this->drupalCreateContentType(); - $this->adminUser = $this->drupalCreateUser(['administer content types', 'administer node fields', 'administer node display']); - $this->helpTextUser = $this->drupalCreateUser(['create ' . $this->secondContentType->id() . ' content']); + $this->adminUser = $this->drupalCreateUser([ + 'administer content types', + 'administer node fields', + 'administer node display', + ]); + $this->helpTextUser = $this->drupalCreateUser([ + 'create ' . $this->secondContentType->id() . ' content', + ]); $this->drupalPlaceBlock('system_breadcrumb_block'); } diff --git a/core/modules/link/tests/src/Functional/Views/LinkViewsTokensTest.php b/core/modules/link/tests/src/Functional/Views/LinkViewsTokensTest.php index 4b9f0e932a..b4f4e95956 100644 --- a/core/modules/link/tests/src/Functional/Views/LinkViewsTokensTest.php +++ b/core/modules/link/tests/src/Functional/Views/LinkViewsTokensTest.php @@ -78,7 +78,15 @@ public function testLinkViewsTokens() { // Add nodes with the URI's and titles. foreach ($uris as $uri => $title) { $values = ['type' => 'page']; - $values[$this->fieldName][] = ['uri' => $uri, 'title' => $title, 'options' => ['attributes' => ['class' => 'test-link-class']]]; + $values[$this->fieldName][] = [ + 'uri' => $uri, + 'title' => $title, + 'options' => [ + 'attributes' => [ + 'class' => 'test-link-class', + ], + ], + ]; $this->drupalCreateNode($values); } diff --git a/core/modules/locale/locale.bulk.inc b/core/modules/locale/locale.bulk.inc index a344a1b0e7..d65e424d24 100644 --- a/core/modules/locale/locale.bulk.inc +++ b/core/modules/locale/locale.bulk.inc @@ -585,7 +585,10 @@ function locale_config_batch_build(array $names, array $langcodes, array $option } } if (!empty($batch_names)) { - $operations[] = ['locale_config_batch_refresh_name', [$batch_names, $langcodes]]; + $operations[] = [ + 'locale_config_batch_refresh_name', + [$batch_names, $langcodes], + ]; } $batch = [ 'operations' => $operations, diff --git a/core/modules/locale/locale.compare.inc b/core/modules/locale/locale.compare.inc index 317b45adb5..e7583af201 100644 --- a/core/modules/locale/locale.compare.inc +++ b/core/modules/locale/locale.compare.inc @@ -269,7 +269,10 @@ function _locale_translation_batch_status_operations($projects, $langcodes, $opt foreach ($projects as $project) { foreach ($langcodes as $langcode) { // Check status of local and remote translation sources. - $operations[] = ['locale_translation_batch_status_check', [$project, $langcode, $options]]; + $operations[] = [ + 'locale_translation_batch_status_check', + [$project, $langcode, $options], + ]; } } diff --git a/core/modules/locale/locale.fetch.inc b/core/modules/locale/locale.fetch.inc index 1de6934473..24b03ca166 100644 --- a/core/modules/locale/locale.fetch.inc +++ b/core/modules/locale/locale.fetch.inc @@ -98,9 +98,15 @@ function _locale_translation_fetch_operations($projects, $langcodes, $options) { foreach ($projects as $project) { foreach ($langcodes as $langcode) { if (locale_translation_use_remote_source()) { - $operations[] = ['locale_translation_batch_fetch_download', [$project, $langcode]]; + $operations[] = [ + 'locale_translation_batch_fetch_download', + [$project, $langcode], + ]; } - $operations[] = ['locale_translation_batch_fetch_import', [$project, $langcode, $options]]; + $operations[] = [ + 'locale_translation_batch_fetch_import', + [$project, $langcode, $options], + ]; } } diff --git a/core/modules/locale/src/EventSubscriber/LocaleTranslationCacheTag.php b/core/modules/locale/src/EventSubscriber/LocaleTranslationCacheTag.php index 4968097906..ac6b9df515 100644 --- a/core/modules/locale/src/EventSubscriber/LocaleTranslationCacheTag.php +++ b/core/modules/locale/src/EventSubscriber/LocaleTranslationCacheTag.php @@ -32,7 +32,11 @@ public function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidato * Invalidate cache tags whenever a string is translated. */ public function saveTranslation() { - $this->cacheTagsInvalidator->invalidateTags(['rendered', 'locale', 'library_info']); + $this->cacheTagsInvalidator->invalidateTags([ + 'rendered', + 'locale', + 'library_info', + ]); } /** diff --git a/core/modules/locale/src/Form/TranslateFormBase.php b/core/modules/locale/src/Form/TranslateFormBase.php index 9a7ad8bab8..5f58b5fc97 100644 --- a/core/modules/locale/src/Form/TranslateFormBase.php +++ b/core/modules/locale/src/Form/TranslateFormBase.php @@ -82,7 +82,11 @@ protected function translateFilterLoadStrings() { // Language is sanitized to be one of the possible options in // translateFilterValues(). $conditions = ['language' => $filter_values['langcode']]; - $options = ['pager limit' => 30, 'translated' => TRUE, 'untranslated' => TRUE]; + $options = [ + 'pager limit' => 30, + 'translated' => TRUE, + 'untranslated' => TRUE, + ]; // Add translation status conditions and options. switch ($filter_values['translation']) { diff --git a/core/modules/locale/src/LocaleLookup.php b/core/modules/locale/src/LocaleLookup.php index a534d193a3..ea8f57da93 100644 --- a/core/modules/locale/src/LocaleLookup.php +++ b/core/modules/locale/src/LocaleLookup.php @@ -156,7 +156,11 @@ protected function resolveCacheMiss($offset) { // If there is no translation available for the current language then use // language fallback to try other translations. if ($value === TRUE) { - $fallbacks = $this->languageManager->getFallbackCandidates(['langcode' => $this->langcode, 'operation' => 'locale_lookup', 'data' => $offset]); + $fallbacks = $this->languageManager->getFallbackCandidates([ + 'langcode' => $this->langcode, + 'operation' => 'locale_lookup', + 'data' => $offset, + ]); if (!empty($fallbacks)) { foreach ($fallbacks as $langcode) { $translation = $this->stringStorage->findTranslation([ diff --git a/core/modules/locale/src/StringDatabaseStorage.php b/core/modules/locale/src/StringDatabaseStorage.php index 3b052ed0d2..0d244ae22f 100644 --- a/core/modules/locale/src/StringDatabaseStorage.php +++ b/core/modules/locale/src/StringDatabaseStorage.php @@ -143,8 +143,11 @@ protected function updateLocation($string) { // Make sure that the name isn't longer than 255 characters. $name = substr($name, 0, 255); if (!$lid) { - $this->dbDelete('locales_location', ['sid' => $string->getId(), 'type' => $type, 'name' => $name]) - ->execute(); + $this->dbDelete('locales_location', [ + 'sid' => $string->getId(), + 'type' => $type, + 'name' => $name, + ])->execute(); } elseif ($lid === TRUE) { // This is a new location to add, take care not to duplicate. @@ -469,7 +472,12 @@ protected function dbStringInsert($string) { } elseif ($string->isTranslation()) { $string->setValues(['customized' => 0], FALSE); - $fields = $string->getValues(['lid', 'language', 'translation', 'customized']); + $fields = $string->getValues([ + 'lid', + 'language', + 'translation', + 'customized', + ]); } if (!empty($fields)) { return $this->connection->insert($this->dbStringTable($string), $this->options) diff --git a/core/modules/locale/tests/src/Functional/LocaleConfigTranslationImportTest.php b/core/modules/locale/tests/src/Functional/LocaleConfigTranslationImportTest.php index 64dcb705d8..d4f7ae6b42 100644 --- a/core/modules/locale/tests/src/Functional/LocaleConfigTranslationImportTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleConfigTranslationImportTest.php @@ -36,7 +36,13 @@ protected function setUp() { * Test update changes configuration translations if enabled after language. */ public function testConfigTranslationImport() { - $admin_user = $this->drupalCreateUser(['administer modules', 'administer site configuration', 'administer languages', 'access administration pages', 'administer permissions']); + $admin_user = $this->drupalCreateUser([ + 'administer modules', + 'administer site configuration', + 'administer languages', + 'access administration pages', + 'administer permissions', + ]); $this->drupalLogin($admin_user); // Add a language. The Afrikaans translation file of locale_test_translate @@ -90,7 +96,14 @@ public function testConfigTranslationModuleInstall() { // import. Test that this override is in place. $this->assertFalse($this->config('locale.settings')->get('translation.import_enabled'), 'Translations imports are disabled by default in the Testing profile.'); - $admin_user = $this->drupalCreateUser(['administer modules', 'administer site configuration', 'administer languages', 'access administration pages', 'administer permissions', 'translate configuration']); + $admin_user = $this->drupalCreateUser([ + 'administer modules', + 'administer site configuration', + 'administer languages', + 'access administration pages', + 'administer permissions', + 'translate configuration', + ]); $this->drupalLogin($admin_user); // Enable import of translations. By default this is disabled for automated @@ -149,7 +162,14 @@ public function testLocaleRemovalAndConfigOverrideDelete() { $this->container->get('module_installer')->install(['locale']); $this->resetAll(); - $admin_user = $this->drupalCreateUser(['administer modules', 'administer site configuration', 'administer languages', 'access administration pages', 'administer permissions', 'translate interface']); + $admin_user = $this->drupalCreateUser([ + 'administer modules', + 'administer site configuration', + 'administer languages', + 'access administration pages', + 'administer permissions', + 'translate interface', + ]); $this->drupalLogin($admin_user); // Enable import of translations. By default this is disabled for automated diff --git a/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php b/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php index eeb22ef3d9..970e59e14f 100644 --- a/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php @@ -48,7 +48,15 @@ protected function setUp() { // Add custom language. $this->langcode = 'xx'; - $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages', 'translate interface', 'administer modules', 'access site-wide contact form', 'administer contact forms', 'administer site configuration']); + $admin_user = $this->drupalCreateUser([ + 'administer languages', + 'access administration pages', + 'translate interface', + 'administer modules', + 'access site-wide contact form', + 'administer contact forms', + 'administer site configuration', + ]); $this->drupalLogin($admin_user); $name = $this->randomMachineName(16); $edit = [ @@ -69,7 +77,11 @@ protected function setUp() { public function testConfigTranslation() { // Check that the maintenance message exists and create translation for it. $source = '@site is currently under maintenance. We should be back shortly. Thank you for your patience.'; - $string = $this->storage->findString(['source' => $source, 'context' => '', 'type' => 'configuration']); + $string = $this->storage->findString([ + 'source' => $source, + 'context' => '', + 'type' => 'configuration', + ]); $this->assertNotEmpty($string, 'Configuration strings have been created upon installation.'); // Translate using the UI so configuration is refreshed. diff --git a/core/modules/locale/tests/src/Functional/LocaleContentTest.php b/core/modules/locale/tests/src/Functional/LocaleContentTest.php index 9ac40754f8..04c09ff81d 100644 --- a/core/modules/locale/tests/src/Functional/LocaleContentTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleContentTest.php @@ -31,7 +31,12 @@ class LocaleContentTest extends BrowserTestBase { */ public function testMachineNameLTR() { // User to add and remove language. - $admin_user = $this->drupalCreateUser(['administer languages', 'administer content types', 'access administration pages', 'administer site configuration']); + $admin_user = $this->drupalCreateUser([ + 'administer languages', + 'administer content types', + 'access administration pages', + 'administer site configuration', + ]); // Log in as admin. $this->drupalLogin($admin_user); @@ -63,9 +68,17 @@ public function testContentTypeLanguageConfiguration() { $type2 = $this->drupalCreateContentType(); // User to add and remove language. - $admin_user = $this->drupalCreateUser(['administer languages', 'administer content types', 'access administration pages']); + $admin_user = $this->drupalCreateUser([ + 'administer languages', + 'administer content types', + 'access administration pages', + ]); // User to create a node. - $web_user = $this->drupalCreateUser(["create {$type1->id()} content", "create {$type2->id()} content", "edit any {$type2->id()} content"]); + $web_user = $this->drupalCreateUser([ + "create {$type1->id()} content", + "create {$type2->id()} content", + "edit any {$type2->id()} content", + ]); // Add custom language. $this->drupalLogin($admin_user); @@ -140,9 +153,16 @@ public function testContentTypeDirLang() { $type = $this->drupalCreateContentType(); // User to add and remove language. - $admin_user = $this->drupalCreateUser(['administer languages', 'administer content types', 'access administration pages']); + $admin_user = $this->drupalCreateUser([ + 'administer languages', + 'administer content types', + 'access administration pages', + ]); // User to create a node. - $web_user = $this->drupalCreateUser(["create {$type->id()} content", "edit own {$type->id()} content"]); + $web_user = $this->drupalCreateUser([ + "create {$type->id()} content", + "edit own {$type->id()} content", + ]); // Log in as admin. $this->drupalLogin($admin_user); diff --git a/core/modules/locale/tests/src/Functional/LocaleExportTest.php b/core/modules/locale/tests/src/Functional/LocaleExportTest.php index 9869fb70a2..5170a8317b 100644 --- a/core/modules/locale/tests/src/Functional/LocaleExportTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleExportTest.php @@ -35,7 +35,11 @@ class LocaleExportTest extends BrowserTestBase { protected function setUp() { parent::setUp(); - $this->adminUser = $this->drupalCreateUser(['administer languages', 'translate interface', 'access administration pages']); + $this->adminUser = $this->drupalCreateUser([ + 'administer languages', + 'translate interface', + 'access administration pages', + ]); $this->drupalLogin($this->adminUser); // Copy test po files to the translations directory. diff --git a/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php b/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php index 9342c6ed84..526db97c0a 100644 --- a/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php @@ -55,8 +55,17 @@ protected function setUp() { $file_system->copy(__DIR__ . '/../../../tests/test.de.po', 'translations://', FileSystemInterface::EXISTS_REPLACE); $file_system->copy(__DIR__ . '/../../../tests/test.xx.po', 'translations://', FileSystemInterface::EXISTS_REPLACE); - $this->adminUser = $this->drupalCreateUser(['administer languages', 'translate interface', 'access administration pages']); - $this->adminUserAccessSiteReports = $this->drupalCreateUser(['administer languages', 'translate interface', 'access administration pages', 'access site reports']); + $this->adminUser = $this->drupalCreateUser([ + 'administer languages', + 'translate interface', + 'access administration pages', + ]); + $this->adminUserAccessSiteReports = $this->drupalCreateUser([ + 'administer languages', + 'translate interface', + 'access administration pages', + 'access site reports', + ]); $this->drupalLogin($this->adminUser); // Enable import of translations. By default this is disabled for automated diff --git a/core/modules/locale/tests/src/Functional/LocaleJavascriptTranslationTest.php b/core/modules/locale/tests/src/Functional/LocaleJavascriptTranslationTest.php index 087052974c..7b735b7f32 100644 --- a/core/modules/locale/tests/src/Functional/LocaleJavascriptTranslationTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleJavascriptTranslationTest.php @@ -116,7 +116,11 @@ public function testFileParsing() { */ public function testLocaleTranslationJsDependencies() { // User to add and remove language. - $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages', 'translate interface']); + $admin_user = $this->drupalCreateUser([ + 'administer languages', + 'access administration pages', + 'translate interface', + ]); // Add custom language. $this->drupalLogin($admin_user); diff --git a/core/modules/locale/tests/src/Functional/LocalePathTest.php b/core/modules/locale/tests/src/Functional/LocalePathTest.php index 036b957470..6f9a66769d 100644 --- a/core/modules/locale/tests/src/Functional/LocalePathTest.php +++ b/core/modules/locale/tests/src/Functional/LocalePathTest.php @@ -44,7 +44,14 @@ protected function setUp() { */ public function testPathLanguageConfiguration() { // User to add and remove language. - $admin_user = $this->drupalCreateUser(['administer languages', 'create page content', 'administer url aliases', 'create url aliases', 'access administration pages', 'access content overview']); + $admin_user = $this->drupalCreateUser([ + 'administer languages', + 'create page content', + 'administer url aliases', + 'create url aliases', + 'access administration pages', + 'access content overview', + ]); // Add custom language. $this->drupalLogin($admin_user); diff --git a/core/modules/locale/tests/src/Functional/LocalePluralFormatTest.php b/core/modules/locale/tests/src/Functional/LocalePluralFormatTest.php index b85e737a06..552273cfa7 100644 --- a/core/modules/locale/tests/src/Functional/LocalePluralFormatTest.php +++ b/core/modules/locale/tests/src/Functional/LocalePluralFormatTest.php @@ -39,7 +39,11 @@ class LocalePluralFormatTest extends BrowserTestBase { protected function setUp() { parent::setUp(); - $this->adminUser = $this->drupalCreateUser(['administer languages', 'translate interface', 'access administration pages']); + $this->adminUser = $this->drupalCreateUser([ + 'administer languages', + 'translate interface', + 'access administration pages', + ]); $this->drupalLogin($this->adminUser); } diff --git a/core/modules/locale/tests/src/Functional/LocaleTranslateStringTourTest.php b/core/modules/locale/tests/src/Functional/LocaleTranslateStringTourTest.php index 19db1b38ed..f2307cf919 100644 --- a/core/modules/locale/tests/src/Functional/LocaleTranslateStringTourTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleTranslateStringTourTest.php @@ -35,7 +35,11 @@ class LocaleTranslateStringTourTest extends TourTestBase { */ protected function setUp() { parent::setUp(); - $this->adminUser = $this->drupalCreateUser(['translate interface', 'access tour', 'administer languages']); + $this->adminUser = $this->drupalCreateUser([ + 'translate interface', + 'access tour', + 'administer languages', + ]); $this->drupalLogin($this->adminUser); } diff --git a/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php b/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php index f8fe9c6db1..aec7237f59 100644 --- a/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php @@ -33,7 +33,10 @@ class LocaleTranslationUiTest extends BrowserTestBase { * Enable interface translation to English. */ public function testEnglishTranslation() { - $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages']); + $admin_user = $this->drupalCreateUser([ + 'administer languages', + 'access administration pages', + ]); $this->drupalLogin($admin_user); $this->drupalPostForm('admin/config/regional/language/edit/en', ['locale_translate_english' => TRUE], t('Save language')); @@ -45,9 +48,15 @@ public function testEnglishTranslation() { */ public function testStringTranslation() { // User to add and remove language. - $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages']); + $admin_user = $this->drupalCreateUser([ + 'administer languages', + 'access administration pages', + ]); // User to translate and delete string. - $translate_user = $this->drupalCreateUser(['translate interface', 'access administration pages']); + $translate_user = $this->drupalCreateUser([ + 'translate interface', + 'access administration pages', + ]); // Code for the language. $langcode = 'xx'; // The English name for the language. This will be translated. @@ -217,7 +226,11 @@ public function testStringTranslation() { * properly created and rebuilt on deletion. */ public function testJavaScriptTranslation() { - $user = $this->drupalCreateUser(['translate interface', 'administer languages', 'access administration pages']); + $user = $this->drupalCreateUser([ + 'translate interface', + 'administer languages', + 'access administration pages', + ]); $this->drupalLogin($user); $config = $this->config('locale.settings'); @@ -475,7 +488,11 @@ public function testStringSearch() { * Tests that only changed strings are saved customized when edited. */ public function testUICustomizedStrings() { - $user = $this->drupalCreateUser(['translate interface', 'administer languages', 'access administration pages']); + $user = $this->drupalCreateUser([ + 'translate interface', + 'administer languages', + 'access administration pages', + ]); $this->drupalLogin($user); ConfigurableLanguage::createFromLangcode('de')->save(); diff --git a/core/modules/locale/tests/src/Functional/LocaleUpdateBase.php b/core/modules/locale/tests/src/Functional/LocaleUpdateBase.php index 2e2d82b633..19068187fe 100644 --- a/core/modules/locale/tests/src/Functional/LocaleUpdateBase.php +++ b/core/modules/locale/tests/src/Functional/LocaleUpdateBase.php @@ -187,9 +187,21 @@ protected function setTranslationFiles() { $config->set('translation.default_filename', '%project-%version.%language._po')->save(); // Setting up sets of translations for the translation files. - $translations_one = ['January' => 'Januar_1', 'February' => 'Februar_1', 'March' => 'Marz_1']; - $translations_two = ['February' => 'Februar_2', 'March' => 'Marz_2', 'April' => 'April_2']; - $translations_three = ['April' => 'April_3', 'May' => 'Mai_3', 'June' => 'Juni_3']; + $translations_one = [ + 'January' => 'Januar_1', + 'February' => 'Februar_1', + 'March' => 'Marz_1', + ]; + $translations_two = [ + 'February' => 'Februar_2', + 'March' => 'Marz_2', + 'April' => 'April_2', + ]; + $translations_three = [ + 'April' => 'April_3', + 'May' => 'Mai_3', + 'June' => 'Juni_3', + ]; // Add a number of files to the local file system to serve as remote // translation server and match the project definitions set in diff --git a/core/modules/locale/tests/src/Functional/LocaleUpdateCronTest.php b/core/modules/locale/tests/src/Functional/LocaleUpdateCronTest.php index 34ee9dc36a..d7ebf3254d 100644 --- a/core/modules/locale/tests/src/Functional/LocaleUpdateCronTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleUpdateCronTest.php @@ -26,7 +26,13 @@ class LocaleUpdateCronTest extends LocaleUpdateBase { */ protected function setUp() { parent::setUp(); - $admin_user = $this->drupalCreateUser(['administer modules', 'administer site configuration', 'administer languages', 'access administration pages', 'translate interface']); + $admin_user = $this->drupalCreateUser([ + 'administer modules', + 'administer site configuration', + 'administer languages', + 'access administration pages', + 'translate interface', + ]); $this->drupalLogin($admin_user); $this->addLanguage('de'); } diff --git a/core/modules/locale/tests/src/Functional/LocaleUpdateDevelopmentReleaseTest.php b/core/modules/locale/tests/src/Functional/LocaleUpdateDevelopmentReleaseTest.php index 5921198407..a04eafc19a 100644 --- a/core/modules/locale/tests/src/Functional/LocaleUpdateDevelopmentReleaseTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleUpdateDevelopmentReleaseTest.php @@ -21,7 +21,12 @@ class LocaleUpdateDevelopmentReleaseTest extends BrowserTestBase { protected function setUp() { parent::setUp(); module_load_include('compare.inc', 'locale'); - $admin_user = $this->drupalCreateUser(['administer modules', 'administer languages', 'access administration pages', 'translate interface']); + $admin_user = $this->drupalCreateUser([ + 'administer modules', + 'administer languages', + 'access administration pages', + 'translate interface', + ]); $this->drupalLogin($admin_user); $this->drupalPostForm('admin/config/regional/language/add', ['predefined_langcode' => 'hu'], t('Add language')); } diff --git a/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php b/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php index 516d5b6386..02049b6646 100644 --- a/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php @@ -29,7 +29,13 @@ class LocaleUpdateInterfaceTest extends LocaleUpdateBase { */ protected function setUp() { parent::setUp(); - $admin_user = $this->drupalCreateUser(['administer modules', 'administer site configuration', 'administer languages', 'access administration pages', 'translate interface']); + $admin_user = $this->drupalCreateUser([ + 'administer modules', + 'administer site configuration', + 'administer languages', + 'access administration pages', + 'translate interface', + ]); $this->drupalLogin($admin_user); } diff --git a/core/modules/locale/tests/src/Functional/LocaleUpdateTest.php b/core/modules/locale/tests/src/Functional/LocaleUpdateTest.php index d6818a8f14..d1b12c17f4 100644 --- a/core/modules/locale/tests/src/Functional/LocaleUpdateTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleUpdateTest.php @@ -24,7 +24,13 @@ protected function setUp() { parent::setUp(); module_load_include('compare.inc', 'locale'); module_load_include('fetch.inc', 'locale'); - $admin_user = $this->drupalCreateUser(['administer modules', 'administer site configuration', 'administer languages', 'access administration pages', 'translate interface']); + $admin_user = $this->drupalCreateUser([ + 'administer modules', + 'administer site configuration', + 'administer languages', + 'access administration pages', + 'translate interface', + ]); $this->drupalLogin($admin_user); // We use German as test language. This language must match the translation // file that come with the locale_test module (test.de.po) and can therefore diff --git a/core/modules/locale/tests/src/Kernel/LocaleConfigManagerTest.php b/core/modules/locale/tests/src/Kernel/LocaleConfigManagerTest.php index 8389b6e973..d1552edcea 100644 --- a/core/modules/locale/tests/src/Kernel/LocaleConfigManagerTest.php +++ b/core/modules/locale/tests/src/Kernel/LocaleConfigManagerTest.php @@ -18,7 +18,13 @@ class LocaleConfigManagerTest extends KernelTestBase { * * @var array */ - public static $modules = ['system', 'language', 'locale', 'locale_test', 'block']; + public static $modules = [ + 'system', + 'language', + 'locale', + 'locale_test', + 'block', + ]; /** * This test creates simple config on the fly breaking schema checking. diff --git a/core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php b/core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php index d77d91d6b1..7dab349e68 100644 --- a/core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php +++ b/core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php @@ -56,7 +56,11 @@ protected function setUp() { $this->setUpDefaultLanguage(); - $this->installSchema('locale', ['locales_source', 'locales_target', 'locales_location']); + $this->installSchema('locale', [ + 'locales_source', + 'locales_target', + 'locales_location', + ]); $this->setupLanguages(); diff --git a/core/modules/locale/tests/src/Kernel/LocaleConfigurableLanguageManagerTest.php b/core/modules/locale/tests/src/Kernel/LocaleConfigurableLanguageManagerTest.php index 07909bacc4..68fac38e73 100644 --- a/core/modules/locale/tests/src/Kernel/LocaleConfigurableLanguageManagerTest.php +++ b/core/modules/locale/tests/src/Kernel/LocaleConfigurableLanguageManagerTest.php @@ -32,7 +32,11 @@ public function testGetLanguages() { $languages = \Drupal::service('language_manager')->getLanguages(LanguageInterface::STATE_ALL); $this->assertEqual(['default', 'und', 'zxx'], array_keys($languages)); - $configurableLanguage = new ConfigurableLanguage(['label' => $this->randomMachineName(), 'id' => 'test', 'weight' => 1], 'configurable_language'); + $configurableLanguage = new ConfigurableLanguage([ + 'label' => $this->randomMachineName(), + 'id' => 'test', + 'weight' => 1, + ], 'configurable_language'); // Simulate a configuration sync by setting the flag otherwise the locked // language weights would be updated whilst saving. // @see \Drupal\language\Entity\ConfigurableLanguage::postSave() diff --git a/core/modules/locale/tests/src/Kernel/LocaleStringTest.php b/core/modules/locale/tests/src/Kernel/LocaleStringTest.php index 885b3c5260..cc89149939 100644 --- a/core/modules/locale/tests/src/Kernel/LocaleStringTest.php +++ b/core/modules/locale/tests/src/Kernel/LocaleStringTest.php @@ -72,19 +72,32 @@ public function testStringCrudApi() { $langcode = 'es'; $translation = $this->createTranslation($source, $langcode); $this->assertEquals(LOCALE_NOT_CUSTOMIZED, $translation->customized); - $string1 = $this->storage->findTranslation(['language' => $langcode, 'lid' => $source->lid]); + $string1 = $this->storage->findTranslation([ + 'language' => $langcode, + 'lid' => $source->lid, + ]); $this->assertEquals($translation->translation, $string1->translation); - $string2 = $this->storage->findTranslation(['language' => $langcode, 'source' => $source->source, 'context' => $source->context]); + $string2 = $this->storage->findTranslation([ + 'language' => $langcode, + 'source' => $source->source, + 'context' => $source->context, + ]); $this->assertEquals($translation->translation, $string2->translation); $translation ->setCustomized() ->save(); - $translation = $this->storage->findTranslation(['language' => $langcode, 'lid' => $source->lid]); + $translation = $this->storage->findTranslation([ + 'language' => $langcode, + 'lid' => $source->lid, + ]); $this->assertEquals(LOCALE_CUSTOMIZED, $translation->customized); // Delete translation. $translation->delete(); - $deleted = $this->storage->findTranslation(['language' => $langcode, 'lid' => $source->lid]); + $deleted = $this->storage->findTranslation([ + 'language' => $langcode, + 'lid' => $source->lid, + ]); $this->assertNull($deleted->translation); // Create some translations and then delete string and all of its @@ -128,8 +141,12 @@ public function testStringSearchApi() { // Source 2 will have all translations, customized. // Source 3 will have no translations. $prefix = $this->randomMachineName(100); - $source1 = $this->buildSourceString(['source' => $prefix . $this->randomMachineName(100)])->save(); - $source2 = $this->buildSourceString(['source' => $prefix . $this->randomMachineName(100)])->save(); + $source1 = $this->buildSourceString([ + 'source' => $prefix . $this->randomMachineName(100), + ])->save(); + $source2 = $this->buildSourceString([ + 'source' => $prefix . $this->randomMachineName(100), + ])->save(); $source3 = $this->buildSourceString()->save(); // Load all source strings. @@ -146,11 +163,19 @@ public function testStringSearchApi() { $this->createAllTranslations($source2, ['customized' => LOCALE_CUSTOMIZED]); // Try quick search function with different field combinations. $langcode = 'es'; - $found = $this->storage->findTranslation(['language' => $langcode, 'source' => $source1->source, 'context' => $source1->context]); + $found = $this->storage->findTranslation([ + 'language' => $langcode, + 'source' => $source1->source, + 'context' => $source1->context, + ]); $this->assertTrue($found && isset($found->language) && isset($found->translation) && !$found->isNew(), 'Translation not found searching by source and context.'); $this->assertEquals($translate1[$langcode]->translation, $found->translation); // Now try a translation not found. - $found = $this->storage->findTranslation(['language' => $langcode, 'source' => $source3->source, 'context' => $source3->context]); + $found = $this->storage->findTranslation([ + 'language' => $langcode, + 'source' => $source3->source, + 'context' => $source3->context, + ]); $this->assertTrue($found && $found->lid == $source3->lid && !isset($found->translation) && $found->isNew()); // Load all translations. For next queries we'll be loading only translated @@ -159,11 +184,18 @@ public function testStringSearchApi() { $this->assertCount(2 * $language_count, $translations); // Load all customized translations. - $translations = $this->storage->getTranslations(['customized' => LOCALE_CUSTOMIZED, 'translated' => TRUE]); + $translations = $this->storage->getTranslations([ + 'customized' => LOCALE_CUSTOMIZED, + 'translated' => TRUE, + ]); $this->assertCount($language_count, $translations); // Load all Spanish customized translations. - $translations = $this->storage->getTranslations(['language' => 'es', 'customized' => LOCALE_CUSTOMIZED, 'translated' => TRUE]); + $translations = $this->storage->getTranslations([ + 'language' => 'es', + 'customized' => LOCALE_CUSTOMIZED, + 'translated' => TRUE, + ]); $this->assertCount(1, $translations); // Load all source strings without translation (1). diff --git a/core/modules/locale/tests/src/Unit/LocaleLookupTest.php b/core/modules/locale/tests/src/Unit/LocaleLookupTest.php index 944137fd56..bb0ba5f502 100644 --- a/core/modules/locale/tests/src/Unit/LocaleLookupTest.php +++ b/core/modules/locale/tests/src/Unit/LocaleLookupTest.php @@ -115,7 +115,16 @@ public function testResolveCacheMissWithoutFallback() { ->will($this->returnValue($result)); $locale_lookup = $this->getMockBuilder('Drupal\locale\LocaleLookup') - ->setConstructorArgs(['en', 'irrelevant', $this->storage, $this->cache, $this->lock, $this->configFactory, $this->languageManager, $this->requestStack]) + ->setConstructorArgs([ + 'en', + 'irrelevant', + $this->storage, + $this->cache, + $this->lock, + $this->configFactory, + $this->languageManager, + $this->requestStack, + ]) ->setMethods(['persist']) ->getMock(); $locale_lookup->expects($this->never()) @@ -228,7 +237,16 @@ public function testResolveCacheMissWithPersist() { $this->configFactory = $this->getConfigFactoryStub(['locale.settings' => ['cache_strings' => TRUE]]); $locale_lookup = $this->getMockBuilder('Drupal\locale\LocaleLookup') - ->setConstructorArgs(['en', 'irrelevant', $this->storage, $this->cache, $this->lock, $this->configFactory, $this->languageManager, $this->requestStack]) + ->setConstructorArgs([ + 'en', + 'irrelevant', + $this->storage, + $this->cache, + $this->lock, + $this->configFactory, + $this->languageManager, + $this->requestStack, + ]) ->setMethods(['persist']) ->getMock(); $locale_lookup->expects($this->once()) @@ -258,7 +276,16 @@ public function testResolveCacheMissNoTranslation() { $this->requestStack->push($request); $locale_lookup = $this->getMockBuilder('Drupal\locale\LocaleLookup') - ->setConstructorArgs(['en', 'irrelevant', $this->storage, $this->cache, $this->lock, $this->configFactory, $this->languageManager, $this->requestStack]) + ->setConstructorArgs([ + 'en', + 'irrelevant', + $this->storage, + $this->cache, + $this->lock, + $this->configFactory, + $this->languageManager, + $this->requestStack, + ]) ->setMethods(['persist']) ->getMock(); $locale_lookup->expects($this->never()) diff --git a/core/modules/media/src/MediaForm.php b/core/modules/media/src/MediaForm.php index 45cff5fdca..eb693d96cb 100644 --- a/core/modules/media/src/MediaForm.php +++ b/core/modules/media/src/MediaForm.php @@ -59,9 +59,16 @@ public function form(array $form, FormStateInterface $form_state) { */ public function save(array $form, FormStateInterface $form_state) { $saved = parent::save($form, $form_state); - $context = ['@type' => $this->entity->bundle(), '%label' => $this->entity->label(), 'link' => $this->entity->toLink($this->t('View'))->toString()]; + $context = [ + '@type' => $this->entity->bundle(), + '%label' => $this->entity->label(), + 'link' => $this->entity->toLink($this->t('View'))->toString(), + ]; $logger = $this->logger('media'); - $t_args = ['@type' => $this->entity->bundle->entity->label(), '%label' => $this->entity->toLink($this->entity->label())->toString()]; + $t_args = [ + '@type' => $this->entity->bundle->entity->label(), + '%label' => $this->entity->toLink($this->entity->label())->toString(), + ]; if ($saved === SAVED_NEW) { $logger->notice('@type: added %label.', $context); diff --git a/core/modules/media_library/tests/src/FunctionalJavascript/EntityReferenceWidgetTest.php b/core/modules/media_library/tests/src/FunctionalJavascript/EntityReferenceWidgetTest.php index 4d8ee6060f..8be3aecbcf 100644 --- a/core/modules/media_library/tests/src/FunctionalJavascript/EntityReferenceWidgetTest.php +++ b/core/modules/media_library/tests/src/FunctionalJavascript/EntityReferenceWidgetTest.php @@ -128,7 +128,12 @@ public function testWidget() { foreach ($links as $link) { $link_titles[] = $link->getText(); } - $expected_link_titles = ['Show Type Three media (selected)', 'Show Type One media', 'Show Type Two media', 'Show Type Four media']; + $expected_link_titles = [ + 'Show Type Three media (selected)', + 'Show Type One media', + 'Show Type Two media', + 'Show Type Four media', + ]; $this->assertSame($link_titles, $expected_link_titles); $this->drupalGet('admin/structure/types/manage/basic_page/form-display'); $assert_session->buttonExists('field_twin_media_settings_edit')->press(); @@ -144,7 +149,12 @@ public function testWidget() { $link_titles = array_map(function ($link) { return $link->getText(); }, $links); - $this->assertSame($link_titles, ['Show Type One media (selected)', 'Show Type Three media', 'Show Type Four media', 'Show Type Two media']); + $this->assertSame($link_titles, [ + 'Show Type One media (selected)', + 'Show Type Three media', + 'Show Type Four media', + 'Show Type Two media', + ]); $assert_session->elementExists('css', '.ui-dialog-titlebar-close')->click(); // Assert the announcements for media type navigation in the media library. diff --git a/core/modules/media_library/tests/src/Kernel/MediaLibraryAddFormTest.php b/core/modules/media_library/tests/src/Kernel/MediaLibraryAddFormTest.php index 51b70c9780..c3549e6133 100644 --- a/core/modules/media_library/tests/src/Kernel/MediaLibraryAddFormTest.php +++ b/core/modules/media_library/tests/src/Kernel/MediaLibraryAddFormTest.php @@ -129,7 +129,11 @@ public function testFormStateValidation() { * Tests the validation of the selected type in the media library add form. */ public function testSelectedTypeValidation() { - $state = MediaLibraryState::create('test', ['image', 'remote_video', 'header_image'], 'header_image', -1); + $state = MediaLibraryState::create('test', [ + 'image', + 'remote_video', + 'header_image', + ], 'header_image', -1); $form_state = new FormState(); $form_state->set('media_library_state', $state); $this->expectException(\InvalidArgumentException::class); diff --git a/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php b/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php index badeb9cc00..5f4cfde5d0 100644 --- a/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php +++ b/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php @@ -15,7 +15,15 @@ class MenuLinkContentTranslationUITest extends ContentTranslationUITestBase { /** * {inheritdoc} */ - protected $defaultCacheContexts = ['languages:language_interface', 'session', 'theme', 'url.path', 'url.query_args', 'user.permissions', 'user.roles:authenticated']; + protected $defaultCacheContexts = [ + 'languages:language_interface', + 'session', + 'theme', + 'url.path', + 'url.query_args', + 'user.permissions', + 'user.roles:authenticated', + ]; /** * Modules to enable. diff --git a/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentCacheabilityBubblingTest.php b/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentCacheabilityBubblingTest.php index c783d852df..7c1910ef86 100644 --- a/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentCacheabilityBubblingTest.php +++ b/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentCacheabilityBubblingTest.php @@ -27,7 +27,14 @@ class MenuLinkContentCacheabilityBubblingTest extends KernelTestBase { /** * {@inheritdoc} */ - public static $modules = ['menu_link_content', 'system', 'link', 'outbound_processing_test', 'url_alter_test', 'user']; + public static $modules = [ + 'menu_link_content', + 'system', + 'link', + 'outbound_processing_test', + 'url_alter_test', + 'user', + ]; /** * {@inheritdoc} @@ -65,7 +72,11 @@ public function testOutboundPathAndRouteProcessing() { $default_menu_cacheability = (new BubbleableMetadata()) ->setCacheMaxAge(Cache::PERMANENT) ->setCacheTags(['config:system.menu.tools']) - ->setCacheContexts(['languages:' . LanguageInterface::TYPE_INTERFACE, 'theme', 'user.permissions']); + ->setCacheContexts([ + 'languages:' . LanguageInterface::TYPE_INTERFACE, + 'theme', + 'user.permissions', + ]); User::create(['uid' => 1, 'name' => $this->randomString()])->save(); User::create(['uid' => 2, 'name' => $this->randomString()])->save(); diff --git a/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentDeriverTest.php b/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentDeriverTest.php index a5202f3174..b2c3d62f7a 100644 --- a/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentDeriverTest.php +++ b/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentDeriverTest.php @@ -18,7 +18,13 @@ class MenuLinkContentDeriverTest extends KernelTestBase { /** * {@inheritdoc} */ - public static $modules = ['menu_link_content', 'link', 'system', 'menu_link_content_dynamic_route', 'user']; + public static $modules = [ + 'menu_link_content', + 'link', + 'system', + 'menu_link_content_dynamic_route', + 'user', + ]; /** * {@inheritdoc} diff --git a/core/modules/menu_link_content/tests/src/Kernel/MenuLinksTest.php b/core/modules/menu_link_content/tests/src/Kernel/MenuLinksTest.php index c5bf428eb7..a7bb83f328 100644 --- a/core/modules/menu_link_content/tests/src/Kernel/MenuLinksTest.php +++ b/core/modules/menu_link_content/tests/src/Kernel/MenuLinksTest.php @@ -21,7 +21,13 @@ class MenuLinksTest extends KernelTestBase { * * @var array */ - public static $modules = ['link', 'menu_link_content', 'router_test', 'system', 'user']; + public static $modules = [ + 'link', + 'menu_link_content', + 'router_test', + 'system', + 'user', + ]; /** * The menu link plugin manager. diff --git a/core/modules/menu_link_content/tests/src/Kernel/PathAliasMenuLinkContentTest.php b/core/modules/menu_link_content/tests/src/Kernel/PathAliasMenuLinkContentTest.php index 7980de9765..db6f2da11a 100644 --- a/core/modules/menu_link_content/tests/src/Kernel/PathAliasMenuLinkContentTest.php +++ b/core/modules/menu_link_content/tests/src/Kernel/PathAliasMenuLinkContentTest.php @@ -21,7 +21,14 @@ class PathAliasMenuLinkContentTest extends KernelTestBase { /** * {@inheritdoc} */ - public static $modules = ['menu_link_content', 'system', 'link', 'path_alias', 'test_page_test', 'user']; + public static $modules = [ + 'menu_link_content', + 'system', + 'link', + 'path_alias', + 'test_page_test', + 'user', + ]; /** * {@inheritdoc} diff --git a/core/modules/menu_ui/tests/src/Functional/MenuCacheTagsTest.php b/core/modules/menu_ui/tests/src/Functional/MenuCacheTagsTest.php index 4adf2a2e30..ccf671d12f 100644 --- a/core/modules/menu_ui/tests/src/Functional/MenuCacheTagsTest.php +++ b/core/modules/menu_ui/tests/src/Functional/MenuCacheTagsTest.php @@ -44,7 +44,11 @@ public function testMenuBlock() { $menu_link_manager = \Drupal::service('plugin.manager.menu.link'); // Move a link into the new menu. $menu_link = $menu_link_manager->updateDefinition('test_page_test.test_page', ['menu_name' => 'llama', 'parent' => '']); - $block = $this->drupalPlaceBlock('system_menu_block:llama', ['label' => 'Llama', 'provider' => 'system', 'region' => 'footer']); + $block = $this->drupalPlaceBlock('system_menu_block:llama', [ + 'label' => 'Llama', + 'provider' => 'system', + 'region' => 'footer', + ]); // Prime the page cache. $this->verifyPageCache($url, 'MISS'); @@ -113,7 +117,12 @@ public function testMenuBlock() { $this->verifyPageCache($url, 'MISS'); // Verify a cache hit. - $this->verifyPageCache($url, 'HIT', ['config:block_list', 'config:user.role.anonymous', 'http_response', 'rendered']); + $this->verifyPageCache($url, 'HIT', [ + 'config:block_list', + 'config:user.role.anonymous', + 'http_response', + 'rendered', + ]); } } diff --git a/core/modules/menu_ui/tests/src/Functional/MenuUiContentModerationTest.php b/core/modules/menu_ui/tests/src/Functional/MenuUiContentModerationTest.php index 6aadd29080..cbced8d4ac 100644 --- a/core/modules/menu_ui/tests/src/Functional/MenuUiContentModerationTest.php +++ b/core/modules/menu_ui/tests/src/Functional/MenuUiContentModerationTest.php @@ -19,7 +19,13 @@ class MenuUiContentModerationTest extends BrowserTestBase { * * @var array */ - public static $modules = ['block', 'content_moderation', 'node', 'menu_ui', 'test_page_test']; + public static $modules = [ + 'block', + 'content_moderation', + 'node', + 'menu_ui', + 'test_page_test', + ]; /** * {@inheritdoc} diff --git a/core/modules/menu_ui/tests/src/Functional/MenuUiNodeTest.php b/core/modules/menu_ui/tests/src/Functional/MenuUiNodeTest.php index c1392b0136..ea90a6306f 100644 --- a/core/modules/menu_ui/tests/src/Functional/MenuUiNodeTest.php +++ b/core/modules/menu_ui/tests/src/Functional/MenuUiNodeTest.php @@ -26,7 +26,15 @@ class MenuUiNodeTest extends BrowserTestBase { * * @var array */ - public static $modules = ['menu_ui', 'test_page_test', 'node', 'block', 'locale', 'language', 'content_translation']; + public static $modules = [ + 'menu_ui', + 'test_page_test', + 'node', + 'block', + 'locale', + 'language', + 'content_translation', + ]; /** * {@inheritdoc} @@ -302,7 +310,11 @@ public function testMultilingualMenuNodeFormWidget() { // Create translation. $translated_node_title = $this->randomMachineName(8); - $node->addTranslation($langcodes[1], ['title' => $translated_node_title, 'body' => $this->randomMachineName(16), 'status' => 1]); + $node->addTranslation($langcodes[1], [ + 'title' => $translated_node_title, + 'body' => $this->randomMachineName(16), + 'status' => 1, + ]); $node->save(); // Edit the node and create a menu link. diff --git a/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php b/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php index 63626bbf43..f8c4493fdc 100644 --- a/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php +++ b/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php @@ -88,7 +88,12 @@ protected function setUp() { $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']); // Create users. - $this->adminUser = $this->drupalCreateUser(['access administration pages', 'administer blocks', 'administer menu', 'create article content']); + $this->adminUser = $this->drupalCreateUser([ + 'access administration pages', + 'administer blocks', + 'administer menu', + 'create article content', + ]); $this->authenticatedUser = $this->drupalCreateUser([]); } @@ -343,7 +348,11 @@ public function doMenuTests() { ], $item2->getPluginId()); $this->assertMenuLink([ 'children' => [], - 'parents' => [$item3->getPluginId(), $item2->getPluginId(), $item1->getPluginId()], + 'parents' => [ + $item3->getPluginId(), + $item2->getPluginId(), + $item1->getPluginId(), + ], // See above. 'langcode' => 'en', ], $item3->getPluginId()); @@ -415,7 +424,12 @@ public function doMenuTests() { 'langcode' => 'en', ], $item1->getPluginId()); $this->assertMenuLink([ - 'children' => [$item5->getPluginId(), $item6->getPluginId(), $item2->getPluginId(), $item3->getPluginId()], + 'children' => [ + $item5->getPluginId(), + $item6->getPluginId(), + $item2->getPluginId(), + $item3->getPluginId(), + ], 'parents' => [$item4->getPluginId()], // See above. 'langcode' => 'en', @@ -429,13 +443,22 @@ public function doMenuTests() { ], $item5->getPluginId()); $this->assertMenuLink([ 'children' => [$item3->getPluginId()], - 'parents' => [$item2->getPluginId(), $item5->getPluginId(), $item4->getPluginId()], + 'parents' => [ + $item2->getPluginId(), + $item5->getPluginId(), + $item4->getPluginId(), + ], // See above. 'langcode' => 'en', ], $item2->getPluginId()); $this->assertMenuLink([ 'children' => [], - 'parents' => [$item3->getPluginId(), $item2->getPluginId(), $item5->getPluginId(), $item4->getPluginId()], + 'parents' => [ + $item3->getPluginId(), + $item2->getPluginId(), + $item5->getPluginId(), + $item4->getPluginId(), + ], // See above. 'langcode' => 'en', ], $item3->getPluginId()); @@ -557,7 +580,13 @@ public function testSystemMenuRename() { * Tests that menu items pointing to unpublished nodes are editable. */ public function testUnpublishedNodeMenuItem() { - $this->drupalLogin($this->drupalCreateUser(['access administration pages', 'administer blocks', 'administer menu', 'create article content', 'bypass node access'])); + $this->drupalLogin($this->drupalCreateUser([ + 'access administration pages', + 'administer blocks', + 'administer menu', + 'create article content', + 'bypass node access', + ])); // Create an unpublished node. $node = $this->drupalCreateNode([ 'type' => 'article', @@ -622,7 +651,11 @@ public function addMenuLink($parent = '', $path = '/', $menu_name = 'tools', $ex $menu_link = reset($menu_links); $this->assertInstanceOf(MenuLinkContent::class, $menu_link, 'Menu link was found in database.'); - $this->assertMenuLink(['menu_name' => $menu_name, 'children' => [], 'parent' => $parent], $menu_link->getPluginId()); + $this->assertMenuLink([ + 'menu_name' => $menu_name, + 'children' => [], + 'parent' => $parent, + ], $menu_link->getPluginId()); return $menu_link; } diff --git a/core/modules/migrate/tests/src/Kernel/HighWaterNotJoinableTest.php b/core/modules/migrate/tests/src/Kernel/HighWaterNotJoinableTest.php index 4198579026..911e50cd19 100644 --- a/core/modules/migrate/tests/src/Kernel/HighWaterNotJoinableTest.php +++ b/core/modules/migrate/tests/src/Kernel/HighWaterNotJoinableTest.php @@ -13,7 +13,11 @@ class HighWaterNotJoinableTest extends MigrateSqlSourceTestBase { /** * {@inheritdoc} */ - public static $modules = ['migrate', 'migrate_drupal', 'migrate_high_water_test']; + public static $modules = [ + 'migrate', + 'migrate_drupal', + 'migrate_high_water_test', + ]; /** * {@inheritdoc} diff --git a/core/modules/migrate/tests/src/Kernel/MigrateEntityContentBaseTest.php b/core/modules/migrate/tests/src/Kernel/MigrateEntityContentBaseTest.php index 24eecfcba6..54ea777784 100644 --- a/core/modules/migrate/tests/src/Kernel/MigrateEntityContentBaseTest.php +++ b/core/modules/migrate/tests/src/Kernel/MigrateEntityContentBaseTest.php @@ -119,13 +119,29 @@ public function testTranslated() { $destination_rows = [ // Existing default translation. - ['id' => 1, 'langcode' => 'en', 'action' => MigrateIdMapInterface::ROLLBACK_PRESERVE], + [ + 'id' => 1, + 'langcode' => 'en', + 'action' => MigrateIdMapInterface::ROLLBACK_PRESERVE, + ], // New translation. - ['id' => 2, 'langcode' => 'en', 'action' => MigrateIdMapInterface::ROLLBACK_DELETE], + [ + 'id' => 2, + 'langcode' => 'en', + 'action' => MigrateIdMapInterface::ROLLBACK_DELETE, + ], // Existing non-default translation. - ['id' => 3, 'langcode' => 'fr', 'action' => MigrateIdMapInterface::ROLLBACK_PRESERVE], + [ + 'id' => 3, + 'langcode' => 'fr', + 'action' => MigrateIdMapInterface::ROLLBACK_PRESERVE, + ], // Brand new row. - ['id' => 4, 'langcode' => 'fr', 'action' => MigrateIdMapInterface::ROLLBACK_DELETE], + [ + 'id' => 4, + 'langcode' => 'fr', + 'action' => MigrateIdMapInterface::ROLLBACK_DELETE, + ], ]; $rollback_actions = []; diff --git a/core/modules/migrate/tests/src/Kernel/MigrateExternalTranslatedTest.php b/core/modules/migrate/tests/src/Kernel/MigrateExternalTranslatedTest.php index ea45a78fca..7921b9ba3a 100644 --- a/core/modules/migrate/tests/src/Kernel/MigrateExternalTranslatedTest.php +++ b/core/modules/migrate/tests/src/Kernel/MigrateExternalTranslatedTest.php @@ -19,7 +19,14 @@ class MigrateExternalTranslatedTest extends MigrateTestBase { /** * {@inheritdoc} */ - public static $modules = ['system', 'user', 'language', 'node', 'field', 'migrate_external_translated_test']; + public static $modules = [ + 'system', + 'user', + 'language', + 'node', + 'field', + 'migrate_external_translated_test', + ]; /** * {@inheritdoc} diff --git a/core/modules/migrate/tests/src/Kernel/MigrateRollbackEntityConfigTest.php b/core/modules/migrate/tests/src/Kernel/MigrateRollbackEntityConfigTest.php index 23ab7481dd..8e237ecf91 100644 --- a/core/modules/migrate/tests/src/Kernel/MigrateRollbackEntityConfigTest.php +++ b/core/modules/migrate/tests/src/Kernel/MigrateRollbackEntityConfigTest.php @@ -17,7 +17,15 @@ class MigrateRollbackEntityConfigTest extends MigrateTestBase { * * @var array */ - public static $modules = ['field', 'taxonomy', 'text', 'language', 'config_translation', 'user', 'system']; + public static $modules = [ + 'field', + 'taxonomy', + 'text', + 'language', + 'config_translation', + 'user', + 'system', + ]; /** * {@inheritdoc} diff --git a/core/modules/migrate/tests/src/Kernel/MigrateRollbackTest.php b/core/modules/migrate/tests/src/Kernel/MigrateRollbackTest.php index c772c8a27e..0ec907672a 100644 --- a/core/modules/migrate/tests/src/Kernel/MigrateRollbackTest.php +++ b/core/modules/migrate/tests/src/Kernel/MigrateRollbackTest.php @@ -130,7 +130,11 @@ public function testRollback() { } // Add a failed row to test if this can be rolled back without errors. - $this->mockFailure($term_migration, ['id' => '4', 'vocab' => '2', 'name' => 'FAIL']); + $this->mockFailure($term_migration, [ + 'id' => '4', + 'vocab' => '2', + 'name' => 'FAIL', + ]); // Rollback and verify the entities are gone. $term_executable->rollback(); diff --git a/core/modules/migrate/tests/src/Kernel/MigrationTest.php b/core/modules/migrate/tests/src/Kernel/MigrationTest.php index 5fe56ecf95..8970823c6e 100644 --- a/core/modules/migrate/tests/src/Kernel/MigrationTest.php +++ b/core/modules/migrate/tests/src/Kernel/MigrationTest.php @@ -34,7 +34,11 @@ public function testSetInvalidation() { $this->assertEqual('entity:entity_view_mode', $migration->getDestinationPlugin()->getPluginId()); // Test the source plugin is invalidated. - $migration->set('source', ['plugin' => 'embedded_data', 'data_rows' => [], 'ids' => []]); + $migration->set('source', [ + 'plugin' => 'embedded_data', + 'data_rows' => [], + 'ids' => [], + ]); $this->assertEqual('embedded_data', $migration->getSourcePlugin()->getPluginId()); // Test the destination plugin is invalidated. diff --git a/core/modules/migrate/tests/src/Kernel/Plugin/MigrationTest.php b/core/modules/migrate/tests/src/Kernel/Plugin/MigrationTest.php index aceb73e807..667213e394 100644 --- a/core/modules/migrate/tests/src/Kernel/Plugin/MigrationTest.php +++ b/core/modules/migrate/tests/src/Kernel/Plugin/MigrationTest.php @@ -107,7 +107,10 @@ public function testGetMigrationDependencies() { ], ]; $migration = $plugin_manager->createStubMigration($plugin_definition); - $this->assertSame(['required' => [], 'optional' => ['m1', 'm2', 'm3', 'm4', 'm5']], $migration->getMigrationDependencies()); + $this->assertSame([ + 'required' => [], + 'optional' => ['m1', 'm2', 'm3', 'm4', 'm5'], + ], $migration->getMigrationDependencies()); } /** diff --git a/core/modules/migrate/tests/src/Unit/MigrateSourceTest.php b/core/modules/migrate/tests/src/Unit/MigrateSourceTest.php index f8dc7541fa..5e4f3b1e15 100644 --- a/core/modules/migrate/tests/src/Unit/MigrateSourceTest.php +++ b/core/modules/migrate/tests/src/Unit/MigrateSourceTest.php @@ -100,14 +100,25 @@ protected function getSource($configuration = [], $migrate_config = [], $status // Update the idMap for Source so the default is that the row has already // been imported. This allows us to use the highwater mark to decide on the // outcome of whether we choose to import the row. - $id_map_array = ['original_hash' => '', 'hash' => '', 'source_row_status' => $status]; + $id_map_array = [ + 'original_hash' => '', + 'hash' => '', + 'source_row_status' => $status, + ]; $this->idMap ->expects($this->any()) ->method('getRowBySource') ->willReturn($id_map_array); $constructor_args = [$configuration, 'd6_action', [], $this->migration]; - $methods = ['getModuleHandler', 'fields', 'getIds', '__toString', 'prepareRow', 'initializeIterator']; + $methods = [ + 'getModuleHandler', + 'fields', + 'getIds', + '__toString', + 'prepareRow', + 'initializeIterator', + ]; $source_plugin = $this->getMockBuilder(SourcePluginBase::class) ->setMethods($methods) ->setConstructorArgs($constructor_args) diff --git a/core/modules/migrate/tests/src/Unit/MigrationTest.php b/core/modules/migrate/tests/src/Unit/MigrationTest.php index 27e9a803b3..a4d553d3f7 100644 --- a/core/modules/migrate/tests/src/Unit/MigrationTest.php +++ b/core/modules/migrate/tests/src/Unit/MigrationTest.php @@ -106,7 +106,11 @@ public function testRequirementsForMigrations() { $plugin_manager->expects($this->once()) ->method('createInstances') ->with(['test_a', 'test_b', 'test_c', 'test_d']) - ->willReturn(['test_b' => $migration_b, 'test_c' => $migration_c, 'test_d' => $migration_d]); + ->willReturn([ + 'test_b' => $migration_b, + 'test_c' => $migration_c, + 'test_d' => $migration_d, + ]); $this->expectException(RequirementsException::class); $this->expectExceptionMessage('Missing migrations test_a, test_c'); diff --git a/core/modules/migrate/tests/src/Unit/SqlBaseTest.php b/core/modules/migrate/tests/src/Unit/SqlBaseTest.php index bc2843e1e2..fa642af81c 100644 --- a/core/modules/migrate/tests/src/Unit/SqlBaseTest.php +++ b/core/modules/migrate/tests/src/Unit/SqlBaseTest.php @@ -108,8 +108,16 @@ public function sqlBaseTestProvider() { FALSE, TRUE, TRUE, - ['driver' => 'mysql', 'username' => 'different_from_map', 'password' => 'different_from_map'], - ['driver' => 'mysql', 'username' => 'different_from_source', 'password' => 'different_from_source'], + [ + 'driver' => 'mysql', + 'username' => 'different_from_map', + 'password' => 'different_from_map', + ], + [ + 'driver' => 'mysql', + 'username' => 'different_from_source', + 'password' => 'different_from_source', + ], ], // Returns false because driver is pgsql and the databases are not the // same. @@ -117,8 +125,18 @@ public function sqlBaseTestProvider() { FALSE, TRUE, TRUE, - ['driver' => 'pgsql', 'database' => '1.pgsql', 'username' => 'same_value', 'password' => 'same_value'], - ['driver' => 'pgsql', 'database' => '2.pgsql', 'username' => 'same_value', 'password' => 'same_value'], + [ + 'driver' => 'pgsql', + 'database' => '1.pgsql', + 'username' => 'same_value', + 'password' => 'same_value', + ], + [ + 'driver' => 'pgsql', + 'database' => '2.pgsql', + 'username' => 'same_value', + 'password' => 'same_value', + ], ], // Returns false because driver is sqlite and the databases are not the // same. @@ -126,16 +144,34 @@ public function sqlBaseTestProvider() { FALSE, TRUE, TRUE, - ['driver' => 'sqlite', 'database' => '1.sqlite', 'username' => '', 'password' => ''], - ['driver' => 'sqlite', 'database' => '2.sqlite', 'username' => '', 'password' => ''], + [ + 'driver' => 'sqlite', + 'database' => '1.sqlite', + 'username' => '', + 'password' => '', + ], + [ + 'driver' => 'sqlite', + 'database' => '2.sqlite', + 'username' => '', + 'password' => '', + ], ], // Returns false because driver is not the same. [ FALSE, TRUE, TRUE, - ['driver' => 'pgsql', 'username' => 'same_value', 'password' => 'same_value'], - ['driver' => 'mysql', 'username' => 'same_value', 'password' => 'same_value'], + [ + 'driver' => 'pgsql', + 'username' => 'same_value', + 'password' => 'same_value', + ], + [ + 'driver' => 'mysql', + 'username' => 'same_value', + 'password' => 'same_value', + ], ], ]; } diff --git a/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php b/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php index 5c4a856c0b..06f4848754 100644 --- a/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php +++ b/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php @@ -44,7 +44,12 @@ public function testImport() { ->method('save') ->with(); $plugin = new TestPerComponentEntityDisplay($entity); - $this->assertSame(['entity_type_test', 'bundle_test', 'view_mode_test', 'field_name_test'], $plugin->import($row)); + $this->assertSame([ + 'entity_type_test', + 'bundle_test', + 'view_mode_test', + 'field_name_test', + ], $plugin->import($row)); $this->assertSame(['entity_type_test', 'bundle_test', 'view_mode_test'], $plugin->getTestValues()); } diff --git a/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php b/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php index 218d9a6585..2c61f7d634 100644 --- a/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php +++ b/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php @@ -44,7 +44,12 @@ public function testImport() { ->method('save') ->with(); $plugin = new TestPerComponentEntityFormDisplay($entity); - $this->assertSame(['entity_type_test', 'bundle_test', 'form_mode_test', 'field_name_test'], $plugin->import($row)); + $this->assertSame([ + 'entity_type_test', + 'bundle_test', + 'form_mode_test', + 'field_name_test', + ], $plugin->import($row)); $this->assertSame(['entity_type_test', 'bundle_test', 'form_mode_test'], $plugin->getTestValues()); } diff --git a/core/modules/migrate/tests/src/Unit/process/GetTest.php b/core/modules/migrate/tests/src/Unit/process/GetTest.php index bc9065c63e..9a5ba545b9 100644 --- a/core/modules/migrate/tests/src/Unit/process/GetTest.php +++ b/core/modules/migrate/tests/src/Unit/process/GetTest.php @@ -65,14 +65,21 @@ public function testTransformSourceArrayAt() { '@@test3' => 'source_value3', 'test4' => 'source_value4', ]; - $this->plugin = new Get(['source' => ['test1', '@@test2', '@@test3', 'test4']], '', []); + $this->plugin = new Get([ + 'source' => ['test1', '@@test2', '@@test3', 'test4'], + ], '', []); $this->row->expects($this->exactly(4)) ->method('get') ->will($this->returnCallback(function ($argument) use ($map) { return $map[$argument]; })); $value = $this->plugin->transform(NULL, $this->migrateExecutable, $this->row, 'destinationproperty'); - $this->assertSame(['source_value1', 'source_value2', 'source_value3', 'source_value4'], $value); + $this->assertSame([ + 'source_value1', + 'source_value2', + 'source_value3', + 'source_value4', + ], $value); } /** diff --git a/core/modules/migrate_drupal/tests/src/Kernel/MigrateDrupalTestBase.php b/core/modules/migrate_drupal/tests/src/Kernel/MigrateDrupalTestBase.php index f361fb16ef..532ba1ba1a 100644 --- a/core/modules/migrate_drupal/tests/src/Kernel/MigrateDrupalTestBase.php +++ b/core/modules/migrate_drupal/tests/src/Kernel/MigrateDrupalTestBase.php @@ -15,7 +15,14 @@ * * @var array */ - public static $modules = ['system', 'user', 'field', 'migrate_drupal', 'options', 'file']; + public static $modules = [ + 'system', + 'user', + 'field', + 'migrate_drupal', + 'options', + 'file', + ]; /** * {@inheritdoc} diff --git a/core/modules/node/src/Controller/NodeController.php b/core/modules/node/src/Controller/NodeController.php index d87b298869..6474eb342e 100644 --- a/core/modules/node/src/Controller/NodeController.php +++ b/core/modules/node/src/Controller/NodeController.php @@ -232,8 +232,15 @@ public function revisionOverview(NodeInterface $node) { $links['revert'] = [ 'title' => $vid < $node->getRevisionId() ? $this->t('Revert') : $this->t('Set as current revision'), 'url' => $has_translations ? - Url::fromRoute('node.revision_revert_translation_confirm', ['node' => $node->id(), 'node_revision' => $vid, 'langcode' => $langcode]) : - Url::fromRoute('node.revision_revert_confirm', ['node' => $node->id(), 'node_revision' => $vid]), + Url::fromRoute('node.revision_revert_translation_confirm', [ + 'node' => $node->id(), + 'node_revision' => $vid, + 'langcode' => $langcode, + ]) : + Url::fromRoute('node.revision_revert_confirm', [ + 'node' => $node->id(), + 'node_revision' => $vid, + ]), ]; } diff --git a/core/modules/node/src/Form/NodeRevisionDeleteForm.php b/core/modules/node/src/Form/NodeRevisionDeleteForm.php index aefefde6cd..91ed94d173 100644 --- a/core/modules/node/src/Form/NodeRevisionDeleteForm.php +++ b/core/modules/node/src/Form/NodeRevisionDeleteForm.php @@ -130,7 +130,11 @@ public function buildForm(array $form, FormStateInterface $form_state, $node_rev public function submitForm(array &$form, FormStateInterface $form_state) { $this->nodeStorage->deleteRevision($this->revision->getRevisionId()); - $this->logger('content')->notice('@type: deleted %title revision %revision.', ['@type' => $this->revision->bundle(), '%title' => $this->revision->label(), '%revision' => $this->revision->getRevisionId()]); + $this->logger('content')->notice('@type: deleted %title revision %revision.', [ + '@type' => $this->revision->bundle(), + '%title' => $this->revision->label(), + '%revision' => $this->revision->getRevisionId(), + ]); $node_type = $this->nodeTypeStorage->load($this->revision->bundle())->label(); $this->messenger() ->addStatus($this->t('Revision from %revision-date of @type %title has been deleted.', [ diff --git a/core/modules/node/src/Form/NodeRevisionRevertForm.php b/core/modules/node/src/Form/NodeRevisionRevertForm.php index da5cba023c..4e599b38da 100644 --- a/core/modules/node/src/Form/NodeRevisionRevertForm.php +++ b/core/modules/node/src/Form/NodeRevisionRevertForm.php @@ -133,7 +133,11 @@ public function submitForm(array &$form, FormStateInterface $form_state) { $this->revision->setChangedTime($this->time->getRequestTime()); $this->revision->save(); - $this->logger('content')->notice('@type: reverted %title revision %revision.', ['@type' => $this->revision->bundle(), '%title' => $this->revision->label(), '%revision' => $this->revision->getRevisionId()]); + $this->logger('content')->notice('@type: reverted %title revision %revision.', [ + '@type' => $this->revision->bundle(), + '%title' => $this->revision->label(), + '%revision' => $this->revision->getRevisionId(), + ]); $this->messenger() ->addStatus($this->t('@type %title has been reverted to the revision from %revision-date.', [ '@type' => node_get_type_label($this->revision), diff --git a/core/modules/node/src/NodeAccessControlHandler.php b/core/modules/node/src/NodeAccessControlHandler.php index 3c2e8190bf..f59f164295 100644 --- a/core/modules/node/src/NodeAccessControlHandler.php +++ b/core/modules/node/src/NodeAccessControlHandler.php @@ -151,7 +151,13 @@ public function acquireGrants(NodeInterface $node) { $this->moduleHandler->alter('node_access_records', $grants, $node); // If no grants are set and the node is published, then use the default grant. if (empty($grants) && $node->isPublished()) { - $grants[] = ['realm' => 'all', 'gid' => 0, 'grant_view' => 1, 'grant_update' => 0, 'grant_delete' => 0]; + $grants[] = [ + 'realm' => 'all', + 'gid' => 0, + 'grant_view' => 1, + 'grant_update' => 0, + 'grant_delete' => 0, + ]; } return $grants; } diff --git a/core/modules/node/src/NodeForm.php b/core/modules/node/src/NodeForm.php index a90a5a723f..2d09fbefb5 100644 --- a/core/modules/node/src/NodeForm.php +++ b/core/modules/node/src/NodeForm.php @@ -269,8 +269,15 @@ public function save(array $form, FormStateInterface $form_state) { $insert = $node->isNew(); $node->save(); $node_link = $node->toLink($this->t('View'))->toString(); - $context = ['@type' => $node->getType(), '%title' => $node->label(), 'link' => $node_link]; - $t_args = ['@type' => node_get_type_label($node), '%title' => $node->toLink()->toString()]; + $context = [ + '@type' => $node->getType(), + '%title' => $node->label(), + 'link' => $node_link, + ]; + $t_args = [ + '@type' => node_get_type_label($node), + '%title' => $node->toLink()->toString(), + ]; if ($insert) { $this->logger('content')->notice('@type: added %title.', $context); diff --git a/core/modules/node/src/NodeGrantDatabaseStorage.php b/core/modules/node/src/NodeGrantDatabaseStorage.php index d273359be1..ee708f216d 100644 --- a/core/modules/node/src/NodeGrantDatabaseStorage.php +++ b/core/modules/node/src/NodeGrantDatabaseStorage.php @@ -210,7 +210,16 @@ public function write(NodeInterface $node, array $grants, $realm = NULL, $delete } // Only perform work when node_access modules are active. if (!empty($grants) && count($this->moduleHandler->getImplementations('node_grants'))) { - $query = $this->database->insert('node_access')->fields(['nid', 'langcode', 'fallback', 'realm', 'gid', 'grant_view', 'grant_update', 'grant_delete']); + $query = $this->database->insert('node_access')->fields([ + 'nid', + 'langcode', + 'fallback', + 'realm', + 'gid', + 'grant_view', + 'grant_update', + 'grant_delete', + ]); // If we have defined a granted langcode, use it. But if not, add a grant // for every language this node is translated to. $fallback_langcode = $node->getUntranslated()->language()->getId(); diff --git a/core/modules/node/src/Plugin/Search/NodeSearch.php b/core/modules/node/src/Plugin/Search/NodeSearch.php index 390fa20950..de433f7ff4 100644 --- a/core/modules/node/src/Plugin/Search/NodeSearch.php +++ b/core/modules/node/src/Plugin/Search/NodeSearch.php @@ -123,7 +123,14 @@ class NodeSearch extends ConfigurableSearchPluginBase implements AccessibleInter 'type' => ['column' => 'n.type'], 'language' => ['column' => 'i.langcode'], 'author' => ['column' => 'n.uid'], - 'term' => ['column' => 'ti.tid', 'join' => ['table' => 'taxonomy_index', 'alias' => 'ti', 'condition' => 'n.nid = ti.nid']], + 'term' => [ + 'column' => 'ti.tid', + 'join' => [ + 'table' => 'taxonomy_index', + 'alias' => 'ti', + 'condition' => 'n.nid = ti.nid', + ], + ], ]; /** diff --git a/core/modules/node/tests/src/Functional/NodeAccessLanguageFallbackTest.php b/core/modules/node/tests/src/Functional/NodeAccessLanguageFallbackTest.php index b53e36666d..d0e535bda3 100644 --- a/core/modules/node/tests/src/Functional/NodeAccessLanguageFallbackTest.php +++ b/core/modules/node/tests/src/Functional/NodeAccessLanguageFallbackTest.php @@ -16,7 +16,11 @@ class NodeAccessLanguageFallbackTest extends NodeTestBase { * * @var array */ - public static $modules = ['language', 'node_access_test', 'content_translation']; + public static $modules = [ + 'language', + 'node_access_test', + 'content_translation', + ]; /** * {@inheritdoc} diff --git a/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php b/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php index b0b0aae17b..16843cc589 100644 --- a/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php +++ b/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php @@ -47,8 +47,16 @@ protected function setUp() { parent::setUp(); // Create users and test node. - $this->adminUser = $this->drupalCreateUser(['administer content types', 'administer nodes', 'administer blocks', 'access content overview']); - $this->webUser = $this->drupalCreateUser(['access content', 'create article content']); + $this->adminUser = $this->drupalCreateUser([ + 'administer content types', + 'administer nodes', + 'administer blocks', + 'access content overview', + ]); + $this->webUser = $this->drupalCreateUser([ + 'access content', + 'create article content', + ]); } /** @@ -63,7 +71,10 @@ public function testRecentNodeBlock() { ]); // Enable the recent content block with two items. - $block = $this->drupalPlaceBlock('views_block:content_recent-block_1', ['id' => 'test_block', 'items_per_page' => 2]); + $block = $this->drupalPlaceBlock('views_block:content_recent-block_1', [ + 'id' => 'test_block', + 'items_per_page' => 2, + ]); // Test that block is not visible without nodes. $this->drupalGet(''); diff --git a/core/modules/node/tests/src/Functional/NodeFieldMultilingualTest.php b/core/modules/node/tests/src/Functional/NodeFieldMultilingualTest.php index 2d1f97472d..2bf6b30e3e 100644 --- a/core/modules/node/tests/src/Functional/NodeFieldMultilingualTest.php +++ b/core/modules/node/tests/src/Functional/NodeFieldMultilingualTest.php @@ -34,7 +34,13 @@ protected function setUp() { $this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']); // Setup users. - $admin_user = $this->drupalCreateUser(['administer languages', 'administer content types', 'access administration pages', 'create page content', 'edit own page content']); + $admin_user = $this->drupalCreateUser([ + 'administer languages', + 'administer content types', + 'access administration pages', + 'create page content', + 'edit own page content', + ]); $this->drupalLogin($admin_user); // Add a new language. diff --git a/core/modules/node/tests/src/Functional/NodeRSSContentTest.php b/core/modules/node/tests/src/Functional/NodeRSSContentTest.php index 6dd1592228..fa81958d94 100644 --- a/core/modules/node/tests/src/Functional/NodeRSSContentTest.php +++ b/core/modules/node/tests/src/Functional/NodeRSSContentTest.php @@ -33,7 +33,11 @@ protected function setUp() { // Use bypass node access permission here, because the test class uses // hook_grants_alter() to deny access to everyone on node_access // queries. - $user = $this->drupalCreateUser(['bypass node access', 'access content', 'create article content']); + $user = $this->drupalCreateUser([ + 'bypass node access', + 'access content', + 'create article content', + ]); $this->drupalLogin($user); } diff --git a/core/modules/node/tests/src/Functional/NodeTitleTest.php b/core/modules/node/tests/src/Functional/NodeTitleTest.php index 0e490320e5..4c3a55a634 100644 --- a/core/modules/node/tests/src/Functional/NodeTitleTest.php +++ b/core/modules/node/tests/src/Functional/NodeTitleTest.php @@ -41,7 +41,12 @@ protected function setUp() { $this->drupalPlaceBlock('system_breadcrumb_block'); $this->drupalPlaceBlock('page_title_block'); - $this->adminUser = $this->drupalCreateUser(['administer nodes', 'create article content', 'create page content', 'post comments']); + $this->adminUser = $this->drupalCreateUser([ + 'administer nodes', + 'create article content', + 'create page content', + 'post comments', + ]); $this->drupalLogin($this->adminUser); $this->addDefaultCommentField('node', 'page'); } diff --git a/core/modules/node/tests/src/Functional/NodeTranslationUITest.php b/core/modules/node/tests/src/Functional/NodeTranslationUITest.php index 2201d727d8..99a31393bc 100644 --- a/core/modules/node/tests/src/Functional/NodeTranslationUITest.php +++ b/core/modules/node/tests/src/Functional/NodeTranslationUITest.php @@ -46,7 +46,15 @@ class NodeTranslationUITest extends ContentTranslationUITestBase { * * @var array */ - public static $modules = ['block', 'language', 'content_translation', 'node', 'datetime', 'field_ui', 'help']; + public static $modules = [ + 'block', + 'language', + 'content_translation', + 'node', + 'datetime', + 'field_ui', + 'help', + ]; /** * The profile to install as a basis for testing. @@ -125,7 +133,10 @@ public function testPublishedStatusNoFields() { * {@inheritdoc} */ protected function getTranslatorPermissions() { - return array_merge(parent::getTranslatorPermissions(), ['administer nodes', "edit any $this->bundle content"]); + return array_merge(parent::getTranslatorPermissions(), [ + 'administer nodes', + "edit any $this->bundle content", + ]); } /** @@ -139,7 +150,16 @@ protected function getEditorPermissions() { * {@inheritdoc} */ protected function getAdministratorPermissions() { - return array_merge(parent::getAdministratorPermissions(), ['access administration pages', 'administer content types', 'administer node fields', 'access content overview', 'bypass node access', 'administer languages', 'administer themes', 'view the administration theme']); + return array_merge(parent::getAdministratorPermissions(), [ + 'access administration pages', + 'administer content types', + 'administer node fields', + 'access content overview', + 'bypass node access', + 'administer languages', + 'administer themes', + 'view the administration theme', + ]); } /** diff --git a/core/modules/node/tests/src/Kernel/Action/UnpublishByKeywordActionTest.php b/core/modules/node/tests/src/Kernel/Action/UnpublishByKeywordActionTest.php index 01f30b55df..3fa689e9d7 100644 --- a/core/modules/node/tests/src/Kernel/Action/UnpublishByKeywordActionTest.php +++ b/core/modules/node/tests/src/Kernel/Action/UnpublishByKeywordActionTest.php @@ -26,7 +26,11 @@ protected function setUp() { // Install system's configuration as default date formats are needed. $this->installConfig(['system']); // Create a node type for testing. - $type = NodeType::create(['type' => 'page', 'name' => 'page', 'display_submitted' => FALSE]); + $type = NodeType::create([ + 'type' => 'page', + 'name' => 'page', + 'display_submitted' => FALSE, + ]); $type->save(); } diff --git a/core/modules/node/tests/src/Kernel/Config/NodeImportChangeTest.php b/core/modules/node/tests/src/Kernel/Config/NodeImportChangeTest.php index d670e6a44c..35e26ef5d0 100644 --- a/core/modules/node/tests/src/Kernel/Config/NodeImportChangeTest.php +++ b/core/modules/node/tests/src/Kernel/Config/NodeImportChangeTest.php @@ -17,7 +17,14 @@ class NodeImportChangeTest extends KernelTestBase { * * @var array */ - public static $modules = ['node', 'field', 'text', 'system', 'node_test_config', 'user']; + public static $modules = [ + 'node', + 'field', + 'text', + 'system', + 'node_test_config', + 'user', + ]; /** * Set the default field storage backend for fields created during tests. diff --git a/core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareCombinationTest.php b/core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareCombinationTest.php index 6886f22db6..a7bc14b29a 100644 --- a/core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareCombinationTest.php +++ b/core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareCombinationTest.php @@ -23,7 +23,11 @@ class NodeAccessLanguageAwareCombinationTest extends NodeAccessTestBase { * * @var array */ - public static $modules = ['language', 'node_access_test_language', 'node_access_test']; + public static $modules = [ + 'language', + 'node_access_test_language', + 'node_access_test', + ]; /** * A set of nodes to use in testing. @@ -195,8 +199,16 @@ protected function setUp() { */ public function testNodeAccessLanguageAwareCombination() { - $expected_node_access = ['view' => TRUE, 'update' => FALSE, 'delete' => FALSE]; - $expected_node_access_no_access = ['view' => FALSE, 'update' => FALSE, 'delete' => FALSE]; + $expected_node_access = [ + 'view' => TRUE, + 'update' => FALSE, + 'delete' => FALSE, + ]; + $expected_node_access_no_access = [ + 'view' => FALSE, + 'update' => FALSE, + 'delete' => FALSE, + ]; // When the node and both translations are public, access should always be // granted. diff --git a/core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareTest.php b/core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareTest.php index 6c901db9ba..aaf4f5feab 100644 --- a/core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareTest.php +++ b/core/modules/node/tests/src/Kernel/NodeAccessLanguageAwareTest.php @@ -151,8 +151,16 @@ protected function setUp() { */ public function testNodeAccessLanguageAware() { // The node_access_test_language module only grants view access. - $expected_node_access = ['view' => TRUE, 'update' => FALSE, 'delete' => FALSE]; - $expected_node_access_no_access = ['view' => FALSE, 'update' => FALSE, 'delete' => FALSE]; + $expected_node_access = [ + 'view' => TRUE, + 'update' => FALSE, + 'delete' => FALSE, + ]; + $expected_node_access_no_access = [ + 'view' => FALSE, + 'update' => FALSE, + 'delete' => FALSE, + ]; // When both Hungarian and Catalan are marked as public, access to the // Hungarian translation should be granted with the default entity object or diff --git a/core/modules/node/tests/src/Kernel/NodeAccessLanguageTest.php b/core/modules/node/tests/src/Kernel/NodeAccessLanguageTest.php index 269240670b..878881699e 100644 --- a/core/modules/node/tests/src/Kernel/NodeAccessLanguageTest.php +++ b/core/modules/node/tests/src/Kernel/NodeAccessLanguageTest.php @@ -48,11 +48,19 @@ public function testNodeAccess() { $web_user = $this->drupalCreateUser(['access content']); $expected_node_access = ['view' => TRUE, 'update' => FALSE, 'delete' => FALSE]; - $expected_node_access_no_access = ['view' => FALSE, 'update' => FALSE, 'delete' => FALSE]; + $expected_node_access_no_access = [ + 'view' => FALSE, + 'update' => FALSE, + 'delete' => FALSE, + ]; // Creating a public node with langcode Hungarian, will be saved as the // fallback in node access table. - $node_public_hu = $this->drupalCreateNode(['body' => [[]], 'langcode' => 'hu', 'private' => FALSE]); + $node_public_hu = $this->drupalCreateNode([ + 'body' => [[]], + 'langcode' => 'hu', + 'private' => FALSE, + ]); $this->assertTrue($node_public_hu->language()->getId() == 'hu', 'Node created as Hungarian.'); // Tests the default access is provided for the public Hungarian node. @@ -75,7 +83,11 @@ public function testNodeAccess() { // Reset the node access cache and turn on our test node access code. \Drupal::entityTypeManager()->getAccessControlHandler('node')->resetCache(); \Drupal::state()->set('node_access_test_secret_catalan', 1); - $node_public_ca = $this->drupalCreateNode(['body' => [[]], 'langcode' => 'ca', 'private' => FALSE]); + $node_public_ca = $this->drupalCreateNode([ + 'body' => [[]], + 'langcode' => 'ca', + 'private' => FALSE, + ]); $this->assertTrue($node_public_ca->language()->getId() == 'ca', 'Node created as Catalan.'); // Tests that access is granted if requested with no language. @@ -121,7 +133,11 @@ public function testNodeAccessPrivate() { // Creating a private node with langcode Hungarian, will be saved as the // fallback in node access table. - $node_private_hu = $this->drupalCreateNode(['body' => [[]], 'langcode' => 'hu', 'private' => TRUE]); + $node_private_hu = $this->drupalCreateNode([ + 'body' => [[]], + 'langcode' => 'hu', + 'private' => TRUE, + ]); $this->assertTrue($node_private_hu->language()->getId() == 'hu', 'Node created as Hungarian.'); // Tests the default access is not provided for the private Hungarian node. @@ -151,7 +167,11 @@ public function testNodeAccessPrivate() { // Creating a private node with langcode Catalan to test that the // node_access_test_secret_catalan flag works. $private_ca_user = $this->drupalCreateUser(['access content', 'node test view']); - $node_private_ca = $this->drupalCreateNode(['body' => [[]], 'langcode' => 'ca', 'private' => TRUE]); + $node_private_ca = $this->drupalCreateNode([ + 'body' => [[]], + 'langcode' => 'ca', + 'private' => TRUE, + ]); $this->assertTrue($node_private_ca->language()->getId() == 'ca', 'Node created as Catalan.'); // Tests that Catalan is still not accessible to either user. diff --git a/core/modules/node/tests/src/Kernel/NodeAccessRecordsTest.php b/core/modules/node/tests/src/Kernel/NodeAccessRecordsTest.php index 714f18cb43..29536523cb 100644 --- a/core/modules/node/tests/src/Kernel/NodeAccessRecordsTest.php +++ b/core/modules/node/tests/src/Kernel/NodeAccessRecordsTest.php @@ -46,7 +46,11 @@ public function testNodeAccessRecords() { $this->assertEqual($records[0]->gid, 1, 'Grant with gid = 1 acquired for node without alteration.'); // Create an unpromoted, unpublished "Basic page" node. - $node3 = $this->drupalCreateNode(['type' => 'page', 'promote' => 0, 'status' => 0]); + $node3 = $this->drupalCreateNode([ + 'type' => 'page', + 'promote' => 0, + 'status' => 0, + ]); $this->assertNotEmpty(Node::load($node3->id()), 'Unpromoted, unpublished basic page node created.'); // Check to see if grants added by node_test_node_access_records made it in. diff --git a/core/modules/node/tests/src/Kernel/NodeConditionTest.php b/core/modules/node/tests/src/Kernel/NodeConditionTest.php index 6dc21babb2..c393173226 100644 --- a/core/modules/node/tests/src/Kernel/NodeConditionTest.php +++ b/core/modules/node/tests/src/Kernel/NodeConditionTest.php @@ -35,11 +35,23 @@ public function testConditions() { $this->createUser(); // Get some nodes of various types to check against. - $page = Node::create(['type' => 'page', 'title' => $this->randomMachineName(), 'uid' => 1]); + $page = Node::create([ + 'type' => 'page', + 'title' => $this->randomMachineName(), + 'uid' => 1, + ]); $page->save(); - $article = Node::create(['type' => 'article', 'title' => $this->randomMachineName(), 'uid' => 1]); + $article = Node::create([ + 'type' => 'article', + 'title' => $this->randomMachineName(), + 'uid' => 1, + ]); $article->save(); - $test = Node::create(['type' => 'test', 'title' => $this->randomMachineName(), 'uid' => 1]); + $test = Node::create([ + 'type' => 'test', + 'title' => $this->randomMachineName(), + 'uid' => 1, + ]); $test->save(); // Grab the node type condition and configure it to check against node type diff --git a/core/modules/node/tests/src/Kernel/NodeFieldAccessTest.php b/core/modules/node/tests/src/Kernel/NodeFieldAccessTest.php index 812731fc61..0af802bb64 100644 --- a/core/modules/node/tests/src/Kernel/NodeFieldAccessTest.php +++ b/core/modules/node/tests/src/Kernel/NodeFieldAccessTest.php @@ -65,8 +65,16 @@ public function testAccessToAdministrativeFields() { $content_admin_user = $this->createUser(['uid' => 2], ['administer nodes']); // Two different editor users. - $page_creator_user = $this->createUser([], ['create page content', 'edit own page content', 'delete own page content']); - $page_manager_user = $this->createUser([], ['create page content', 'edit any page content', 'delete any page content']); + $page_creator_user = $this->createUser([], [ + 'create page content', + 'edit own page content', + 'delete own page content', + ]); + $page_manager_user = $this->createUser([], [ + 'create page content', + 'edit any page content', + 'delete any page content', + ]); // An unprivileged user. $page_unrelated_user = $this->createUser([], ['access content']); diff --git a/core/modules/node/tests/src/Kernel/NodeListBuilderTest.php b/core/modules/node/tests/src/Kernel/NodeListBuilderTest.php index 8949d0b4ce..7658a109c4 100644 --- a/core/modules/node/tests/src/Kernel/NodeListBuilderTest.php +++ b/core/modules/node/tests/src/Kernel/NodeListBuilderTest.php @@ -33,7 +33,13 @@ public function testCacheContexts() { $build = $list_builder->render(); $this->container->get('renderer')->renderRoot($build); - $this->assertEqual(['languages:' . LanguageInterface::TYPE_INTERFACE, 'theme', 'url.query_args.pagers:0', 'user.node_grants:view', 'user.permissions'], $build['#cache']['contexts']); + $this->assertEqual([ + 'languages:' . LanguageInterface::TYPE_INTERFACE, + 'theme', + 'url.query_args.pagers:0', + 'user.node_grants:view', + 'user.permissions', + ], $build['#cache']['contexts']); } } diff --git a/core/modules/node/tests/src/Kernel/Views/NidArgumentTest.php b/core/modules/node/tests/src/Kernel/Views/NidArgumentTest.php index 78ec67b19c..55105c852f 100644 --- a/core/modules/node/tests/src/Kernel/Views/NidArgumentTest.php +++ b/core/modules/node/tests/src/Kernel/Views/NidArgumentTest.php @@ -18,7 +18,14 @@ class NidArgumentTest extends ViewsKernelTestBase { /** * {@inheritdoc} */ - public static $modules = ['node', 'field', 'text', 'node_test_config', 'user', 'node_test_views']; + public static $modules = [ + 'node', + 'field', + 'text', + 'node_test_config', + 'user', + 'node_test_views', + ]; /** * Views used by this test. diff --git a/core/modules/options/tests/src/Functional/OptionsFieldUITest.php b/core/modules/options/tests/src/Functional/OptionsFieldUITest.php index 97e150407f..bfffaf361c 100644 --- a/core/modules/options/tests/src/Functional/OptionsFieldUITest.php +++ b/core/modules/options/tests/src/Functional/OptionsFieldUITest.php @@ -58,7 +58,17 @@ protected function setUp() { parent::setUp(); // Create test user. - $admin_user = $this->drupalCreateUser(['access content', 'administer taxonomy', 'access administration pages', 'administer site configuration', 'administer content types', 'administer nodes', 'bypass node access', 'administer node fields', 'administer node display']); + $admin_user = $this->drupalCreateUser([ + 'access content', + 'administer taxonomy', + 'access administration pages', + 'administer site configuration', + 'administer content types', + 'administer nodes', + 'bypass node access', + 'administer node fields', + 'administer node display', + ]); $this->drupalLogin($admin_user); // Create content type, with underscores. diff --git a/core/modules/options/tests/src/Functional/OptionsFloatFieldImportTest.php b/core/modules/options/tests/src/Functional/OptionsFloatFieldImportTest.php index 556bc9ba2f..00fa57e560 100644 --- a/core/modules/options/tests/src/Functional/OptionsFloatFieldImportTest.php +++ b/core/modules/options/tests/src/Functional/OptionsFloatFieldImportTest.php @@ -18,7 +18,13 @@ class OptionsFloatFieldImportTest extends FieldTestBase { * * @var array */ - public static $modules = ['node', 'options', 'field_ui', 'config', 'options_config_install_test']; + public static $modules = [ + 'node', + 'options', + 'field_ui', + 'config', + 'options_config_install_test', + ]; /** * {@inheritdoc} @@ -29,7 +35,17 @@ protected function setUp() { parent::setUp(); // Create test user. - $admin_user = $this->drupalCreateUser(['synchronize configuration', 'access content', 'access administration pages', 'administer site configuration', 'administer content types', 'administer nodes', 'bypass node access', 'administer node fields', 'administer node display']); + $admin_user = $this->drupalCreateUser([ + 'synchronize configuration', + 'access content', + 'access administration pages', + 'administer site configuration', + 'administer content types', + 'administer nodes', + 'bypass node access', + 'administer node fields', + 'administer node display', + ]); $this->drupalLogin($admin_user); } diff --git a/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php b/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php index 5902682c03..7b3ac433d0 100644 --- a/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php +++ b/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php @@ -19,7 +19,14 @@ class OptionsWidgetsTest extends FieldTestBase { * * @var array */ - public static $modules = ['node', 'options', 'entity_test', 'options_test', 'taxonomy', 'field_ui']; + public static $modules = [ + 'node', + 'options', + 'entity_test', + 'options_test', + 'taxonomy', + 'field_ui', + ]; /** * {@inheritdoc} diff --git a/core/modules/options/tests/src/Kernel/Views/OptionsTestBase.php b/core/modules/options/tests/src/Kernel/Views/OptionsTestBase.php index 9f53e63313..7a3237a01a 100644 --- a/core/modules/options/tests/src/Kernel/Views/OptionsTestBase.php +++ b/core/modules/options/tests/src/Kernel/Views/OptionsTestBase.php @@ -19,7 +19,13 @@ * * @var array */ - public static $modules = ['options', 'options_test_views', 'node', 'user', 'field']; + public static $modules = [ + 'options', + 'options_test_views', + 'node', + 'user', + 'field', + ]; /** * Stores the nodes used for the different tests. diff --git a/core/modules/path/tests/src/Functional/PathAdminTest.php b/core/modules/path/tests/src/Functional/PathAdminTest.php index 2ac11efa6a..dbf4154d51 100644 --- a/core/modules/path/tests/src/Functional/PathAdminTest.php +++ b/core/modules/path/tests/src/Functional/PathAdminTest.php @@ -25,7 +25,12 @@ protected function setUp() { parent::setUp(); // Create test user and log in. - $web_user = $this->drupalCreateUser(['create page content', 'edit own page content', 'administer url aliases', 'create url aliases']); + $web_user = $this->drupalCreateUser([ + 'create page content', + 'edit own page content', + 'administer url aliases', + 'create url aliases', + ]); $this->drupalLogin($web_user); } diff --git a/core/modules/path/tests/src/Functional/PathAliasTest.php b/core/modules/path/tests/src/Functional/PathAliasTest.php index 0ef6b99304..0eafb8fac2 100644 --- a/core/modules/path/tests/src/Functional/PathAliasTest.php +++ b/core/modules/path/tests/src/Functional/PathAliasTest.php @@ -30,7 +30,13 @@ protected function setUp() { parent::setUp(); // Create test user and log in. - $web_user = $this->drupalCreateUser(['create page content', 'edit own page content', 'administer url aliases', 'create url aliases', 'access content overview']); + $web_user = $this->drupalCreateUser([ + 'create page content', + 'edit own page content', + 'administer url aliases', + 'create url aliases', + 'access content overview', + ]); $this->drupalLogin($web_user); } diff --git a/core/modules/path/tests/src/Functional/PathLanguageTest.php b/core/modules/path/tests/src/Functional/PathLanguageTest.php index a5982e15d8..4b2a47f18c 100644 --- a/core/modules/path/tests/src/Functional/PathLanguageTest.php +++ b/core/modules/path/tests/src/Functional/PathLanguageTest.php @@ -14,7 +14,12 @@ class PathLanguageTest extends PathTestBase { * * @var array */ - public static $modules = ['path', 'locale', 'locale_test', 'content_translation']; + public static $modules = [ + 'path', + 'locale', + 'locale_test', + 'content_translation', + ]; /** * {@inheritdoc} diff --git a/core/modules/path/tests/src/Functional/PathLanguageUiTest.php b/core/modules/path/tests/src/Functional/PathLanguageUiTest.php index 6ab6e2c22c..34268d41c9 100644 --- a/core/modules/path/tests/src/Functional/PathLanguageUiTest.php +++ b/core/modules/path/tests/src/Functional/PathLanguageUiTest.php @@ -27,7 +27,14 @@ protected function setUp() { parent::setUp(); // Create and log in user. - $web_user = $this->drupalCreateUser(['edit any page content', 'create page content', 'administer url aliases', 'create url aliases', 'administer languages', 'access administration pages']); + $web_user = $this->drupalCreateUser([ + 'edit any page content', + 'create page content', + 'administer url aliases', + 'create url aliases', + 'administer languages', + 'access administration pages', + ]); $this->drupalLogin($web_user); // Enable French language. diff --git a/core/modules/path/tests/src/Functional/PathTaxonomyTermTest.php b/core/modules/path/tests/src/Functional/PathTaxonomyTermTest.php index 1db6bb1885..7c0ae3aeac 100644 --- a/core/modules/path/tests/src/Functional/PathTaxonomyTermTest.php +++ b/core/modules/path/tests/src/Functional/PathTaxonomyTermTest.php @@ -35,7 +35,11 @@ protected function setUp() { $vocabulary->save(); // Create and log in user. - $web_user = $this->drupalCreateUser(['administer url aliases', 'administer taxonomy', 'access administration pages']); + $web_user = $this->drupalCreateUser([ + 'administer url aliases', + 'administer taxonomy', + 'access administration pages', + ]); $this->drupalLogin($web_user); } diff --git a/core/modules/path/tests/src/Kernel/PathItemTest.php b/core/modules/path/tests/src/Kernel/PathItemTest.php index 240b6cf54a..b51dc05e40 100644 --- a/core/modules/path/tests/src/Kernel/PathItemTest.php +++ b/core/modules/path/tests/src/Kernel/PathItemTest.php @@ -19,7 +19,15 @@ class PathItemTest extends KernelTestBase { * * @var array */ - public static $modules = ['path', 'path_alias', 'node', 'user', 'system', 'language', 'content_translation']; + public static $modules = [ + 'path', + 'path_alias', + 'node', + 'user', + 'system', + 'language', + 'content_translation', + ]; /** * {@inheritdoc} diff --git a/core/modules/path/tests/src/Kernel/PathNoCanonicalLinkTest.php b/core/modules/path/tests/src/Kernel/PathNoCanonicalLinkTest.php index 773b792f38..b61d89a1e2 100644 --- a/core/modules/path/tests/src/Kernel/PathNoCanonicalLinkTest.php +++ b/core/modules/path/tests/src/Kernel/PathNoCanonicalLinkTest.php @@ -18,7 +18,14 @@ class PathNoCanonicalLinkTest extends KernelTestBase { * * @var array */ - public static $modules = ['path', 'content_translation_test', 'language', 'entity_test', 'user', 'system']; + public static $modules = [ + 'path', + 'content_translation_test', + 'language', + 'entity_test', + 'user', + 'system', + ]; protected function setUp() { parent::setUp(); diff --git a/core/modules/path_alias/src/PathAliasStorageSchema.php b/core/modules/path_alias/src/PathAliasStorageSchema.php index 53acc85c72..52f6c0ed7c 100644 --- a/core/modules/path_alias/src/PathAliasStorageSchema.php +++ b/core/modules/path_alias/src/PathAliasStorageSchema.php @@ -17,8 +17,18 @@ protected function getEntitySchema(ContentEntityTypeInterface $entity_type, $res $schema = parent::getEntitySchema($entity_type, $reset); $schema[$this->storage->getBaseTable()]['indexes'] += [ - 'path_alias__alias_langcode_id_status' => ['alias', 'langcode', 'id', 'status'], - 'path_alias__path_langcode_id_status' => ['path', 'langcode', 'id', 'status'], + 'path_alias__alias_langcode_id_status' => [ + 'alias', + 'langcode', + 'id', + 'status', + ], + 'path_alias__path_langcode_id_status' => [ + 'path', + 'langcode', + 'id', + 'status', + ], ]; return $schema; diff --git a/core/modules/quickedit/tests/src/Kernel/QuickEditTestBase.php b/core/modules/quickedit/tests/src/Kernel/QuickEditTestBase.php index 127ab62d85..91dd46f082 100644 --- a/core/modules/quickedit/tests/src/Kernel/QuickEditTestBase.php +++ b/core/modules/quickedit/tests/src/Kernel/QuickEditTestBase.php @@ -16,7 +16,16 @@ * * @var array */ - public static $modules = ['system', 'entity_test', 'field', 'field_test', 'filter', 'user', 'text', 'quickedit']; + public static $modules = [ + 'system', + 'entity_test', + 'field', + 'field_test', + 'filter', + 'user', + 'text', + 'quickedit', + ]; /** * Bag of created fields. diff --git a/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php b/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php index 2e94a1da9b..79bcededae 100644 --- a/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php +++ b/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php @@ -40,7 +40,11 @@ class ResponsiveImageFieldDisplayTest extends ImageFieldTestBase { * * @var array */ - public static $modules = ['field_ui', 'responsive_image', 'responsive_image_test_module']; + public static $modules = [ + 'field_ui', + 'responsive_image', + 'responsive_image_test_module', + ]; /** * Drupal\simpletest\WebTestBase\setUp(). diff --git a/core/modules/responsive_image/tests/src/Kernel/ResponsiveImageIntegrationTest.php b/core/modules/responsive_image/tests/src/Kernel/ResponsiveImageIntegrationTest.php index b77edd8cc1..a4200099d9 100644 --- a/core/modules/responsive_image/tests/src/Kernel/ResponsiveImageIntegrationTest.php +++ b/core/modules/responsive_image/tests/src/Kernel/ResponsiveImageIntegrationTest.php @@ -18,7 +18,16 @@ class ResponsiveImageIntegrationTest extends KernelTestBase { /** * {@inheritdoc} */ - public static $modules = ['responsive_image', 'field', 'image', 'file', 'entity_test', 'breakpoint', 'responsive_image_test_module', 'user']; + public static $modules = [ + 'responsive_image', + 'field', + 'image', + 'file', + 'entity_test', + 'breakpoint', + 'responsive_image_test_module', + 'user', + ]; /** * {@inheritdoc} diff --git a/core/modules/responsive_image/tests/src/Unit/ResponsiveImageStyleConfigEntityUnitTest.php b/core/modules/responsive_image/tests/src/Unit/ResponsiveImageStyleConfigEntityUnitTest.php index 8091ad32f8..0433d99885 100644 --- a/core/modules/responsive_image/tests/src/Unit/ResponsiveImageStyleConfigEntityUnitTest.php +++ b/core/modules/responsive_image/tests/src/Unit/ResponsiveImageStyleConfigEntityUnitTest.php @@ -113,7 +113,12 @@ public function testCalculateDependencies() { $dependencies = $entity->calculateDependencies()->getDependencies(); $this->assertEquals(['toolbar'], $dependencies['module']); $this->assertEquals(['bartik'], $dependencies['theme']); - $this->assertEquals(['image.style.fallback', 'image.style.large', 'image.style.medium', 'image.style.small'], $dependencies['config']); + $this->assertEquals([ + 'image.style.fallback', + 'image.style.large', + 'image.style.medium', + 'image.style.small', + ], $dependencies['config']); } /** diff --git a/core/modules/rest/src/Plugin/views/row/DataFieldRow.php b/core/modules/rest/src/Plugin/views/row/DataFieldRow.php index 9b9e28573e..e3d8b5c7d8 100644 --- a/core/modules/rest/src/Plugin/views/row/DataFieldRow.php +++ b/core/modules/rest/src/Plugin/views/row/DataFieldRow.php @@ -74,7 +74,11 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { $form['field_options'] = [ '#type' => 'table', - '#header' => [$this->t('Field'), $this->t('Alias'), $this->t('Raw output')], + '#header' => [ + $this->t('Field'), + $this->t('Alias'), + $this->t('Raw output'), + ], '#empty' => $this->t('You have no fields. Add some to your view.'), '#tree' => TRUE, ]; diff --git a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php index bbb54156f5..e8dd6b8e02 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php @@ -618,7 +618,14 @@ public function testGet() { // 'Vary' headers are also added to the list of headers to ignore, as they // may be added to GET requests, depending on web server configuration. They // are usually 'Transfer-Encoding: chunked' and 'Vary: Accept-Encoding'. - $ignored_headers = ['Date', 'Content-Length', 'X-Drupal-Cache', 'X-Drupal-Dynamic-Cache', 'Transfer-Encoding', 'Vary']; + $ignored_headers = [ + 'Date', + 'Content-Length', + 'X-Drupal-Cache', + 'X-Drupal-Dynamic-Cache', + 'Transfer-Encoding', + 'Vary', + ]; $header_cleaner = function ($headers) use ($ignored_headers) { foreach ($headers as $header => $value) { if (strpos($header, 'X-Drupal-Assertion-') === 0 || in_array($header, $ignored_headers)) { @@ -1114,7 +1121,11 @@ public function testPatch() { $request_options[RequestOptions::BODY] = $this->serializer->encode($normalization_add_items, static::$format); $response = $this->request('PATCH', $url, $request_options); $this->assertResourceResponse(200, FALSE, $response); - $this->assertSame([0 => ['value' => 'One'], 1 => ['value' => 'Two'], 2 => ['value' => 'Three']], $this->entityStorage->loadUnchanged($this->entity->id())->get('field_rest_test_multivalue')->getValue()); + $this->assertSame([ + 0 => ['value' => 'One'], + 1 => ['value' => 'Two'], + 2 => ['value' => 'Three'], + ], $this->entityStorage->loadUnchanged($this->entity->id())->get('field_rest_test_multivalue')->getValue()); } /** diff --git a/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php b/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php index 094d8797a6..08a713c2b0 100644 --- a/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php +++ b/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php @@ -36,7 +36,17 @@ class StyleSerializerTest extends ViewTestBase { * * @var array */ - public static $modules = ['views_ui', 'entity_test', 'hal', 'rest_test_views', 'node', 'text', 'field', 'language', 'basic_auth']; + public static $modules = [ + 'views_ui', + 'entity_test', + 'hal', + 'rest_test_views', + 'node', + 'text', + 'field', + 'language', + 'basic_auth', + ]; /** * {@inheritdoc} @@ -48,7 +58,14 @@ class StyleSerializerTest extends ViewTestBase { * * @var array */ - public static $testViews = ['test_serializer_display_field', 'test_serializer_display_entity', 'test_serializer_display_entity_translated', 'test_serializer_node_display_field', 'test_serializer_node_exposed_filter', 'test_serializer_shared_path']; + public static $testViews = [ + 'test_serializer_display_field', + 'test_serializer_display_entity', + 'test_serializer_display_entity_translated', + 'test_serializer_node_display_field', + 'test_serializer_node_exposed_filter', + 'test_serializer_shared_path', + ]; /** * A user with administrative privileges to look at test entity and configure views. @@ -67,11 +84,19 @@ protected function setUp($import_test_views = TRUE) { ViewTestData::createTestViews(get_class($this), ['rest_test_views']); - $this->adminUser = $this->drupalCreateUser(['administer views', 'administer entity_test content', 'access user profiles', 'view test entity']); + $this->adminUser = $this->drupalCreateUser([ + 'administer views', + 'administer entity_test content', + 'access user profiles', + 'view test entity', + ]); // Save some entity_test entities. for ($i = 1; $i <= 10; $i++) { - EntityTest::create(['name' => 'test_' . $i, 'user_id' => $this->adminUser->id()])->save(); + EntityTest::create([ + 'name' => 'test_' . $i, + 'user_id' => $this->adminUser->id(), + ])->save(); } $this->enableViewsTestModule(); @@ -121,7 +146,11 @@ public function testSerializerResponses() { $actual_json = $this->drupalGet('test/serialize/field', ['query' => ['_format' => 'json']]); $this->assertResponse(200); $this->assertCacheTags($view->getCacheTags()); - $this->assertCacheContexts(['languages:language_interface', 'theme', 'request_format']); + $this->assertCacheContexts([ + 'languages:language_interface', + 'theme', + 'request_format', + ]); // @todo Due to https://www.drupal.org/node/2352009 we can't yet test the // propagation of cache max-age. @@ -199,7 +228,12 @@ public function testSerializerResponses() { $expected = $serializer->serialize($entities, 'xml'); $actual_xml = $this->drupalGet('test/serialize/entity', ['query' => ['_format' => 'xml']]); $this->assertSame(trim($expected), $actual_xml); - $this->assertCacheContexts(['languages:language_interface', 'theme', 'entity_test_view_grants', 'request_format']); + $this->assertCacheContexts([ + 'languages:language_interface', + 'theme', + 'entity_test_view_grants', + 'request_format', + ]); // Allow multiple formats. $view->setDisplay('rest_export_1'); @@ -472,14 +506,20 @@ public function testUIFieldAlias() { 'created' => 'created', ]; - $edit = ['row_options[field_options][name][alias]' => $alias_map['name'], 'row_options[field_options][nothing][alias]' => $alias_map['nothing']]; + $edit = [ + 'row_options[field_options][name][alias]' => $alias_map['name'], + 'row_options[field_options][nothing][alias]' => $alias_map['nothing'], + ]; $this->drupalPostForm($row_options, $edit, t('Apply')); $this->assertText(t('The machine-readable name must contain only letters, numbers, dashes and underscores.')); // Change the map alias value to a valid one. $alias_map['nothing'] = $this->randomMachineName(); - $edit = ['row_options[field_options][name][alias]' => $alias_map['name'], 'row_options[field_options][nothing][alias]' => $alias_map['nothing']]; + $edit = [ + 'row_options[field_options][name][alias]' => $alias_map['name'], + 'row_options[field_options][nothing][alias]' => $alias_map['nothing'], + ]; $this->drupalPostForm($row_options, $edit, t('Apply')); $this->drupalPostForm(NULL, [], t('Save')); diff --git a/core/modules/rest/tests/src/Kernel/Entity/RestResourceConfigTest.php b/core/modules/rest/tests/src/Kernel/Entity/RestResourceConfigTest.php index 89e9b1dec5..356ba5e2b5 100644 --- a/core/modules/rest/tests/src/Kernel/Entity/RestResourceConfigTest.php +++ b/core/modules/rest/tests/src/Kernel/Entity/RestResourceConfigTest.php @@ -16,7 +16,14 @@ class RestResourceConfigTest extends KernelTestBase { /** * {@inheritdoc} */ - public static $modules = ['rest', 'entity_test', 'serialization', 'basic_auth', 'user', 'hal']; + public static $modules = [ + 'rest', + 'entity_test', + 'serialization', + 'basic_auth', + 'user', + 'hal', + ]; /** * @covers ::calculateDependencies @@ -38,7 +45,15 @@ public function testCalculateDependencies() { ]); $rest_config->calculateDependencies(); - $this->assertEquals(['module' => ['basic_auth', 'entity_test', 'hal', 'serialization', 'user']], $rest_config->getDependencies()); + $this->assertEquals([ + 'module' => [ + 'basic_auth', + 'entity_test', + 'hal', + 'serialization', + 'user', + ], + ], $rest_config->getDependencies()); } } diff --git a/core/modules/rest/tests/src/Kernel/Views/RestExportTest.php b/core/modules/rest/tests/src/Kernel/Views/RestExportTest.php index 5246e484ae..1aef642544 100644 --- a/core/modules/rest/tests/src/Kernel/Views/RestExportTest.php +++ b/core/modules/rest/tests/src/Kernel/Views/RestExportTest.php @@ -24,7 +24,12 @@ class RestExportTest extends ViewsKernelTestBase { /** * {@inheritdoc} */ - public static $modules = ['rest_test_views', 'serialization', 'rest', 'entity_test']; + public static $modules = [ + 'rest_test_views', + 'serialization', + 'rest', + 'entity_test', + ]; /** * {@inheritdoc} diff --git a/core/modules/rest/tests/src/Unit/EntityResourceValidationTraitTest.php b/core/modules/rest/tests/src/Unit/EntityResourceValidationTraitTest.php index 972b00c39e..76af9db93e 100644 --- a/core/modules/rest/tests/src/Unit/EntityResourceValidationTraitTest.php +++ b/core/modules/rest/tests/src/Unit/EntityResourceValidationTraitTest.php @@ -50,8 +50,10 @@ public function testFailedValidate() { $entity = $this->prophesize(User::class); $violations = $this->getMockBuilder(EntityConstraintViolationList::class) - ->setConstructorArgs([$entity->reveal(), [$violation1->reveal(), $violation2->reveal()]]) - ->setMethods(['filterByFieldAccess']) + ->setConstructorArgs([ + $entity->reveal(), + [$violation1->reveal(), $violation2->reveal()], + ])->setMethods(['filterByFieldAccess']) ->getMock(); $violations->expects($this->once()) diff --git a/core/modules/search/src/Plugin/SearchPluginBase.php b/core/modules/search/src/Plugin/SearchPluginBase.php index 7312df49fc..1e46b1900b 100644 --- a/core/modules/search/src/Plugin/SearchPluginBase.php +++ b/core/modules/search/src/Plugin/SearchPluginBase.php @@ -123,7 +123,9 @@ public function suggestedTitle() { // If the user entered a search string, truncate it and append it to the // title. if (!empty($this->keywords)) { - return $this->t('Search for @keywords', ['@keywords' => Unicode::truncate($this->keywords, 60, TRUE, TRUE)]); + return $this->t('Search for @keywords', [ + '@keywords' => Unicode::truncate($this->keywords, 60, TRUE, TRUE), + ]); } // Use the default 'Search' title. return $this->t('Search'); diff --git a/core/modules/search/tests/src/Functional/SearchAdvancedSearchFormTest.php b/core/modules/search/tests/src/Functional/SearchAdvancedSearchFormTest.php index 099663ed59..9907445d80 100644 --- a/core/modules/search/tests/src/Functional/SearchAdvancedSearchFormTest.php +++ b/core/modules/search/tests/src/Functional/SearchAdvancedSearchFormTest.php @@ -35,7 +35,12 @@ protected function setUp() { $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']); // Create and log in user. - $test_user = $this->drupalCreateUser(['access content', 'search content', 'use advanced search', 'administer nodes']); + $test_user = $this->drupalCreateUser([ + 'access content', + 'search content', + 'use advanced search', + 'administer nodes', + ]); $this->drupalLogin($test_user); // Create initial node. diff --git a/core/modules/search/tests/src/Functional/SearchCommentCountToggleTest.php b/core/modules/search/tests/src/Functional/SearchCommentCountToggleTest.php index 03520359ad..a6fcd2b274 100644 --- a/core/modules/search/tests/src/Functional/SearchCommentCountToggleTest.php +++ b/core/modules/search/tests/src/Functional/SearchCommentCountToggleTest.php @@ -52,7 +52,13 @@ protected function setUp() { $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']); // Create searching user. - $this->searchingUser = $this->drupalCreateUser(['search content', 'access content', 'access comments', 'post comments', 'skip comment approval']); + $this->searchingUser = $this->drupalCreateUser([ + 'search content', + 'access content', + 'access comments', + 'post comments', + 'skip comment approval', + ]); // Log in with sufficient privileges. $this->drupalLogin($this->searchingUser); diff --git a/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php b/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php index e00eab9f8e..fe0be6026e 100644 --- a/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php +++ b/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php @@ -18,7 +18,14 @@ class SearchConfigSettingsFormTest extends BrowserTestBase { /** * {@inheritdoc} */ - protected static $modules = ['block', 'dblog', 'node', 'search', 'search_extra_type', 'test_page_test']; + protected static $modules = [ + 'block', + 'dblog', + 'node', + 'search', + 'search_extra_type', + 'test_page_test', + ]; /** * {@inheritdoc} @@ -45,7 +52,16 @@ protected function setUp() { $this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']); // Log in as a user that can create and search content. - $this->searchUser = $this->drupalCreateUser(['search content', 'administer search', 'administer nodes', 'bypass node access', 'access user profiles', 'administer users', 'administer blocks', 'access site reports']); + $this->searchUser = $this->drupalCreateUser([ + 'search content', + 'administer search', + 'administer nodes', + 'bypass node access', + 'access user profiles', + 'administer users', + 'administer blocks', + 'access site reports', + ]); $this->drupalLogin($this->searchUser); // Add a single piece of content and index it. diff --git a/core/modules/search/tests/src/Functional/SearchDateIntervalTest.php b/core/modules/search/tests/src/Functional/SearchDateIntervalTest.php index 22c19b9fd8..9b5cb9cef4 100644 --- a/core/modules/search/tests/src/Functional/SearchDateIntervalTest.php +++ b/core/modules/search/tests/src/Functional/SearchDateIntervalTest.php @@ -15,7 +15,12 @@ class SearchDateIntervalTest extends BrowserTestBase { /** * {@inheritdoc} */ - protected static $modules = ['language', 'search_date_query_alter', 'node', 'search']; + protected static $modules = [ + 'language', + 'search_date_query_alter', + 'node', + 'search', + ]; /** * {@inheritdoc} @@ -28,7 +33,15 @@ protected function setUp() { $this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']); // Create and log in user. - $test_user = $this->drupalCreateUser(['access content', 'search content', 'use advanced search', 'administer nodes', 'administer languages', 'access administration pages', 'administer site configuration']); + $test_user = $this->drupalCreateUser([ + 'access content', + 'search content', + 'use advanced search', + 'administer nodes', + 'administer languages', + 'access administration pages', + 'administer site configuration', + ]); $this->drupalLogin($test_user); // Add a new language. diff --git a/core/modules/search/tests/src/Functional/SearchEmbedFormTest.php b/core/modules/search/tests/src/Functional/SearchEmbedFormTest.php index 80033b4de7..ad2d385048 100644 --- a/core/modules/search/tests/src/Functional/SearchEmbedFormTest.php +++ b/core/modules/search/tests/src/Functional/SearchEmbedFormTest.php @@ -41,7 +41,11 @@ protected function setUp() { $this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']); // Create a user and a node, and update the search index. - $test_user = $this->drupalCreateUser(['access content', 'search content', 'administer nodes']); + $test_user = $this->drupalCreateUser([ + 'access content', + 'search content', + 'administer nodes', + ]); $this->drupalLogin($test_user); $this->node = $this->drupalCreateNode(); diff --git a/core/modules/search/tests/src/Functional/SearchKeywordsConditionsTest.php b/core/modules/search/tests/src/Functional/SearchKeywordsConditionsTest.php index 38faa34e55..35a4428e20 100644 --- a/core/modules/search/tests/src/Functional/SearchKeywordsConditionsTest.php +++ b/core/modules/search/tests/src/Functional/SearchKeywordsConditionsTest.php @@ -19,7 +19,12 @@ class SearchKeywordsConditionsTest extends BrowserTestBase { /** * {@inheritdoc} */ - protected static $modules = ['comment', 'search', 'search_extra_type', 'test_page_test']; + protected static $modules = [ + 'comment', + 'search', + 'search_extra_type', + 'test_page_test', + ]; /** * {@inheritdoc} @@ -37,7 +42,12 @@ protected function setUp() { parent::setUp(); // Create searching user. - $this->searchingUser = $this->drupalCreateUser(['search content', 'access content', 'access comments', 'skip comment approval']); + $this->searchingUser = $this->drupalCreateUser([ + 'search content', + 'access content', + 'access comments', + 'skip comment approval', + ]); // Log in with sufficient privileges. $this->drupalLogin($this->searchingUser); } diff --git a/core/modules/search/tests/src/Functional/SearchLanguageTest.php b/core/modules/search/tests/src/Functional/SearchLanguageTest.php index 539fac67ff..0024f7e45f 100644 --- a/core/modules/search/tests/src/Functional/SearchLanguageTest.php +++ b/core/modules/search/tests/src/Functional/SearchLanguageTest.php @@ -37,7 +37,15 @@ protected function setUp() { $this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']); // Create and log in user. - $test_user = $this->drupalCreateUser(['access content', 'search content', 'use advanced search', 'administer nodes', 'administer languages', 'access administration pages', 'administer site configuration']); + $test_user = $this->drupalCreateUser([ + 'access content', + 'search content', + 'use advanced search', + 'administer nodes', + 'administer languages', + 'access administration pages', + 'administer site configuration', + ]); $this->drupalLogin($test_user); // Add a new language. diff --git a/core/modules/search/tests/src/Functional/SearchMultilingualEntityTest.php b/core/modules/search/tests/src/Functional/SearchMultilingualEntityTest.php index 4377ef0b75..9d60048446 100644 --- a/core/modules/search/tests/src/Functional/SearchMultilingualEntityTest.php +++ b/core/modules/search/tests/src/Functional/SearchMultilingualEntityTest.php @@ -32,7 +32,13 @@ class SearchMultilingualEntityTest extends BrowserTestBase { /** * {@inheritdoc} */ - protected static $modules = ['language', 'locale', 'comment', 'node', 'search']; + protected static $modules = [ + 'language', + 'locale', + 'comment', + 'node', + 'search', + ]; /** * {@inheritdoc} @@ -46,7 +52,14 @@ protected function setUp() { // Create a user who can administer search, do searches, see the status // report, and administer cron. Log in. - $user = $this->drupalCreateUser(['administer search', 'search content', 'use advanced search', 'access content', 'access site reports', 'administer site configuration']); + $user = $this->drupalCreateUser([ + 'administer search', + 'search content', + 'use advanced search', + 'access content', + 'access site reports', + 'administer site configuration', + ]); $this->drupalLogin($user); // Set up the search plugin. diff --git a/core/modules/search/tests/src/Functional/SearchNodeDiacriticsTest.php b/core/modules/search/tests/src/Functional/SearchNodeDiacriticsTest.php index 2e7150d8d2..e9751cb0f9 100644 --- a/core/modules/search/tests/src/Functional/SearchNodeDiacriticsTest.php +++ b/core/modules/search/tests/src/Functional/SearchNodeDiacriticsTest.php @@ -36,7 +36,12 @@ protected function setUp() { node_access_rebuild(); // Create a test user and log in. - $this->testUser = $this->drupalCreateUser(['access content', 'search content', 'use advanced search', 'access user profiles']); + $this->testUser = $this->drupalCreateUser([ + 'access content', + 'search content', + 'use advanced search', + 'access user profiles', + ]); $this->drupalLogin($this->testUser); } diff --git a/core/modules/search/tests/src/Functional/SearchNodePunctuationTest.php b/core/modules/search/tests/src/Functional/SearchNodePunctuationTest.php index 02945562a7..6b3abf62b7 100644 --- a/core/modules/search/tests/src/Functional/SearchNodePunctuationTest.php +++ b/core/modules/search/tests/src/Functional/SearchNodePunctuationTest.php @@ -35,7 +35,12 @@ protected function setUp() { node_access_rebuild(); // Create a test user and log in. - $this->testUser = $this->drupalCreateUser(['access content', 'search content', 'use advanced search', 'access user profiles']); + $this->testUser = $this->drupalCreateUser([ + 'access content', + 'search content', + 'use advanced search', + 'access user profiles', + ]); $this->drupalLogin($this->testUser); } diff --git a/core/modules/search/tests/src/Functional/SearchNumberMatchingTest.php b/core/modules/search/tests/src/Functional/SearchNumberMatchingTest.php index 8888b4ddc5..f25afa3d73 100644 --- a/core/modules/search/tests/src/Functional/SearchNumberMatchingTest.php +++ b/core/modules/search/tests/src/Functional/SearchNumberMatchingTest.php @@ -65,7 +65,12 @@ protected function setUp() { $this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']); - $this->testUser = $this->drupalCreateUser(['search content', 'access content', 'administer nodes', 'access site reports']); + $this->testUser = $this->drupalCreateUser([ + 'search content', + 'access content', + 'administer nodes', + 'access site reports', + ]); $this->drupalLogin($this->testUser); foreach ($this->numbers as $num) { diff --git a/core/modules/search/tests/src/Functional/SearchNumbersTest.php b/core/modules/search/tests/src/Functional/SearchNumbersTest.php index 43dd788d17..f65e12e0f0 100644 --- a/core/modules/search/tests/src/Functional/SearchNumbersTest.php +++ b/core/modules/search/tests/src/Functional/SearchNumbersTest.php @@ -71,7 +71,12 @@ protected function setUp() { $this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']); - $this->testUser = $this->drupalCreateUser(['search content', 'access content', 'administer nodes', 'access site reports']); + $this->testUser = $this->drupalCreateUser([ + 'search content', + 'access content', + 'administer nodes', + 'access site reports', + ]); $this->drupalLogin($this->testUser); foreach ($this->numbers as $doc => $num) { diff --git a/core/modules/search/tests/src/Functional/SearchPageTextTest.php b/core/modules/search/tests/src/Functional/SearchPageTextTest.php index 148b4372ce..1933884354 100644 --- a/core/modules/search/tests/src/Functional/SearchPageTextTest.php +++ b/core/modules/search/tests/src/Functional/SearchPageTextTest.php @@ -39,7 +39,11 @@ protected function setUp() { $this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']); // Create user. - $this->searchingUser = $this->drupalCreateUser(['search content', 'access user profiles', 'use advanced search']); + $this->searchingUser = $this->drupalCreateUser([ + 'search content', + 'access user profiles', + 'use advanced search', + ]); $this->drupalPlaceBlock('local_tasks_block'); $this->drupalPlaceBlock('page_title_block'); } diff --git a/core/modules/search/tests/src/Functional/SearchRankingTest.php b/core/modules/search/tests/src/Functional/SearchRankingTest.php index 884359b3d0..ffab55b2e0 100644 --- a/core/modules/search/tests/src/Functional/SearchRankingTest.php +++ b/core/modules/search/tests/src/Functional/SearchRankingTest.php @@ -49,7 +49,12 @@ protected function setUp() { $this->nodeSearch = SearchPage::load('node_search'); // Log in with sufficient privileges. - $this->drupalLogin($this->drupalCreateUser(['post comments', 'skip comment approval', 'create page content', 'administer search'])); + $this->drupalLogin($this->drupalCreateUser([ + 'post comments', + 'skip comment approval', + 'create page content', + 'administer search', + ])); } public function testRankings() { @@ -57,7 +62,14 @@ public function testRankings() { $this->addDefaultCommentField('node', 'page'); // Build a list of the rankings to test. - $node_ranks = ['sticky', 'promote', 'relevance', 'recent', 'comments', 'views']; + $node_ranks = [ + 'sticky', + 'promote', + 'relevance', + 'recent', + 'comments', + 'views', + ]; // Create nodes for testing. $nodes = []; @@ -113,8 +125,12 @@ public function testRankings() { // counter for this node. $nid = $nodes['views'][1]->id(); Database::getConnection()->insert('node_counter') - ->fields(['totalcount' => 5, 'daycount' => 5, 'timestamp' => REQUEST_TIME, 'nid' => $nid]) - ->execute(); + ->fields([ + 'totalcount' => 5, + 'daycount' => 5, + 'timestamp' => REQUEST_TIME, + 'nid' => $nid, + ])->execute(); // Run cron to update the search index and comment/statistics totals. $this->cronRun(); diff --git a/core/modules/search/tests/src/Functional/SearchSimplifyTest.php b/core/modules/search/tests/src/Functional/SearchSimplifyTest.php index 127539ef74..84b1178ab7 100644 --- a/core/modules/search/tests/src/Functional/SearchSimplifyTest.php +++ b/core/modules/search/tests/src/Functional/SearchSimplifyTest.php @@ -78,10 +78,26 @@ public function testSearchSimplifyUnicode() { */ public function testSearchSimplifyPunctuation() { $cases = [ - ['20.03/94-28,876', '20039428876', 'Punctuation removed from numbers'], - ['great...drupal--module', 'great drupal module', 'Multiple dot and dashes are word boundaries'], - ['very_great-drupal.module', 'verygreatdrupalmodule', 'Single dot, dash, underscore are removed'], - ['regular,punctuation;word', 'regular punctuation word', 'Punctuation is a word boundary'], + [ + '20.03/94-28,876', + '20039428876', + 'Punctuation removed from numbers', + ], + [ + 'great...drupal--module', + 'great drupal module', + 'Multiple dot and dashes are word boundaries', + ], + [ + 'very_great-drupal.module', + 'verygreatdrupalmodule', + 'Single dot, dash, underscore are removed', + ], + [ + 'regular,punctuation;word', + 'regular punctuation word', + 'Punctuation is a word boundary', + ], ]; foreach ($cases as $case) { diff --git a/core/modules/search/tests/src/Kernel/SearchMatchTest.php b/core/modules/search/tests/src/Kernel/SearchMatchTest.php index f0de1ec8c0..14062b9551 100644 --- a/core/modules/search/tests/src/Kernel/SearchMatchTest.php +++ b/core/modules/search/tests/src/Kernel/SearchMatchTest.php @@ -32,7 +32,11 @@ class SearchMatchTest extends KernelTestBase { */ protected function setUp() { parent::setUp(); - $this->installSchema('search', ['search_index', 'search_dataset', 'search_total']); + $this->installSchema('search', [ + 'search_index', + 'search_dataset', + 'search_total', + ]); $this->installConfig(['search']); } diff --git a/core/modules/search/tests/src/Unit/SearchPageRepositoryTest.php b/core/modules/search/tests/src/Unit/SearchPageRepositoryTest.php index be8cbfc293..42926467b8 100644 --- a/core/modules/search/tests/src/Unit/SearchPageRepositoryTest.php +++ b/core/modules/search/tests/src/Unit/SearchPageRepositoryTest.php @@ -261,10 +261,26 @@ public function testSortSearchPages() { // Declare entities out of their expected order so we can be sure they were // sorted. We cannot mock these because of uasort(), see // https://bugs.php.net/bug.php?id=50688. - $unsorted_entities['test4'] = new TestSearchPage(['weight' => 0, 'status' => FALSE, 'label' => 'Test4']); - $unsorted_entities['test3'] = new TestSearchPage(['weight' => 10, 'status' => TRUE, 'label' => 'Test3']); - $unsorted_entities['test2'] = new TestSearchPage(['weight' => 0, 'status' => TRUE, 'label' => 'Test2']); - $unsorted_entities['test1'] = new TestSearchPage(['weight' => 0, 'status' => TRUE, 'label' => 'Test1']); + $unsorted_entities['test4'] = new TestSearchPage([ + 'weight' => 0, + 'status' => FALSE, + 'label' => 'Test4', + ]); + $unsorted_entities['test3'] = new TestSearchPage([ + 'weight' => 10, + 'status' => TRUE, + 'label' => 'Test3', + ]); + $unsorted_entities['test2'] = new TestSearchPage([ + 'weight' => 0, + 'status' => TRUE, + 'label' => 'Test2', + ]); + $unsorted_entities['test1'] = new TestSearchPage([ + 'weight' => 0, + 'status' => TRUE, + 'label' => 'Test1', + ]); $expected = $unsorted_entities; ksort($expected); diff --git a/core/modules/serialization/src/Normalizer/TimestampItemNormalizer.php b/core/modules/serialization/src/Normalizer/TimestampItemNormalizer.php index 1669e6a780..6118f373b1 100644 --- a/core/modules/serialization/src/Normalizer/TimestampItemNormalizer.php +++ b/core/modules/serialization/src/Normalizer/TimestampItemNormalizer.php @@ -39,7 +39,9 @@ protected function constructValue($data, $context) { if (!empty($data['format'])) { $context['datetime_allowed_formats'] = [$data['format']]; } - return ['value' => $this->serializer->denormalize($data['value'], Timestamp::class, NULL, $context)]; + return [ + 'value' => $this->serializer->denormalize($data['value'], Timestamp::class, NULL, $context), + ]; } } diff --git a/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php b/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php index 2594852624..4f1e83b242 100644 --- a/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php +++ b/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php @@ -21,7 +21,16 @@ class EntitySerializationTest extends NormalizerTestBase { * * @var array */ - public static $modules = ['serialization', 'system', 'field', 'entity_test', 'text', 'filter', 'user', 'entity_serialization_test']; + public static $modules = [ + 'serialization', + 'system', + 'field', + 'entity_test', + 'text', + 'filter', + 'user', + 'entity_serialization_test', + ]; /** * The test values. diff --git a/core/modules/serialization/tests/src/Kernel/FieldItemSerializationTest.php b/core/modules/serialization/tests/src/Kernel/FieldItemSerializationTest.php index 0933bb4428..8ccdcb405b 100644 --- a/core/modules/serialization/tests/src/Kernel/FieldItemSerializationTest.php +++ b/core/modules/serialization/tests/src/Kernel/FieldItemSerializationTest.php @@ -17,7 +17,16 @@ class FieldItemSerializationTest extends NormalizerTestBase { /** * {@inheritdoc} */ - public static $modules = ['serialization', 'system', 'field', 'entity_test', 'text', 'filter', 'user', 'field_normalization_test']; + public static $modules = [ + 'serialization', + 'system', + 'field', + 'entity_test', + 'text', + 'filter', + 'user', + 'field_normalization_test', + ]; /** * The class name of the test class. diff --git a/core/modules/serialization/tests/src/Kernel/NormalizerTestBase.php b/core/modules/serialization/tests/src/Kernel/NormalizerTestBase.php index 25299b16f0..abf662d4c3 100644 --- a/core/modules/serialization/tests/src/Kernel/NormalizerTestBase.php +++ b/core/modules/serialization/tests/src/Kernel/NormalizerTestBase.php @@ -16,7 +16,15 @@ * * @var array */ - public static $modules = ['serialization', 'system', 'field', 'entity_test', 'text', 'filter', 'user']; + public static $modules = [ + 'serialization', + 'system', + 'field', + 'entity_test', + 'text', + 'filter', + 'user', + ]; protected function setUp() { parent::setUp(); diff --git a/core/modules/serialization/tests/src/Unit/CompilerPass/RegisterSerializationClassesCompilerPassTest.php b/core/modules/serialization/tests/src/Unit/CompilerPass/RegisterSerializationClassesCompilerPassTest.php index e85b55600a..1c97049886 100644 --- a/core/modules/serialization/tests/src/Unit/CompilerPass/RegisterSerializationClassesCompilerPassTest.php +++ b/core/modules/serialization/tests/src/Unit/CompilerPass/RegisterSerializationClassesCompilerPassTest.php @@ -45,7 +45,11 @@ public function testEncoders() { // Check registration of formats and providers. $this->assertEquals(['xml', 'json', 'hal_json'], $container->getParameter('serializer.formats')); - $this->assertEquals(['xml' => 'test_provider_a', 'json' => 'test_provider_a', 'hal_json' => 'test_provider_b'], $container->getParameter('serializer.format_providers')); + $this->assertEquals([ + 'xml' => 'test_provider_a', + 'json' => 'test_provider_a', + 'hal_json' => 'test_provider_b', + ], $container->getParameter('serializer.format_providers')); // Check all encoder and normalizer service definitions are marked private. $this->assertFalse($encoder_1_definition->isPublic()); diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/DateTimeIso8601NormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/DateTimeIso8601NormalizerTest.php index a5864c07bd..3ae7a4fbb6 100644 --- a/core/modules/serialization/tests/src/Unit/Normalizer/DateTimeIso8601NormalizerTest.php +++ b/core/modules/serialization/tests/src/Unit/Normalizer/DateTimeIso8601NormalizerTest.php @@ -199,13 +199,37 @@ public function providerTestDenormalizeValidFormats() { $data = []; $data['just a date'] = ['date-only', '2016-11-06', '2016-11-06']; - $data['RFC3339'] = ['date+time', '2016-11-06T09:02:00+00:00', '2016-11-06T09:02:00']; - $data['RFC3339 +0100'] = ['date+time', '2016-11-06T09:02:00+01:00', '2016-11-06T08:02:00']; - $data['RFC3339 -0600'] = ['date+time', '2016-11-06T09:02:00-06:00', '2016-11-06T15:02:00']; + $data['RFC3339'] = [ + 'date+time', + '2016-11-06T09:02:00+00:00', + '2016-11-06T09:02:00', + ]; + $data['RFC3339 +0100'] = [ + 'date+time', + '2016-11-06T09:02:00+01:00', + '2016-11-06T08:02:00', + ]; + $data['RFC3339 -0600'] = [ + 'date+time', + '2016-11-06T09:02:00-06:00', + '2016-11-06T15:02:00', + ]; - $data['ISO8601'] = ['date+time', '2016-11-06T09:02:00+0000', '2016-11-06T09:02:00']; - $data['ISO8601 +0100'] = ['date+time', '2016-11-06T09:02:00+0100', '2016-11-06T08:02:00']; - $data['ISO8601 -0600'] = ['date+time', '2016-11-06T09:02:00-0600', '2016-11-06T15:02:00']; + $data['ISO8601'] = [ + 'date+time', + '2016-11-06T09:02:00+0000', + '2016-11-06T09:02:00', + ]; + $data['ISO8601 +0100'] = [ + 'date+time', + '2016-11-06T09:02:00+0100', + '2016-11-06T08:02:00', + ]; + $data['ISO8601 -0600'] = [ + 'date+time', + '2016-11-06T09:02:00-0600', + '2016-11-06T15:02:00', + ]; return $data; } diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/DateTimeNormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/DateTimeNormalizerTest.php index e6b6c788e8..f4dc459f8b 100644 --- a/core/modules/serialization/tests/src/Unit/Normalizer/DateTimeNormalizerTest.php +++ b/core/modules/serialization/tests/src/Unit/Normalizer/DateTimeNormalizerTest.php @@ -153,9 +153,21 @@ public function testDenormalizeUserFormats($normalized, $format, $expected) { public function providerTestDenormalizeUserFormats() { $data = []; - $data['Y/m/d H:i:s P'] = ['2016/11/06 09:02:00 +00:00', 'Y/m/d H:i:s P', new \DateTimeImmutable('2016-11-06T09:02:00+00:00')]; - $data['H:i:s Y/m/d P'] = ['09:02:00 2016/11/06 +01:00', 'H:i:s Y/m/d P', new \DateTimeImmutable('2016-11-06T09:02:00+01:00')]; - $data['Y/m/d H:i:s'] = ['09:02:00 2016/11/06', 'H:i:s Y/m/d', new \DateTimeImmutable('2016-11-06T09:02:00+11:00')]; + $data['Y/m/d H:i:s P'] = [ + '2016/11/06 09:02:00 +00:00', + 'Y/m/d H:i:s P', + new \DateTimeImmutable('2016-11-06T09:02:00+00:00'), + ]; + $data['H:i:s Y/m/d P'] = [ + '09:02:00 2016/11/06 +01:00', + 'H:i:s Y/m/d P', + new \DateTimeImmutable('2016-11-06T09:02:00+01:00'), + ]; + $data['Y/m/d H:i:s'] = [ + '09:02:00 2016/11/06', + 'H:i:s Y/m/d', + new \DateTimeImmutable('2016-11-06T09:02:00+11:00'), + ]; return $data; } diff --git a/core/modules/shortcut/src/Form/SetCustomize.php b/core/modules/shortcut/src/Form/SetCustomize.php index 6f86a0e2a0..394e1ff662 100644 --- a/core/modules/shortcut/src/Form/SetCustomize.php +++ b/core/modules/shortcut/src/Form/SetCustomize.php @@ -103,7 +103,12 @@ protected function actions(array $form, FormStateInterface $form_state) { */ public function save(array $form, FormStateInterface $form_state) { foreach ($this->entity->getShortcuts() as $shortcut) { - $weight = $form_state->getValue(['shortcuts', 'links', $shortcut->id(), 'weight']); + $weight = $form_state->getValue([ + 'shortcuts', + 'links', + $shortcut->id(), + 'weight', + ]); $shortcut->setWeight($weight); $shortcut->save(); } diff --git a/core/modules/statistics/tests/src/Functional/StatisticsAdminTest.php b/core/modules/statistics/tests/src/Functional/StatisticsAdminTest.php index b0f6334425..fc7ea25fb5 100644 --- a/core/modules/statistics/tests/src/Functional/StatisticsAdminTest.php +++ b/core/modules/statistics/tests/src/Functional/StatisticsAdminTest.php @@ -58,7 +58,11 @@ protected function setUp() { if ($this->profile != 'standard') { $this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']); } - $this->privilegedUser = $this->drupalCreateUser(['administer statistics', 'view post access counter', 'create page content']); + $this->privilegedUser = $this->drupalCreateUser([ + 'administer statistics', + 'view post access counter', + 'create page content', + ]); $this->drupalLogin($this->privilegedUser); $this->testNode = $this->drupalCreateNode(['type' => 'page', 'uid' => $this->privilegedUser->id()]); $this->client = \Drupal::httpClient(); diff --git a/core/modules/statistics/tests/src/Functional/StatisticsReportsTest.php b/core/modules/statistics/tests/src/Functional/StatisticsReportsTest.php index 0b80251d6c..3de8c364b1 100644 --- a/core/modules/statistics/tests/src/Functional/StatisticsReportsTest.php +++ b/core/modules/statistics/tests/src/Functional/StatisticsReportsTest.php @@ -56,7 +56,13 @@ public function testPopularContentBlock() { $tags = Cache::mergeTags($node->getCacheTags(), $block->getCacheTags()); $tags = Cache::mergeTags($tags, $this->blockingUser->getCacheTags()); - $tags = Cache::mergeTags($tags, ['block_view', 'config:block_list', 'node_list', 'rendered', 'user_view']); + $tags = Cache::mergeTags($tags, [ + 'block_view', + 'config:block_list', + 'node_list', + 'rendered', + 'user_view', + ]); $this->assertCacheTags($tags); $contexts = Cache::mergeContexts($node->getCacheContexts(), $block->getCacheContexts()); $contexts = Cache::mergeContexts($contexts, ['url.query_args:_wrapper_format']); diff --git a/core/modules/system/src/Form/ModulesListForm.php b/core/modules/system/src/Form/ModulesListForm.php index f32dad0909..7703cb96c3 100644 --- a/core/modules/system/src/Form/ModulesListForm.php +++ b/core/modules/system/src/Form/ModulesListForm.php @@ -240,7 +240,15 @@ protected function buildRow(array $modules, Extension $module, $distribution) { '#type' => 'link', '#title' => $this->t('Help'), '#url' => Url::fromRoute('help.page', ['name' => $module->getName()]), - '#options' => ['attributes' => ['class' => ['module-link', 'module-link-help'], 'title' => $this->t('Help')]], + '#options' => [ + 'attributes' => [ + 'class' => [ + 'module-link', + 'module-link-help', + ], + 'title' => $this->t('Help'), + ], + ], ]; } @@ -250,7 +258,16 @@ protected function buildRow(array $modules, Extension $module, $distribution) { '#type' => 'link', '#title' => $this->t('Permissions'), '#url' => Url::fromRoute('user.admin_permissions'), - '#options' => ['fragment' => 'module-' . $module->getName(), 'attributes' => ['class' => ['module-link', 'module-link-permissions'], 'title' => $this->t('Configure permissions')]], + '#options' => [ + 'fragment' => 'module-' . $module->getName(), + 'attributes' => [ + 'class' => [ + 'module-link', + 'module-link-permissions', + ], + 'title' => $this->t('Configure permissions'), + ], + ], ]; } diff --git a/core/modules/system/src/Form/PerformanceForm.php b/core/modules/system/src/Form/PerformanceForm.php index dc13796bb5..70cdf39d25 100644 --- a/core/modules/system/src/Form/PerformanceForm.php +++ b/core/modules/system/src/Form/PerformanceForm.php @@ -123,7 +123,22 @@ public function buildForm(array $form, FormStateInterface $form_state) { ]; // Identical options to the ones for block caching. // @see \Drupal\Core\Block\BlockBase::buildConfigurationForm() - $period = [0, 60, 180, 300, 600, 900, 1800, 2700, 3600, 10800, 21600, 32400, 43200, 86400]; + $period = [ + 0, + 60, + 180, + 300, + 600, + 900, + 1800, + 2700, + 3600, + 10800, + 21600, + 32400, + 43200, + 86400, + ]; $period = array_map([$this->dateFormatter, 'formatInterval'], array_combine($period, $period)); $period[0] = '<' . t('no caching') . '>'; $form['caching']['page_cache_maximum_age'] = [ diff --git a/core/modules/system/src/Form/RegionalForm.php b/core/modules/system/src/Form/RegionalForm.php index 848e928673..1f1474810c 100644 --- a/core/modules/system/src/Form/RegionalForm.php +++ b/core/modules/system/src/Form/RegionalForm.php @@ -88,7 +88,15 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#type' => 'select', '#title' => t('First day of week'), '#default_value' => $system_date->get('first_day'), - '#options' => [0 => t('Sunday'), 1 => t('Monday'), 2 => t('Tuesday'), 3 => t('Wednesday'), 4 => t('Thursday'), 5 => t('Friday'), 6 => t('Saturday')], + '#options' => [ + 0 => t('Sunday'), + 1 => t('Monday'), + 2 => t('Tuesday'), + 3 => t('Wednesday'), + 4 => t('Thursday'), + 5 => t('Friday'), + 6 => t('Saturday'), + ], ]; $form['timezone'] = [ diff --git a/core/modules/system/src/Form/SystemMenuOffCanvasForm.php b/core/modules/system/src/Form/SystemMenuOffCanvasForm.php index a561a5bd9a..71b9616a9d 100644 --- a/core/modules/system/src/Form/SystemMenuOffCanvasForm.php +++ b/core/modules/system/src/Form/SystemMenuOffCanvasForm.php @@ -116,7 +116,11 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta unset($form['entity_form']['label'], $form['entity_form']['id'], $form['entity_form']['description'], $form['entity_form']['actions']); // Since the overview form is further nested than expected, update the // #parents. See \Drupal\menu_ui\MenuForm::form(). - $form_state->set('menu_overview_form_parents', ['settings', 'entity_form', 'links']); + $form_state->set('menu_overview_form_parents', [ + 'settings', + 'entity_form', + 'links', + ]); return $form; } diff --git a/core/modules/system/src/Form/ThemeSettingsForm.php b/core/modules/system/src/Form/ThemeSettingsForm.php index e25563d049..bc5cf65d18 100644 --- a/core/modules/system/src/Form/ThemeSettingsForm.php +++ b/core/modules/system/src/Form/ThemeSettingsForm.php @@ -185,7 +185,11 @@ public function buildForm(array $form, FormStateInterface $form_state, $theme = ]; foreach ($toggles as $name => $title) { if ((!$theme) || in_array($name, $features)) { - $form['theme_settings']['toggle_' . $name] = ['#type' => 'checkbox', '#title' => $title, '#default_value' => theme_get_setting('features.' . $name, $theme)]; + $form['theme_settings']['toggle_' . $name] = [ + '#type' => 'checkbox', + '#title' => $title, + '#default_value' => theme_get_setting('features.' . $name, $theme), + ]; // Disable checkboxes for features not supported in the current configuration. if (isset($disabled['toggle_' . $name])) { $form['theme_settings']['toggle_' . $name]['#disabled'] = TRUE; diff --git a/core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Rotate.php b/core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Rotate.php index e567ea43f2..481377b41d 100644 --- a/core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Rotate.php +++ b/core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Rotate.php @@ -49,7 +49,12 @@ protected function validateArguments(array $arguments) { } else { // Background color is not specified: use transparent white as background. - $background = ['red' => 255, 'green' => 255, 'blue' => 255, 'alpha' => 127]; + $background = [ + 'red' => 255, + 'green' => 255, + 'blue' => 255, + 'alpha' => 127, + ]; } // Store the color index for the background as that is what GD uses. $arguments['background_idx'] = imagecolorallocatealpha($this->getToolkit()->getResource(), $background['red'], $background['green'], $background['blue'], $background['alpha']); diff --git a/core/modules/taxonomy/tests/src/Functional/EarlyDateTest.php b/core/modules/taxonomy/tests/src/Functional/EarlyDateTest.php index 74b0093738..211e3e5732 100644 --- a/core/modules/taxonomy/tests/src/Functional/EarlyDateTest.php +++ b/core/modules/taxonomy/tests/src/Functional/EarlyDateTest.php @@ -51,7 +51,11 @@ protected function setUp() { ]) ->save(); - $this->drupalLogin($this->drupalCreateUser(['administer taxonomy', 'administer nodes', 'bypass node access'])); + $this->drupalLogin($this->drupalCreateUser([ + 'administer taxonomy', + 'administer nodes', + 'bypass node access', + ])); } /** diff --git a/core/modules/taxonomy/tests/src/Functional/RssTest.php b/core/modules/taxonomy/tests/src/Functional/RssTest.php index b0488f1d0f..8fd6f48e71 100644 --- a/core/modules/taxonomy/tests/src/Functional/RssTest.php +++ b/core/modules/taxonomy/tests/src/Functional/RssTest.php @@ -42,7 +42,12 @@ class RssTest extends TaxonomyTestBase { protected function setUp() { parent::setUp(); - $this->drupalLogin($this->drupalCreateUser(['administer taxonomy', 'bypass node access', 'administer content types', 'administer node display'])); + $this->drupalLogin($this->drupalCreateUser([ + 'administer taxonomy', + 'bypass node access', + 'administer content types', + 'administer node display', + ])); $this->vocabulary = $this->createVocabulary(); $this->fieldName = 'taxonomy_' . $this->vocabulary->id(); diff --git a/core/modules/taxonomy/tests/src/Functional/TaxonomyImageTest.php b/core/modules/taxonomy/tests/src/Functional/TaxonomyImageTest.php index 6bd4ef5bca..295aebf90c 100644 --- a/core/modules/taxonomy/tests/src/Functional/TaxonomyImageTest.php +++ b/core/modules/taxonomy/tests/src/Functional/TaxonomyImageTest.php @@ -80,7 +80,11 @@ protected function setUp() { } public function testTaxonomyImageAccess() { - $user = $this->drupalCreateUser(['administer site configuration', 'administer taxonomy', 'access user profiles']); + $user = $this->drupalCreateUser([ + 'administer site configuration', + 'administer taxonomy', + 'access user profiles', + ]); $this->drupalLogin($user); // Create a term and upload the image. diff --git a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyFieldFilterTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyFieldFilterTest.php index 5df90a6893..450f571d73 100644 --- a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyFieldFilterTest.php +++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyFieldFilterTest.php @@ -22,7 +22,14 @@ class TaxonomyFieldFilterTest extends ViewTestBase { /** * {@inheritdoc} */ - public static $modules = ['language', 'taxonomy', 'taxonomy_test_views', 'text', 'views', 'node']; + public static $modules = [ + 'language', + 'taxonomy', + 'taxonomy_test_views', + 'text', + 'views', + 'node', + ]; /** * {@inheritdoc} @@ -86,7 +93,12 @@ public function setUp($import_test_views = TRUE) { ])->save(); // Create term with translations. - $taxonomy = $this->createTermWithProperties(['name' => $this->termNames['en'], 'langcode' => 'en', 'description' => $this->termNames['en'], 'field_foo' => $this->termNames['en']]); + $taxonomy = $this->createTermWithProperties([ + 'name' => $this->termNames['en'], + 'langcode' => 'en', + 'description' => $this->termNames['en'], + 'field_foo' => $this->termNames['en'], + ]); foreach (['es', 'fr'] as $langcode) { $translation = $taxonomy->addTranslation($langcode, ['name' => $this->termNames[$langcode]]); $translation->description->value = $this->termNames[$langcode]; @@ -106,27 +118,51 @@ public function setUp($import_test_views = TRUE) { public function testFilters() { // Test the name filter page, which filters for name contains 'Comida'. // Should show just the Spanish translation, once. - $this->assertPageCounts('test-name-filter', ['es' => 1, 'fr' => 0, 'en' => 0], 'Comida name filter'); + $this->assertPageCounts('test-name-filter', [ + 'es' => 1, + 'fr' => 0, + 'en' => 0, + ], 'Comida name filter'); // Test the description filter page, which filters for description contains // 'Comida'. Should show just the Spanish translation, once. - $this->assertPageCounts('test-desc-filter', ['es' => 1, 'fr' => 0, 'en' => 0], 'Comida description filter'); + $this->assertPageCounts('test-desc-filter', [ + 'es' => 1, + 'fr' => 0, + 'en' => 0, + ], 'Comida description filter'); // Test the field filter page, which filters for field_foo contains // 'Comida'. Should show just the Spanish translation, once. - $this->assertPageCounts('test-field-filter', ['es' => 1, 'fr' => 0, 'en' => 0], 'Comida field filter'); + $this->assertPageCounts('test-field-filter', [ + 'es' => 1, + 'fr' => 0, + 'en' => 0, + ], 'Comida field filter'); // Test the name Paris filter page, which filters for name contains // 'Paris'. Should show each translation once. - $this->assertPageCounts('test-name-paris', ['es' => 1, 'fr' => 1, 'en' => 1], 'Paris name filter'); + $this->assertPageCounts('test-name-paris', [ + 'es' => 1, + 'fr' => 1, + 'en' => 1, + ], 'Paris name filter'); // Test the description Paris page, which filters for description contains // 'Paris'. Should show each translation, once. - $this->assertPageCounts('test-desc-paris', ['es' => 1, 'fr' => 1, 'en' => 1], 'Paris description filter'); + $this->assertPageCounts('test-desc-paris', [ + 'es' => 1, + 'fr' => 1, + 'en' => 1, + ], 'Paris description filter'); // Test the field Paris filter page, which filters for field_foo contains // 'Paris'. Should show each translation once. - $this->assertPageCounts('test-field-paris', ['es' => 1, 'fr' => 1, 'en' => 1], 'Paris field filter'); + $this->assertPageCounts('test-field-paris', [ + 'es' => 1, + 'fr' => 1, + 'en' => 1, + ], 'Paris field filter'); } diff --git a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyIndexTidUiTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyIndexTidUiTest.php index de81f8ba68..f2eb4bc006 100644 --- a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyIndexTidUiTest.php +++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyIndexTidUiTest.php @@ -36,7 +36,13 @@ class TaxonomyIndexTidUiTest extends UITestBase { * * @var array */ - public static $modules = ['node', 'taxonomy', 'views', 'views_ui', 'taxonomy_test_views']; + public static $modules = [ + 'node', + 'taxonomy', + 'views', + 'views_ui', + 'taxonomy_test_views', + ]; /** * A nested array of \Drupal\taxonomy\TermInterface objects. diff --git a/core/modules/taxonomy/tests/src/Kernel/PendingRevisionTest.php b/core/modules/taxonomy/tests/src/Kernel/PendingRevisionTest.php index e4b2cc051c..49e1fcd651 100644 --- a/core/modules/taxonomy/tests/src/Kernel/PendingRevisionTest.php +++ b/core/modules/taxonomy/tests/src/Kernel/PendingRevisionTest.php @@ -20,7 +20,14 @@ class PendingRevisionTest extends KernelTestBase { /** * {@inheritdoc} */ - public static $modules = ['taxonomy', 'node', 'user', 'text', 'field', 'system']; + public static $modules = [ + 'taxonomy', + 'node', + 'user', + 'text', + 'field', + 'system', + ]; /** * {@inheritdoc} diff --git a/core/modules/taxonomy/tests/src/Kernel/Views/ArgumentValidatorTermTest.php b/core/modules/taxonomy/tests/src/Kernel/Views/ArgumentValidatorTermTest.php index 07e3ea64b4..5fb1e1996e 100644 --- a/core/modules/taxonomy/tests/src/Kernel/Views/ArgumentValidatorTermTest.php +++ b/core/modules/taxonomy/tests/src/Kernel/Views/ArgumentValidatorTermTest.php @@ -106,7 +106,10 @@ public function testArgumentValidatorTerm() { $view->argument['tid']->argument_validated = NULL; // Check for multiple invalid terms. - $this->assertFalse($view->argument['tid']->setArgument(implode(',', [rand(1000, 10000), rand(1000, 10000)]))); + $this->assertFalse($view->argument['tid']->setArgument(implode(',', [ + rand(1000, 10000), + rand(1000, 10000), + ]))); $this->assertEmpty($view->argument['tid']->getTitle()); $view->argument['tid']->validated_title = NULL; $view->argument['tid']->argument_validated = NULL; diff --git a/core/modules/toolbar/tests/src/Functional/ToolbarMenuTranslationTest.php b/core/modules/toolbar/tests/src/Functional/ToolbarMenuTranslationTest.php index 57336e04b2..c985e4800f 100644 --- a/core/modules/toolbar/tests/src/Functional/ToolbarMenuTranslationTest.php +++ b/core/modules/toolbar/tests/src/Functional/ToolbarMenuTranslationTest.php @@ -34,7 +34,12 @@ protected function setUp() { parent::setUp(); // Create an administrative user and log it in. - $this->adminUser = $this->drupalCreateUser(['access toolbar', 'translate interface', 'administer languages', 'access administration pages']); + $this->adminUser = $this->drupalCreateUser([ + 'access toolbar', + 'translate interface', + 'administer languages', + 'access administration pages', + ]); $this->drupalLogin($this->adminUser); } diff --git a/core/modules/tour/tests/src/Functional/TourHelpPageTest.php b/core/modules/tour/tests/src/Functional/TourHelpPageTest.php index a88da72cb9..766c00b6a7 100644 --- a/core/modules/tour/tests/src/Functional/TourHelpPageTest.php +++ b/core/modules/tour/tests/src/Functional/TourHelpPageTest.php @@ -46,7 +46,11 @@ protected function setUp() { // Create users. For the Tour user, include permissions for the language // tours' parent pages, but not the translation tour's parent page. See // self:getTourList(). - $this->tourUser = $this->drupalCreateUser(['access administration pages', 'access tour', 'administer languages']); + $this->tourUser = $this->drupalCreateUser([ + 'access administration pages', + 'access tour', + 'administer languages', + ]); $this->noTourUser = $this->drupalCreateUser(['access administration pages']); } @@ -140,7 +144,10 @@ protected function getModuleList() { * not 'translate interface'. */ protected function getTourList() { - return [['Adding languages', 'Language'], ['Editing languages', 'Translation']]; + return [ + ['Adding languages', 'Language'], + ['Editing languages', 'Translation'], + ]; } } diff --git a/core/modules/tracker/tests/src/Functional/TrackerTest.php b/core/modules/tracker/tests/src/Functional/TrackerTest.php index 3d907212c8..1798d0102f 100644 --- a/core/modules/tracker/tests/src/Functional/TrackerTest.php +++ b/core/modules/tracker/tests/src/Functional/TrackerTest.php @@ -29,7 +29,13 @@ class TrackerTest extends BrowserTestBase { * * @var array */ - public static $modules = ['block', 'comment', 'tracker', 'history', 'node_test']; + public static $modules = [ + 'block', + 'comment', + 'tracker', + 'history', + 'node_test', + ]; /** * {@inheritdoc} @@ -55,7 +61,12 @@ protected function setUp() { $this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']); - $permissions = ['access comments', 'create page content', 'post comments', 'skip comment approval']; + $permissions = [ + 'access comments', + 'create page content', + 'post comments', + 'skip comment approval', + ]; $this->user = $this->drupalCreateUser($permissions); $this->otherUser = $this->drupalCreateUser($permissions); $this->addDefaultCommentField('node', 'page'); @@ -412,7 +423,11 @@ public function testTrackerCronIndexing() { public function testTrackerAdminUnpublish() { \Drupal::service('module_installer')->install(['views']); \Drupal::service('router.builder')->rebuild(); - $admin_user = $this->drupalCreateUser(['access content overview', 'administer nodes', 'bypass node access']); + $admin_user = $this->drupalCreateUser([ + 'access content overview', + 'administer nodes', + 'bypass node access', + ]); $this->drupalLogin($admin_user); $node = $this->drupalCreateNode([ diff --git a/core/modules/user/user.module b/core/modules/user/user.module index d4021f70f6..211aae20e6 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -778,7 +778,11 @@ function user_mail($key, &$message, $params) { $language_manager->setConfigOverrideLanguage($language); $mail_config = \Drupal::config('user.mail'); - $token_options = ['langcode' => $langcode, 'callback' => 'user_mail_tokens', 'clear' => TRUE]; + $token_options = [ + 'langcode' => $langcode, + 'callback' => 'user_mail_tokens', + 'clear' => TRUE, + ]; $message['subject'] .= PlainTextOutput::renderFromHtml($token_service->replace($mail_config->get($key . '.subject'), $variables, $token_options)); $message['body'][] = $token_service->replace($mail_config->get($key . '.body'), $variables, $token_options); diff --git a/core/modules/views/src/Form/ViewsExposedForm.php b/core/modules/views/src/Form/ViewsExposedForm.php index 0a12166412..76db666a9a 100644 --- a/core/modules/views/src/Form/ViewsExposedForm.php +++ b/core/modules/views/src/Form/ViewsExposedForm.php @@ -179,7 +179,14 @@ public function validateForm(array &$form, FormStateInterface $form_state) { */ public function submitForm(array &$form, FormStateInterface $form_state) { // Form input keys that will not be included in $view->exposed_raw_data. - $exclude = ['submit', 'form_build_id', 'form_id', 'form_token', 'exposed_form_plugin', 'reset']; + $exclude = [ + 'submit', + 'form_build_id', + 'form_id', + 'form_token', + 'exposed_form_plugin', + 'reset', + ]; $values = $form_state->getValues(); foreach (['field', 'filter'] as $type) { /** @var \Drupal\views\Plugin\views\ViewsHandlerInterface[] $handlers */ diff --git a/core/modules/views/src/Plugin/views/row/RssFields.php b/core/modules/views/src/Plugin/views/row/RssFields.php index dc80f7e028..ccefeba473 100644 --- a/core/modules/views/src/Plugin/views/row/RssFields.php +++ b/core/modules/views/src/Plugin/views/row/RssFields.php @@ -145,7 +145,10 @@ public function render($row) { $item->description = is_array($field) ? $field : ['#markup' => $field]; $item->elements = [ - ['key' => 'pubDate', 'value' => $this->getField($row_index, $this->options['date_field'])], + [ + 'key' => 'pubDate', + 'value' => $this->getField($row_index, $this->options['date_field']), + ], [ 'key' => 'dc:creator', 'value' => $this->getField($row_index, $this->options['creator_field']), diff --git a/core/modules/views/src/Plugin/views/style/StylePluginBase.php b/core/modules/views/src/Plugin/views/style/StylePluginBase.php index c23dccd789..5fb92f751b 100644 --- a/core/modules/views/src/Plugin/views/style/StylePluginBase.php +++ b/core/modules/views/src/Plugin/views/style/StylePluginBase.php @@ -298,7 +298,11 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { // Add a form for every grouping, plus one. for ($i = 0; $i <= $c; $i++) { $grouping = !empty($this->options['grouping'][$i]) ? $this->options['grouping'][$i] : []; - $grouping += ['field' => '', 'rendered' => TRUE, 'rendered_strip' => FALSE]; + $grouping += [ + 'field' => '', + 'rendered' => TRUE, + 'rendered_strip' => FALSE, + ]; $form['grouping'][$i]['field'] = [ '#type' => 'select', '#title' => $this->t('Grouping field Nr.@number', ['@number' => $i + 1]), diff --git a/core/modules/views/src/Plugin/views/style/Table.php b/core/modules/views/src/Plugin/views/style/Table.php index 0058bdc4f0..4fb67453ff 100644 --- a/core/modules/views/src/Plugin/views/style/Table.php +++ b/core/modules/views/src/Plugin/views/style/Table.php @@ -371,7 +371,11 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { '#title_display' => 'invisible', '#type' => 'select', '#default_value' => isset($this->options['info'][$field]['responsive']) ? $this->options['info'][$field]['responsive'] : '', - '#options' => ['' => $this->t('High'), RESPONSIVE_PRIORITY_MEDIUM => $this->t('Medium'), RESPONSIVE_PRIORITY_LOW => $this->t('Low')], + '#options' => [ + '' => $this->t('High'), + RESPONSIVE_PRIORITY_MEDIUM => $this->t('Medium'), + RESPONSIVE_PRIORITY_LOW => $this->t('Low'), + ], '#states' => [ 'visible' => [ $column_selector => ['value' => $field], diff --git a/core/modules/views_ui/src/ViewEditForm.php b/core/modules/views_ui/src/ViewEditForm.php index e9d7d33f47..1bc6e03ce0 100644 --- a/core/modules/views_ui/src/ViewEditForm.php +++ b/core/modules/views_ui/src/ViewEditForm.php @@ -130,7 +130,13 @@ public function form(array $form, FormStateInterface $form_state) { if ($view->isLocked()) { $form['locked'] = [ '#type' => 'container', - '#attributes' => ['class' => ['view-locked', 'messages', 'messages--warning']], + '#attributes' => [ + 'class' => [ + 'view-locked', + 'messages', + 'messages--warning', + ], + ], '#weight' => -10, 'message' => [ '#type' => 'break_lock_link', @@ -143,7 +149,13 @@ public function form(array $form, FormStateInterface $form_state) { else { $form['changed'] = [ '#type' => 'container', - '#attributes' => ['class' => ['view-changed', 'messages', 'messages--warning']], + '#attributes' => [ + 'class' => [ + 'view-changed', + 'messages', + 'messages--warning', + ], + ], '#children' => $this->t('You have unsaved changes.'), '#weight' => -10, ]; diff --git a/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php b/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php index cdf36704cf..009f92d58f 100644 --- a/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php +++ b/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php @@ -196,7 +196,12 @@ public function testMenuOptions() { * Tests the regression in https://www.drupal.org/node/2532490. */ public function testDefaultMenuTabRegression() { - $this->container->get('module_installer')->install(['menu_ui', 'menu_link_content', 'toolbar', 'system']); + $this->container->get('module_installer')->install([ + 'menu_ui', + 'menu_link_content', + 'toolbar', + 'system', + ]); $admin_user = $this->drupalCreateUser([ 'administer views', 'administer blocks', diff --git a/core/modules/views_ui/tests/src/Functional/NewViewConfigSchemaTest.php b/core/modules/views_ui/tests/src/Functional/NewViewConfigSchemaTest.php index 58b0bdfdd9..2dc44dc5a7 100644 --- a/core/modules/views_ui/tests/src/Functional/NewViewConfigSchemaTest.php +++ b/core/modules/views_ui/tests/src/Functional/NewViewConfigSchemaTest.php @@ -14,7 +14,15 @@ class NewViewConfigSchemaTest extends UITestBase { * * @var array */ - public static $modules = ['views_ui', 'node', 'comment', 'file', 'taxonomy', 'dblog', 'aggregator']; + public static $modules = [ + 'views_ui', + 'node', + 'comment', + 'file', + 'taxonomy', + 'dblog', + 'aggregator', + ]; /** * {@inheritdoc} diff --git a/core/modules/views_ui/tests/src/Functional/ViewEditTest.php b/core/modules/views_ui/tests/src/Functional/ViewEditTest.php index 82eec0b60d..01be02371d 100644 --- a/core/modules/views_ui/tests/src/Functional/ViewEditTest.php +++ b/core/modules/views_ui/tests/src/Functional/ViewEditTest.php @@ -17,7 +17,11 @@ class ViewEditTest extends UITestBase { * * @var array */ - public static $testViews = ['test_view', 'test_display', 'test_groupwise_term_ui']; + public static $testViews = [ + 'test_view', + 'test_display', + 'test_groupwise_term_ui', + ]; /** * {@inheritdoc} diff --git a/core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php b/core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php index d426bc1036..da0cd4bcbc 100644 --- a/core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php +++ b/core/modules/views_ui/tests/src/FunctionalJavascript/PreviewTest.php @@ -19,7 +19,12 @@ class PreviewTest extends WebDriverTestBase { * * @var array */ - public static $testViews = ['test_preview', 'test_pager_full_ajax', 'test_mini_pager_ajax', 'test_click_sort_ajax']; + public static $testViews = [ + 'test_preview', + 'test_pager_full_ajax', + 'test_mini_pager_ajax', + 'test_click_sort_ajax', + ]; /** * {@inheritdoc} diff --git a/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php b/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php index 5a6fa195a9..f895ae54db 100644 --- a/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php +++ b/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php @@ -123,14 +123,21 @@ public function testWorkflowCreation() { $this->assertSession()->pageTextContains('Workflows'); $this->assertSession()->pageTextContains('There are no workflows yet.'); $this->clickLink('Add workflow'); - $this->submitForm(['label' => 'Test', 'id' => 'test', 'workflow_type' => 'workflow_type_test'], 'Save'); + $this->submitForm([ + 'label' => 'Test', + 'id' => 'test', + 'workflow_type' => 'workflow_type_test', + ], 'Save'); $this->assertSession()->pageTextContains('Created the Test Workflow.'); $this->assertSession()->addressEquals('admin/config/workflow/workflows/manage/test/add_state'); $this->drupalGet('/admin/config/workflow/workflows/manage/test'); $this->assertSession()->pageTextContains('This workflow has no states and will be disabled until there is at least one, add a new state.'); $this->assertSession()->pageTextContains('There are no states yet.'); $this->clickLink('Add a new state'); - $this->submitForm(['label' => 'Published', 'id' => 'published'], 'Save'); + $this->submitForm([ + 'label' => 'Published', + 'id' => 'published', + ], 'Save'); $this->assertSession()->pageTextContains('Created Published state.'); $workflow = $workflow_storage->loadUnchanged('test'); $this->assertFalse($workflow->getTypePlugin()->getState('published')->canTransitionTo('published'), 'No default transition from published to published exists.'); @@ -143,7 +150,12 @@ public function testWorkflowCreation() { $this->assertFalse($workflow->getTypePlugin()->getState('draft')->canTransitionTo('draft'), 'Can not transition from draft to draft'); $this->clickLink('Add a new transition'); - $this->submitForm(['id' => 'publish', 'label' => 'Publish', 'from[draft]' => 'draft', 'to' => 'published'], 'Save'); + $this->submitForm([ + 'id' => 'publish', + 'label' => 'Publish', + 'from[draft]' => 'draft', + 'to' => 'published', + ], 'Save'); $this->assertSession()->pageTextContains('Created Publish transition.'); $workflow = $workflow_storage->loadUnchanged('test'); $this->assertTrue($workflow->getTypePlugin()->getState('draft')->canTransitionTo('published'), 'Can transition from draft to published'); @@ -151,7 +163,12 @@ public function testWorkflowCreation() { $this->clickLink('Add a new transition'); $this->assertCount(2, $this->cssSelect('input[name="to"][type="radio"]')); $this->assertCount(0, $this->cssSelect('input[name="to"][checked="checked"][type="radio"]')); - $this->submitForm(['id' => 'create_new_draft', 'label' => 'Create new draft', 'from[draft]' => 'draft', 'to' => 'draft'], 'Save'); + $this->submitForm([ + 'id' => 'create_new_draft', + 'label' => 'Create new draft', + 'from[draft]' => 'draft', + 'to' => 'draft', + ], 'Save'); $this->assertSession()->pageTextContains('Created Create new draft transition.'); $workflow = $workflow_storage->loadUnchanged('test'); $this->assertTrue($workflow->getTypePlugin()->getState('draft')->canTransitionTo('draft'), 'Can transition from draft to draft'); @@ -172,7 +189,12 @@ public function testWorkflowCreation() { // Try creating a duplicate transition. $this->clickLink('Add a new transition'); - $this->submitForm(['id' => 'create_new_draft', 'label' => 'Create new draft', 'from[published]' => 'published', 'to' => 'draft'], 'Save'); + $this->submitForm([ + 'id' => 'create_new_draft', + 'label' => 'Create new draft', + 'from[published]' => 'published', + 'to' => 'draft', + ], 'Save'); $this->assertSession()->pageTextContains('The machine-readable name is already in use. It must be unique.'); // Try creating a transition which duplicates the states of another. $this->submitForm(['id' => 'create_new_draft2', 'label' => 'Create new draft again', 'from[published]' => 'published', 'to' => 'draft'], 'Save'); @@ -298,7 +320,9 @@ public function testWorkflowConfigurationForm() { // Add additional information to the workflow via the configuration form. $this->drupalGet('admin/config/workflow/workflows/manage/test'); $this->assertSession()->pageTextContains('Example global workflow setting'); - $this->submitForm(['type_settings[example_setting]' => 'Extra global settings'], 'Save'); + $this->submitForm([ + 'type_settings[example_setting]' => 'Extra global settings', + ], 'Save'); $workflow_storage = $this->container->get('entity_type.manager')->getStorage('workflow'); $workflow = $workflow_storage->loadUnchanged('test'); diff --git a/core/modules/workflows/tests/src/Kernel/WorkflowDependenciesTest.php b/core/modules/workflows/tests/src/Kernel/WorkflowDependenciesTest.php index c1070dc53c..96238adeeb 100644 --- a/core/modules/workflows/tests/src/Kernel/WorkflowDependenciesTest.php +++ b/core/modules/workflows/tests/src/Kernel/WorkflowDependenciesTest.php @@ -17,7 +17,12 @@ class WorkflowDependenciesTest extends KernelTestBase { /** * {@inheritdoc} */ - public static $modules = ['system', 'workflows', 'workflow_type_test', 'workflow_third_party_settings_test']; + public static $modules = [ + 'system', + 'workflows', + 'workflow_type_test', + 'workflow_third_party_settings_test', + ]; /** * Tests \Drupal\workflows\Entity\Workflow::onDependencyRemoval(). diff --git a/core/modules/workspaces/src/WorkspaceAssociation.php b/core/modules/workspaces/src/WorkspaceAssociation.php index 9b9b2f01dd..0a9a1ffe9d 100644 --- a/core/modules/workspaces/src/WorkspaceAssociation.php +++ b/core/modules/workspaces/src/WorkspaceAssociation.php @@ -133,7 +133,11 @@ public function workspaceInsert(WorkspaceInterface $workspace) { public function getTrackedEntities($workspace_id, $entity_type_id = NULL, $entity_ids = NULL) { $query = $this->database->select(static::TABLE); $query - ->fields(static::TABLE, ['target_entity_type_id', 'target_entity_id', 'target_entity_revision_id']) + ->fields(static::TABLE, [ + 'target_entity_type_id', + 'target_entity_id', + 'target_entity_revision_id', + ]) ->orderBy('target_entity_revision_id', 'ASC') ->condition('workspace', $workspace_id); diff --git a/core/modules/workspaces/src/WorkspaceListBuilder.php b/core/modules/workspaces/src/WorkspaceListBuilder.php index 23aa652102..f032e40176 100644 --- a/core/modules/workspaces/src/WorkspaceListBuilder.php +++ b/core/modules/workspaces/src/WorkspaceListBuilder.php @@ -295,7 +295,11 @@ protected function offCanvasRender(array &$build) { '#title' => ltrim($row['data']['label']['data']['#markup']), '#url' => $url, '#attributes' => [ - 'class' => ['use-ajax', 'workspaces__item', 'workspaces__item--not-default'], + 'class' => [ + 'use-ajax', + 'workspaces__item', + 'workspaces__item--not-default', + ], 'data-dialog-type' => 'modal', 'data-dialog-options' => Json::encode([ 'width' => 500, @@ -312,7 +316,11 @@ protected function offCanvasRender(array &$build) { '#title' => $this->t('Live'), '#url' => Url::fromRoute('workspaces.switch_to_live', [], ['query' => $this->getDestinationArray()]), '#attributes' => [ - 'class' => ['use-ajax', 'workspaces__item', 'workspaces__item--default'], + 'class' => [ + 'use-ajax', + 'workspaces__item', + 'workspaces__item--default', + ], 'data-dialog-type' => 'modal', 'data-dialog-options' => Json::encode([ 'width' => 500, diff --git a/core/modules/workspaces/tests/src/Functional/PathWorkspacesTest.php b/core/modules/workspaces/tests/src/Functional/PathWorkspacesTest.php index 1787815b1f..88f63332f2 100644 --- a/core/modules/workspaces/tests/src/Functional/PathWorkspacesTest.php +++ b/core/modules/workspaces/tests/src/Functional/PathWorkspacesTest.php @@ -19,7 +19,13 @@ class PathWorkspacesTest extends BrowserTestBase { /** * {@inheritdoc} */ - protected static $modules = ['block', 'content_translation', 'node', 'path', 'workspaces']; + protected static $modules = [ + 'block', + 'content_translation', + 'node', + 'path', + 'workspaces', + ]; /** * {@inheritdoc} diff --git a/core/modules/workspaces/tests/src/Kernel/WorkspaceIntegrationTest.php b/core/modules/workspaces/tests/src/Kernel/WorkspaceIntegrationTest.php index 6466a80358..9ee97bde43 100644 --- a/core/modules/workspaces/tests/src/Kernel/WorkspaceIntegrationTest.php +++ b/core/modules/workspaces/tests/src/Kernel/WorkspaceIntegrationTest.php @@ -84,7 +84,13 @@ protected function setUp() { $this->installEntitySchema('node'); $this->installEntitySchema('user'); - $this->installConfig(['filter', 'node', 'system', 'language', 'content_translation']); + $this->installConfig([ + 'filter', + 'node', + 'system', + 'language', + 'content_translation', + ]); $this->installSchema('system', ['key_value_expire', 'sequences']); $this->installSchema('node', ['node_access']); @@ -101,8 +107,16 @@ protected function setUp() { // Create two nodes, a published and an unpublished one, so we can test the // behavior of the module with default/existing content. $this->createdTimestamp = \Drupal::time()->getRequestTime(); - $this->nodes[] = $this->createNode(['title' => 'live - 1 - r1 - published', 'created' => $this->createdTimestamp++, 'status' => TRUE]); - $this->nodes[] = $this->createNode(['title' => 'live - 2 - r2 - unpublished', 'created' => $this->createdTimestamp++, 'status' => FALSE]); + $this->nodes[] = $this->createNode([ + 'title' => 'live - 1 - r1 - published', + 'created' => $this->createdTimestamp++, + 'status' => TRUE, + ]); + $this->nodes[] = $this->createNode([ + 'title' => 'live - 2 - r2 - unpublished', + 'created' => $this->createdTimestamp++, + 'status' => FALSE, + ]); $translation = $this->nodes[0]->addTranslation('de'); $translation->setTitle('live - 1 - r1 - published - de'); @@ -397,7 +411,11 @@ public function testWorkspaceHierarchy() { // Create a new published node in 'stage' (which creates two revisions), and // check that it's tracked in all its descendants. $this->switchToWorkspace('stage'); - $this->createNode(['title' => 'stage - 3 - r5 - published', 'created' => $this->createdTimestamp++, 'status' => TRUE]); + $this->createNode([ + 'title' => 'stage - 3 - r5 - published', + 'created' => $this->createdTimestamp++, + 'status' => TRUE, + ]); $expected_workspace_association = [ 'stage' => [3, 5], 'dev' => [3, 5], diff --git a/core/modules/workspaces/workspaces.post_update.php b/core/modules/workspaces/workspaces.post_update.php index b705613012..b6370ba997 100644 --- a/core/modules/workspaces/workspaces.post_update.php +++ b/core/modules/workspaces/workspaces.post_update.php @@ -76,7 +76,11 @@ function workspaces_post_update_move_association_data(&$sandbox) { 'indexes' => [ 'target_entity_revision_id' => ['target_entity_revision_id'], ], - 'primary key' => ['workspace', 'target_entity_type_id', 'target_entity_id'], + 'primary key' => [ + 'workspace', + 'target_entity_type_id', + 'target_entity_id', + ], ]; if ($database->schema()->tableExists('tmp_workspace_association')) { $database->schema()->dropTable('tmp_workspace_association'); @@ -86,7 +90,12 @@ function workspaces_post_update_move_association_data(&$sandbox) { // Copy all the data from the base table of the 'workspace_association' // entity type to the temporary association table. $select = $database->select($tables['base_table']) - ->fields($tables['base_table'], ['workspace', 'target_entity_type_id', 'target_entity_id', 'target_entity_revision_id']); + ->fields($tables['base_table'], [ + 'workspace', + 'target_entity_type_id', + 'target_entity_id', + 'target_entity_revision_id', + ]); $database->insert('tmp_workspace_association')->from($select)->execute(); }