public function EasyEmailTemplateCreateTest::testCreateNoFromOrReplyToAddressTemplate in Easy Email 8
Same name and namespace in other branches
- 2.0.x tests/src/Functional/EasyEmailTemplateCreateTest.php \Drupal\Tests\easy_email\Functional\EasyEmailTemplateCreateTest::testCreateNoFromOrReplyToAddressTemplate()
Tests template create/edit form with no Reply To field
Throws
\Behat\Mink\Exception\ExpectationException
\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
\Drupal\Component\Plugin\Exception\PluginNotFoundException
\Drupal\Core\Entity\EntityStorageException
File
- tests/
src/ Functional/ EasyEmailTemplateCreateTest.php, line 476
Class
- EasyEmailTemplateCreateTest
- Class EasyEmailTemplateCreateTest
Namespace
Drupal\Tests\easy_email\FunctionalCode
public function testCreateNoFromOrReplyToAddressTemplate() {
$template = $this
->createTemplate([
'id' => 'test_no_from_or_reply_to',
'label' => 'Test: No From or Reply To',
]);
$this
->drupalGet('admin/structure/email-templates/templates/' . $template
->id() . '/edit/fields/easy_email.' . $template
->id() . '.reply_to/delete');
$this
->submitForm([], 'Delete');
$this
->drupalGet('admin/structure/email-templates/templates/' . $template
->id() . '/edit/fields/easy_email.' . $template
->id() . '.from_address/delete');
$this
->submitForm([], 'Delete');
$this
->drupalGet('admin/structure/email-templates/templates/' . $template
->id() . '/edit/fields/easy_email.' . $template
->id() . '.from_name/delete');
$this
->submitForm([], 'Delete');
$this
->drupalGet('admin/structure/email-templates/templates/' . $template
->id() . '/edit');
$this
->assertSession()
->fieldValueEquals('Label', 'Test: No From or Reply To');
$this
->assertSession()
->fieldValueEquals('Unique Key Pattern', '');
$this
->assertSession()
->fieldValueEquals('recipient', '');
$this
->assertSession()
->fieldValueEquals('edit-cc', '');
$this
->assertSession()
->fieldValueEquals('edit-bcc', '');
$this
->assertSession()
->elementNotExists('css', 'fieldset[data-drupal-selector="edit-sender"]');
$this
->assertSession()
->fieldNotExists('From Name');
$this
->assertSession()
->fieldNotExists('From Address');
$this
->assertSession()
->fieldNotExists('Reply To Address');
$this
->assertSession()
->fieldValueEquals('Subject', '');
$this
->assertSession()
->elementExists('css', 'details[data-drupal-selector="edit-body-html"]');
$this
->assertSession()
->fieldValueEquals('HTML Body', '');
$this
->assertSession()
->fieldValueEquals('Inbox Preview', '');
$this
->assertSession()
->elementExists('css', 'details[data-drupal-selector="edit-body-plain"]');
$this
->assertSession()
->fieldValueEquals('Plain Text Body', '');
$this
->assertSession()
->fieldValueEquals('generateBodyPlain', FALSE);
$this
->assertSession()
->fieldValueEquals('Dynamic Attachments', '');
$this
->assertSession()
->fieldValueEquals('saveAttachment', FALSE);
$this
->assertSession()
->fieldValueEquals('attachmentScheme', 'private');
$this
->assertSession()
->fieldValueEquals('File Directory', '');
$this
->assertSession()
->linkExists('Browse available tokens.');
}