function ConfigTranslationListUiTest::testContactFormsList
Tests the contact forms listing for the translate operation.
File
- 
              core/modules/ contact/ tests/ src/ Functional/ ConfigTranslationListUiTest.php, line 71 
Class
- ConfigTranslationListUiTest
- Ensure the "translate" link is added to contact forms.
Namespace
Drupal\Tests\contact\FunctionalCode
public function testContactFormsList() : void {
  // Create a test contact form to decouple looking for translate operations
  // link so this does not test more than necessary.
  $contact_form = ContactForm::create([
    'id' => $this->randomMachineName(16),
    'label' => $this->randomMachineName(),
  ]);
  $contact_form->save();
  // Get the contact form listing.
  $this->drupalGet('admin/structure/contact');
  $translate_link = 'admin/structure/contact/manage/' . $contact_form->id() . '/translate';
  // Test if the link to translate the contact form is on the page.
  $this->assertSession()
    ->linkByHrefExists($translate_link);
  // Test if the link to translate actually goes to the translate page.
  $this->drupalGet($translate_link);
  $this->assertSession()
    ->responseContains('<th>Language</th>');
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
