X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Ffield_ui%2Fsrc%2FTests%2FManageDisplayTest.php;h=4975299947c973ecdb33906a7666f8eca0481e9c;hb=5b8bb166bfa98770daef9de5c127fc2e6ef02340;hp=7ba011e08eac6b0a3f2bc6e1eb7be6591099987c;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/core/modules/field_ui/src/Tests/ManageDisplayTest.php b/web/core/modules/field_ui/src/Tests/ManageDisplayTest.php index 7ba011e08..497529994 100644 --- a/web/core/modules/field_ui/src/Tests/ManageDisplayTest.php +++ b/web/core/modules/field_ui/src/Tests/ManageDisplayTest.php @@ -2,7 +2,6 @@ namespace Drupal\field_ui\Tests; -use Drupal\Component\Utility\Unicode; use Drupal\Core\Entity\Entity\EntityFormDisplay; use Drupal\Core\Entity\Entity\EntityViewDisplay; use Drupal\Core\Entity\EntityInterface; @@ -48,7 +47,7 @@ class ManageDisplayTest extends WebTestBase { $vocabulary = Vocabulary::create([ 'name' => $this->randomMachineName(), 'description' => $this->randomMachineName(), - 'vid' => Unicode::strtolower($this->randomMachineName()), + 'vid' => mb_strtolower($this->randomMachineName()), 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED, 'help' => '', 'nodes' => ['article' => 'article'], @@ -85,7 +84,7 @@ class ManageDisplayTest extends WebTestBase { // Check whether formatter weights are respected. $result = $this->xpath('//select[@id=:id]/option', [':id' => 'edit-fields-field-test-type']); - $options = array_map(function($item) { + $options = array_map(function ($item) { return (string) $item->attributes()->value[0]; }, $result); $expected_options = [ @@ -119,7 +118,7 @@ class ManageDisplayTest extends WebTestBase { $edit = [ 'fields[field_test][type]' => 'field_test_multiple', 'fields[field_test][region]' => 'content', - 'refresh_rows' => 'field_test' + 'refresh_rows' => 'field_test', ]; $this->drupalPostAjaxForm(NULL, $edit, ['op' => t('Refresh')]); $format = 'field_test_multiple'; @@ -247,11 +246,12 @@ class ManageDisplayTest extends WebTestBase { // Check whether widget weights are respected. $result = $this->xpath('//select[@id=:id]/option', [':id' => 'edit-fields-field-test-type']); - $options = array_map(function($item) { + $options = array_map(function ($item) { return (string) $item->attributes()->value[0]; }, $result); $expected_options = [ 'test_field_widget', + 'test_field_widget_multilingual', 'test_field_widget_multiple', ]; $this->assertEqual($options, $expected_options, 'The expected widget ordering is respected.'); @@ -313,8 +313,8 @@ class ManageDisplayTest extends WebTestBase { $this->drupalGet($manage_display); // Checks if the select elements contain the specified options. - $this->assertFieldSelectOptions('fields[field_test][type]', ['test_field_widget', 'test_field_widget_multiple']); - $this->assertFieldSelectOptions('fields[field_onewidgetfield][type]', ['test_field_widget']); + $this->assertFieldSelectOptions('fields[field_test][type]', ['test_field_widget', 'test_field_widget_multilingual', 'test_field_widget_multiple']); + $this->assertFieldSelectOptions('fields[field_onewidgetfield][type]', ['test_field_widget', 'test_field_widget_multilingual']); // Ensure that fields can be hidden directly by changing the region. $this->assertFieldByName('fields[field_test][region]', 'content'); @@ -452,7 +452,7 @@ class ManageDisplayTest extends WebTestBase { /** * Asserts that a string is found in the rendered node in a view mode. * - * @param EntityInterface $node + * @param \Drupal\Core\Entity\EntityInterface $node * The node. * @param $view_mode * The view mode in which the node should be displayed. @@ -471,7 +471,7 @@ class ManageDisplayTest extends WebTestBase { /** * Asserts that a string is not found in the rendered node in a view mode. * - * @param EntityInterface $node + * @param \Drupal\Core\Entity\EntityInterface $node * The node. * @param $view_mode * The view mode in which the node should be displayed. @@ -487,12 +487,12 @@ class ManageDisplayTest extends WebTestBase { } /** - * Asserts that a string is (not) found in the rendered nodein a view mode. + * Asserts that a string is (not) found in the rendered node in a view mode. * * This helper function is used by assertNodeViewText() and * assertNodeViewNoText(). * - * @param EntityInterface $node + * @param \Drupal\Core\Entity\EntityInterface $node * The node. * @param $view_mode * The view mode in which the node should be displayed.