public function LingotekFieldBodyTranslationTest::testUploadingWithAPaymentRequiredErrorViaAutomaticUpload in Lingotek Translation 3.0.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/LingotekFieldBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyTranslationTest::testUploadingWithAPaymentRequiredErrorViaAutomaticUpload()
- 4.0.x tests/src/Functional/LingotekFieldBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyTranslationTest::testUploadingWithAPaymentRequiredErrorViaAutomaticUpload()
- 3.1.x tests/src/Functional/LingotekFieldBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyTranslationTest::testUploadingWithAPaymentRequiredErrorViaAutomaticUpload()
- 3.2.x tests/src/Functional/LingotekFieldBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyTranslationTest::testUploadingWithAPaymentRequiredErrorViaAutomaticUpload()
- 3.3.x tests/src/Functional/LingotekFieldBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyTranslationTest::testUploadingWithAPaymentRequiredErrorViaAutomaticUpload()
- 3.4.x tests/src/Functional/LingotekFieldBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyTranslationTest::testUploadingWithAPaymentRequiredErrorViaAutomaticUpload()
- 3.5.x tests/src/Functional/LingotekFieldBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyTranslationTest::testUploadingWithAPaymentRequiredErrorViaAutomaticUpload()
- 3.6.x tests/src/Functional/LingotekFieldBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyTranslationTest::testUploadingWithAPaymentRequiredErrorViaAutomaticUpload()
- 3.7.x tests/src/Functional/LingotekFieldBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyTranslationTest::testUploadingWithAPaymentRequiredErrorViaAutomaticUpload()
- 3.8.x tests/src/Functional/LingotekFieldBodyTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekFieldBodyTranslationTest::testUploadingWithAPaymentRequiredErrorViaAutomaticUpload()
Test that we handle errors in upload.
File
- tests/src/ Functional/ LingotekFieldBodyTranslationTest.php, line 641 
Class
- LingotekFieldBodyTranslationTest
- Tests translating a field.
Namespace
Drupal\Tests\lingotek\FunctionalCode
public function testUploadingWithAPaymentRequiredErrorViaAutomaticUpload() {
  \Drupal::state()
    ->set('lingotek.must_payment_required_error_in_upload', TRUE);
  $this
    ->drupalGet('admin/lingotek/settings');
  // Create a field.
  $edit = [
    'label' => 'Excerpt',
    'new_storage_type' => 'text',
    'field_name' => 'excerpt',
  ];
  $this
    ->drupalPostForm('/admin/structure/types/manage/article/fields/add-field', $edit, 'Save and continue');
  // The document was uploaded automatically and failed.
  $this
    ->assertText('Community has been disabled. Please contact support@lingotek.com to re-enable your community.');
  // The field has been marked with the error status.
  $fieldConfig = FieldConfig::load('node.article.field_excerpt');
  /** @var \Drupal\lingotek\LingotekConfigTranslationServiceInterface $translation_service */
  $translation_service = \Drupal::service('lingotek.config_translation');
  $source_status = $translation_service
    ->getSourceStatus($fieldConfig);
  $this
    ->assertEqual(Lingotek::STATUS_ERROR, $source_status, 'The field has been marked as error.');
}