Mercurial > hg > isophonics-drupal-site
diff core/modules/contact/tests/src/Functional/ContactSitewideTest.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 4c8ae668cc8c |
children | af1871eacc83 |
line wrap: on
line diff
--- a/core/modules/contact/tests/src/Functional/ContactSitewideTest.php Tue Jul 10 15:07:59 2018 +0100 +++ b/core/modules/contact/tests/src/Functional/ContactSitewideTest.php Thu Feb 28 13:21:36 2019 +0000 @@ -2,13 +2,12 @@ namespace Drupal\Tests\contact\Functional; -use Drupal\Component\Utility\Unicode; use Drupal\contact\Entity\ContactForm; use Drupal\Core\Mail\MailFormatHelper; use Drupal\Core\Test\AssertMailTrait; -use Drupal\field_ui\Tests\FieldUiTestTrait; use Drupal\Tests\BrowserTestBase; use Drupal\Core\Entity\EntityTypeInterface; +use Drupal\Tests\field_ui\Traits\FieldUiTestTrait; use Drupal\user\RoleInterface; /** @@ -101,7 +100,7 @@ // field_ui enabled admin/structure/contact/manage/personal/fields exists. // @todo: See https://www.drupal.org/node/2031223 for the above. $edit_link = $this->xpath('//a[@href=:href]', [ - ':href' => \Drupal::url('entity.contact_form.edit_form', ['contact_form' => 'personal']) + ':href' => \Drupal::url('entity.contact_form.edit_form', ['contact_form' => 'personal']), ]); $this->assertTrue(empty($edit_link), format_string('No link containing href %href found.', ['%href' => 'admin/structure/contact/manage/personal'] @@ -149,9 +148,9 @@ $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 = Unicode::strtolower($this->randomMachineName($max_length_exceeded)), $label = $this->randomMachineName($max_length_exceeded), implode(',', [$recipients[0]]), '', TRUE); + $this->addContactForm($id = mb_strtolower($this->randomMachineName($max_length_exceeded)), $label = $this->randomMachineName($max_length_exceeded), implode(',', [$recipients[0]]), '', TRUE); $this->assertText(format_string('Machine-readable name cannot be longer than @max characters but is currently @exceeded characters long.', ['@max' => $max_length, '@exceeded' => $max_length_exceeded])); - $this->addContactForm($id = Unicode::strtolower($this->randomMachineName($max_length)), $label = $this->randomMachineName($max_length), implode(',', [$recipients[0]]), '', TRUE); + $this->addContactForm($id = mb_strtolower($this->randomMachineName($max_length)), $label = $this->randomMachineName($max_length), implode(',', [$recipients[0]]), '', TRUE); $this->assertText(t('Contact form @label has been added.', ['@label' => $label])); // Verify that the creation message contains a link to a contact form. @@ -159,7 +158,7 @@ $this->assert(isset($view_link), 'The message area contains a link to a contact form.'); // Create first valid form. - $this->addContactForm($id = Unicode::strtolower($this->randomMachineName(16)), $label = $this->randomMachineName(16), implode(',', [$recipients[0]]), '', TRUE); + $this->addContactForm($id = mb_strtolower($this->randomMachineName(16)), $label = $this->randomMachineName(16), implode(',', [$recipients[0]]), '', TRUE); $this->assertText(t('Contact form @label has been added.', ['@label' => $label])); // Verify that the creation message contains a link to a contact form. @@ -202,10 +201,10 @@ $this->drupalLogin($admin_user); // Add more forms. - $this->addContactForm(Unicode::strtolower($this->randomMachineName(16)), $label = $this->randomMachineName(16), implode(',', [$recipients[0], $recipients[1]]), '', FALSE); + $this->addContactForm(mb_strtolower($this->randomMachineName(16)), $label = $this->randomMachineName(16), implode(',', [$recipients[0], $recipients[1]]), '', FALSE); $this->assertText(t('Contact form @label has been added.', ['@label' => $label])); - $this->addContactForm($name = Unicode::strtolower($this->randomMachineName(16)), $label = $this->randomMachineName(16), implode(',', [$recipients[0], $recipients[1], $recipients[2]]), '', FALSE); + $this->addContactForm($name = mb_strtolower($this->randomMachineName(16)), $label = $this->randomMachineName(16), implode(',', [$recipients[0], $recipients[1], $recipients[2]]), '', FALSE); $this->assertText(t('Contact form @label has been added.', ['@label' => $label])); // Try adding a form that already exists. @@ -270,7 +269,7 @@ $label = $this->randomMachineName(16); $recipients = implode(',', [$recipients[0], $recipients[1], $recipients[2]]); - $contact_form = Unicode::strtolower($this->randomMachineName(16)); + $contact_form = mb_strtolower($this->randomMachineName(16)); $this->addContactForm($contact_form, $label, $recipients, '', FALSE); $this->drupalGet('admin/structure/contact'); $this->clickLink(t('Edit')); @@ -300,7 +299,7 @@ $this->assertResponse(200); // Create a simple textfield. - $field_name = Unicode::strtolower($this->randomMachineName()); + $field_name = mb_strtolower($this->randomMachineName()); $field_label = $this->randomMachineName(); $this->fieldUIAddNewField(NULL, $field_name, $field_label, 'text'); $field_name = 'field_' . $field_name; @@ -406,7 +405,7 @@ 'administer contact forms', 'administer permissions', 'administer users', - 'access site reports' + 'access site reports', ]); $this->drupalLogin($admin_user);