3 namespace Drupal\Tests\diff\Functional;
6 * Maintains differences between 8.3.x and 8.4.x for tests.
8 trait CoreVersionUiTestTrait {
11 * Posts the node form depending on core version.
13 * @param string|\Drupal\Core\Url $path
14 * The path to post the form.
16 * An array of values to post.
17 * @param string $submit
18 * The label of the submit button to post.
20 protected function drupalPostNodeForm($path, array $edit, $submit) {
21 if (!version_compare(\Drupal::VERSION, '8.4', '<')) {
22 // Check for translations.
23 if (strpos($submit, 'translation') !== FALSE) {
24 $submit = t('Save (this translation)');
27 // Form button is back to simply 'Save'.
31 // Check the publish checkbox.
32 if (strpos($submit, 'publish') !== FALSE) {
33 $edit['status[value]'] = 1;
36 $this->drupalPostForm($path, $edit, $submit);