Upgraded imagemagick and manually altered pdf to image module to handle changes....
[yaffs-website] / web / modules / contrib / entity_reference_revisions / src / Tests / EntityReferenceRevisionsCoreVersionUiTestTrait.php
1 <?php
2
3 namespace Drupal\entity_reference_revisions\Tests;
4
5 /**
6  * Provides helper methods for Drupal 8.3.x and 8.4.x versions.
7  */
8 trait EntityReferenceRevisionsCoreVersionUiTestTrait {
9
10   /**
11    * An adapter for 8.3 > 8.4 Save (and (un)publish) node button change.
12    *
13    * @see \Drupal\simpletest\WebTestBase::drupalPostForm
14    * @see https://www.drupal.org/node/2847274
15    */
16   protected function drupalPostNodeForm($path, $edit, $submit, array $options = [], array $headers = [], $form_html_id = NULL, $extra_post = NULL) {
17     $drupal_version = (float) substr(\Drupal::VERSION, 0, 3);
18     if ($drupal_version > 8.3) {
19
20       switch ($submit) {
21         case  t('Save and unpublish'):
22           $edit['status[value]'] = FALSE;
23           break;
24
25         case t('Save and publish'):
26           $edit['status[value]'] = TRUE;
27           break;
28       }
29
30       $submit = t('Save');
31     }
32     parent::drupalPostForm($path, $edit, $submit, $options, $headers, $form_html_id, $extra_post);
33   }
34
35 }