Upgraded imagemagick and manually altered pdf to image module to handle changes....
[yaffs-website] / web / modules / contrib / paragraphs / src / Tests / Classic / ParagraphsContactTest.php
1 <?php
2
3 namespace Drupal\paragraphs\Tests\Classic;
4
5 use Drupal\contact\Entity\ContactForm;
6
7 /**
8  * Tests paragraphs with contact forms.
9  *
10  * @group paragraphs
11  */
12 class ParagraphsContactTest extends ParagraphsTestBase {
13
14   /**
15    * Modules to enable.
16    *
17    * @var array
18    */
19   public static $modules = array(
20     'contact',
21   );
22
23   /**
24    * Tests adding paragraphs in contact forms.
25    */
26   public function testContactForm() {
27     $this->loginAsAdmin([
28       'administer contact forms',
29       'access site-wide contact form'
30     ]);
31     // Add a paragraph type.
32     $this->addParagraphsType('paragraphs_contact');
33     $this->addParagraphsType('text');
34
35     // Create a contact form.
36     $contact_form = ContactForm::create(['id' => 'test_contact_form']);
37     $contact_form->save();
38     // Add a paragraphs field to the contact form.
39     $this->addParagraphsField($contact_form->id(), 'paragraphs', 'contact_message', 'entity_reference_paragraphs');
40
41     // Add a paragraph to the contact form.
42     $this->drupalGet('contact/test_contact_form');
43     $this->drupalPostAjaxForm(NULL, [], 'paragraphs_paragraphs_contact_add_more');
44     // Check that the paragraph is displayed.
45     $this->assertText('paragraphs_contact');
46     $this->drupalPostAjaxForm(NULL, [], 'paragraphs_0_remove');
47     $this->assertText('Deleted Paragraph: paragraphs_contact');
48   }
49 }