public function LingotekContentTypeTranslationTest::testUpdatingWithAnErrorViaAutomaticUpload in Lingotek Translation 4.0.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/LingotekContentTypeTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeTranslationTest::testUpdatingWithAnErrorViaAutomaticUpload()
- 3.0.x tests/src/Functional/LingotekContentTypeTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeTranslationTest::testUpdatingWithAnErrorViaAutomaticUpload()
- 3.1.x tests/src/Functional/LingotekContentTypeTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeTranslationTest::testUpdatingWithAnErrorViaAutomaticUpload()
- 3.2.x tests/src/Functional/LingotekContentTypeTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeTranslationTest::testUpdatingWithAnErrorViaAutomaticUpload()
- 3.3.x tests/src/Functional/LingotekContentTypeTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeTranslationTest::testUpdatingWithAnErrorViaAutomaticUpload()
- 3.4.x tests/src/Functional/LingotekContentTypeTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeTranslationTest::testUpdatingWithAnErrorViaAutomaticUpload()
- 3.5.x tests/src/Functional/LingotekContentTypeTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeTranslationTest::testUpdatingWithAnErrorViaAutomaticUpload()
- 3.6.x tests/src/Functional/LingotekContentTypeTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeTranslationTest::testUpdatingWithAnErrorViaAutomaticUpload()
- 3.7.x tests/src/Functional/LingotekContentTypeTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeTranslationTest::testUpdatingWithAnErrorViaAutomaticUpload()
- 3.8.x tests/src/Functional/LingotekContentTypeTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeTranslationTest::testUpdatingWithAnErrorViaAutomaticUpload()
Test that we handle errors in upload.
File
- tests/
src/ Functional/ LingotekContentTypeTranslationTest.php, line 589
Class
- LingotekContentTypeTranslationTest
- Tests translating a content type.
Namespace
Drupal\Tests\lingotek\FunctionalCode
public function testUpdatingWithAnErrorViaAutomaticUpload() {
// Create a content type.
$edit = [
'name' => 'Landing Page',
'type' => 'landing_page',
];
$this
->drupalPostForm('admin/structure/types/add', $edit, 'Save content type');
\Drupal::state()
->set('lingotek.must_error_in_upload', TRUE);
// Edit the content type.
$edit['name'] = 'Landing Page EDITED';
$this
->drupalPostForm('/admin/structure/types/manage/landing_page', $edit, t('Save content type'));
// The document was updated automatically and failed.
$this
->assertText('The update for node_type Landing Page EDITED failed. Please try again.');
// The node type has been marked with the error status.
$nodeType = NodeType::load('landing_page');
/** @var \Drupal\lingotek\LingotekConfigTranslationServiceInterface $translation_service */
$translation_service = \Drupal::service('lingotek.config_translation');
$source_status = $translation_service
->getSourceStatus($nodeType);
$this
->assertEqual(Lingotek::STATUS_ERROR, $source_status, 'The node type has been marked as error.');
}