Upgraded imagemagick and manually altered pdf to image module to handle changes....
[yaffs-website] / web / modules / contrib / paragraphs / src / Tests / Experimental / ParagraphsExperimentalTestBase.php
1 <?php
2
3 namespace Drupal\paragraphs\Tests\Experimental;
4
5 use Drupal\Core\Entity\Entity\EntityFormDisplay;
6 use Drupal\Core\Entity\Entity\EntityViewDisplay;
7 use Drupal\field\Entity\FieldConfig;
8 use Drupal\field\Entity\FieldStorageConfig;
9 use Drupal\field_ui\Tests\FieldUiTestTrait;
10 use Drupal\paragraphs\Tests\Classic\ParagraphsTestBase;
11 use Drupal\Tests\paragraphs\FunctionalJavascript\ParagraphsTestBaseTrait;
12
13 /**
14  * Base class for tests.
15  */
16 abstract class ParagraphsExperimentalTestBase extends ParagraphsTestBase {
17
18   use FieldUiTestTrait, ParagraphsTestBaseTrait;
19
20   /**
21    * Sets the Paragraphs widget add mode.
22    *
23    * @param string $content_type
24    *   Content type name where to set the widget mode.
25    * @param string $paragraphs_field
26    *   Paragraphs field to change the mode.
27    * @param string $mode
28    *   Mode to be set. ('dropdown', 'select' or 'button').
29    */
30   protected function setAddMode($content_type, $paragraphs_field, $mode) {
31     $form_display = EntityFormDisplay::load('node.' . $content_type . '.default')
32       ->setComponent($paragraphs_field, [
33         'type' => 'paragraphs',
34         'settings' => ['add_mode' => $mode]
35       ]);
36     $form_display->save();
37   }
38
39   /**
40    * Removes the default paragraph type.
41    *
42    * @param $content_type
43    *   Content type name that contains the paragraphs field.
44    */
45   protected function removeDefaultParagraphType($content_type) {
46     $this->drupalGet('node/add/' . $content_type);
47     $this->drupalPostForm(NULL, [], 'Remove');
48     $this->assertNoText('No paragraphs added yet.');
49   }
50
51 }