diff --git a/core/modules/views_ui/src/Form/Ajax/RearrangeFilter.php b/core/modules/views_ui/src/Form/Ajax/RearrangeFilter.php index a17d361..7711c99 100644 --- a/core/modules/views_ui/src/Form/Ajax/RearrangeFilter.php +++ b/core/modules/views_ui/src/Form/Ajax/RearrangeFilter.php @@ -135,9 +135,9 @@ public function buildForm(array $form, FormStateInterface $form_state) { 'class' => array('views-remove-group'), ), '#group' => $id, - '#ajax' => array( + '#ajax' => [ 'path' => $this->getRequest()->getRequestUri(), - ) + ] ); } $group_options[$id] = $id == 1 ? $this->t('Default group') : $this->t('Group @group', array('@group' => $id)); @@ -219,9 +219,9 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#value' => $this->t('Create new filter group'), '#id' => 'views-add-group', '#group' => 'add', - '#ajax' => array( + '#ajax' => [ 'path' => $this->getRequest()->getRequestUri(), - ), + ] ); return $form; diff --git a/core/modules/views_ui/src/Tests/FilterUITest.php b/core/modules/views_ui/src/Tests/FilterUITest.php index 5fc43e6..f90900d 100644 --- a/core/modules/views_ui/src/Tests/FilterUITest.php +++ b/core/modules/views_ui/src/Tests/FilterUITest.php @@ -16,30 +16,32 @@ */ class FilterUITest extends ViewTestBase { - /** * Views used by this test. * * @var array */ - public static $testViews = array('test_filter_in_operator_ui', 'test_filter_groups'); + public static $testViews = ['test_filter_in_operator_ui', 'test_filter_groups']; /** * Modules to enable. * * @var array */ - public static $modules = array('views_ui', 'node'); + public static $modules = ['views_ui', 'node']; + /** + * {@inheritdoc} + */ protected function setUp() { parent::setUp(); - $this->drupalCreateContentType(array('type' => 'page')); + $this->drupalCreateContentType(['type' => 'page']); $this->enableViewsTestModule(); } /** - * Tests that "Limit list to selected items" option is saved as expected when editing - * the Content type filter from the UI. + * Tests that "Limit list to selected items" option is saved as expected when + * editing the Content type filter from the UI. */ public function testFilterInOperatorUi() { $admin_user = $this->drupalCreateUser(array('administer views', 'administer site configuration')); @@ -49,9 +51,9 @@ public function testFilterInOperatorUi() { $this->drupalGet($path); $this->assertFieldByName('options[expose][reduce]', FALSE); - $edit = array( - 'options[expose][reduce]' => TRUE, - ); + $edit = [ + 'options[expose][reduce]' => TRUE + ]; $this->drupalPostForm($path, $edit, t('Apply')); $this->drupalGet($path); $this->assertFieldByName('options[expose][reduce]', TRUE); @@ -61,7 +63,7 @@ public function testFilterInOperatorUi() { * Tests the filters from the UI. */ public function testFiltersUI() { - $admin_user = $this->drupalCreateUser(array('administer views', 'administer site configuration')); + $admin_user = $this->drupalCreateUser(['administer views', 'administer site configuration']); $this->drupalLogin($admin_user); // Tests that we can create a new filter group from UI. @@ -69,21 +71,20 @@ public function testFiltersUI() { $this->assertNoRaw('Group 3', 'Group 3 has not been added yet.'); // Create 2 new groups. - $this->drupalPostForm(NULL, array(), t('Create new filter group')); - $this->drupalPostForm(NULL, array(), t('Create new filter group')); + $this->drupalPostForm(NULL, [], t('Create new filter group')); + $this->drupalPostForm(NULL, [], t('Create new filter group')); // Remove the new group 3. - $this->drupalPostForm(NULL, array(), t('Remove group 3')); + $this->drupalPostForm(NULL, [], t('Remove group 3')); // Verify that the group 4 is now named as 3. $this->assertRaw('Group 3', 'Group 3 still exists.'); // Remove the group 3 again. - $this->drupalPostForm(NULL, array(), t('Remove group 3')); + $this->drupalPostForm(NULL, [], t('Remove group 3')); // Group 3 now does not exist. $this->assertNoRaw('Group 3', 'Group 3 has not been added yet.'); - } }