public function LingotekContentModerationTest::testDownloadWithInvalidTransition in Lingotek Translation 3.6.x
Same name and namespace in other branches
- 4.0.x tests/src/Functional/LingotekContentModerationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentModerationTest::testDownloadWithInvalidTransition()
- 3.5.x tests/src/Functional/LingotekContentModerationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentModerationTest::testDownloadWithInvalidTransition()
- 3.7.x tests/src/Functional/LingotekContentModerationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentModerationTest::testDownloadWithInvalidTransition()
- 3.8.x tests/src/Functional/LingotekContentModerationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentModerationTest::testDownloadWithInvalidTransition()
File
- tests/src/Functional/LingotekContentModerationTest.php, line 373
Class
- LingotekContentModerationTest
- Tests setting up the integration with content moderation.
Namespace
Drupal\Tests\lingotek\Functional
Code
public function testDownloadWithInvalidTransition() {
$this
->configureNeedsReviewAsUploadState();
$edit = [];
$edit['title[0][value]'] = 'Llamas are cool';
$edit['body[0][value]'] = 'Llamas are very cool';
$edit['langcode[0][value]'] = 'en';
$edit['lingotek_translation_management[lingotek_translation_profile]'] = 'automatic';
$this
->saveAsNewDraftNodeForm($edit, 'article');
$this
->config('lingotek.settings')
->set('translate.entity.node.article.content_moderation.download_transition', 'invalid_transition')
->save();
$value = $this
->xpath('//div[@id="edit-current"]/text()');
$value = trim($value[1]
->getText());
$this
->assertEquals($value, 'Draft', 'Workbench current status is draft');
$edit = [
'new_state' => 'needs_review',
];
$this
->drupalPostForm(NULL, $edit, 'Apply');
$value = $this
->xpath('//div[@id="edit-current"]/text()');
$value = trim($value[1]
->getText());
$this
->assertEquals($value, 'Needs Review', 'Workbench current status is Needs Review');
$this
->goToContentBulkManagementForm();
$this
->clickLink('ES');
$this
->clickLink('ES');
$this
->clickLink('ES');
$this
->assertText('The translation of node Llamas are cool into es_MX has been downloaded.');
$this
->clickLink('Llamas are cool');
$value = $this
->xpath('//div[@id="edit-current"]/text()');
$value = trim($value[1]
->getText());
$this
->assertEquals($value, 'Needs Review', 'Content moderation current status is Needs Review');
}