3 namespace Drupal\entity_reference_revisions\Tests;
6 * Provides helper methods for Drupal 8.3.x and 8.4.x versions.
8 trait EntityReferenceRevisionsCoreVersionUiTestTrait {
11 * An adapter for 8.3 > 8.4 Save (and (un)publish) node button change.
13 * @see \Drupal\simpletest\WebTestBase::drupalPostForm
14 * @see https://www.drupal.org/node/2847274
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) {
21 case t('Save and unpublish'):
22 $edit['status[value]'] = FALSE;
25 case t('Save and publish'):
26 $edit['status[value]'] = TRUE;
32 parent::drupalPostForm($path, $edit, $submit, $options, $headers, $form_html_id, $extra_post);