namespace Drupal\Tests\content_translation\Functional;
use Drupal\language\Entity\ConfigurableLanguage;
-use Drupal\node\Tests\NodeTestBase;
+use Drupal\Tests\node\Functional\NodeTestBase;
+use Drupal\Tests\TestFileCreationTrait;
/**
* Tests the content translation language that is set.
*/
class ContentTranslationLanguageChangeTest extends NodeTestBase {
+ use TestFileCreationTrait {
+ getTestFiles as drupalGetTestFiles;
+ }
+
/**
* Modules to enable.
*
$edit = [
'title[0][value]' => 'english_title',
];
- $this->drupalPostForm(NULL, $edit, t('Save and publish'));
+ $this->drupalPostForm(NULL, $edit, t('Save'));
// Create a translation in French.
$this->clickLink('Translate');
$this->clickLink('Add');
- $this->drupalPostForm(NULL, [], t('Save and keep published (this translation)'));
+ $this->drupalPostForm(NULL, [], t('Save (this translation)'));
$this->clickLink('Translate');
// Edit English translation.
'files[field_image_field_0]' => $images->uri,
];
$this->drupalPostForm(NULL, $edit, t('Upload'));
- $this->drupalPostForm(NULL, ['field_image_field[0][alt]' => 'alternative_text'], t('Save and keep published (this translation)'));
+ $this->drupalPostForm(NULL, ['field_image_field[0][alt]' => 'alternative_text'], t('Save (this translation)'));
// Check that the translation languages are correct.
$node = $this->getNodeByTitle('english_title');
'title[0][value]' => 'english_title',
'test_field_only_en_fr' => 'node created',
];
- $this->drupalPostForm(NULL, $edit, t('Save and publish'));
+ $this->drupalPostForm(NULL, $edit, t('Save'));
$this->assertEqual('node created', \Drupal::state()->get('test_field_only_en_fr'));
// Create a translation in French.
$this->clickLink('Translate');
$this->clickLink('Add');
- $this->drupalPostForm(NULL, [], t('Save and keep published (this translation)'));
+ $this->drupalPostForm(NULL, [], t('Save (this translation)'));
$this->clickLink('Translate');
// Edit English translation.
$this->assertRaw('<title>Edit Article english_title | Drupal</title>');
$edit = [
'langcode[0][value]' => 'en',
- 'field_image_field[0][alt]' => 'alternative_text'
+ 'field_image_field[0][alt]' => 'alternative_text',
];
- $this->drupalPostForm(NULL, $edit, t('Save and keep published (this translation)'));
+ $this->drupalPostForm(NULL, $edit, t('Save (this translation)'));
// Check that the translation languages are correct.
$node = $this->getNodeByTitle('english_title');