You are here

public function LingotekSourceStatusFormatterTest::testLingotekSourceStatusFormatter in Lingotek Translation 8.2

Same name in this branch
  1. 8.2 tests/src/Functional/FieldFormatters/LingotekSourceStatusFormatterTest.php \Drupal\Tests\lingotek\Functional\FieldFormatters\LingotekSourceStatusFormatterTest::testLingotekSourceStatusFormatter()
  2. 8.2 src/Tests/Kernel/FieldFormatters/LingotekSourceStatusFormatterTest.php \Drupal\lingotek\Tests\Kernel\FieldFormatters\LingotekSourceStatusFormatterTest::testLingotekSourceStatusFormatter()
Same name and namespace in other branches
  1. 4.0.x tests/src/Functional/FieldFormatters/LingotekSourceStatusFormatterTest.php \Drupal\Tests\lingotek\Functional\FieldFormatters\LingotekSourceStatusFormatterTest::testLingotekSourceStatusFormatter()
  2. 3.0.x tests/src/Functional/FieldFormatters/LingotekSourceStatusFormatterTest.php \Drupal\Tests\lingotek\Functional\FieldFormatters\LingotekSourceStatusFormatterTest::testLingotekSourceStatusFormatter()
  3. 3.1.x tests/src/Functional/FieldFormatters/LingotekSourceStatusFormatterTest.php \Drupal\Tests\lingotek\Functional\FieldFormatters\LingotekSourceStatusFormatterTest::testLingotekSourceStatusFormatter()
  4. 3.2.x tests/src/Functional/FieldFormatters/LingotekSourceStatusFormatterTest.php \Drupal\Tests\lingotek\Functional\FieldFormatters\LingotekSourceStatusFormatterTest::testLingotekSourceStatusFormatter()
  5. 3.3.x tests/src/Functional/FieldFormatters/LingotekSourceStatusFormatterTest.php \Drupal\Tests\lingotek\Functional\FieldFormatters\LingotekSourceStatusFormatterTest::testLingotekSourceStatusFormatter()
  6. 3.4.x tests/src/Functional/FieldFormatters/LingotekSourceStatusFormatterTest.php \Drupal\Tests\lingotek\Functional\FieldFormatters\LingotekSourceStatusFormatterTest::testLingotekSourceStatusFormatter()
  7. 3.5.x tests/src/Functional/FieldFormatters/LingotekSourceStatusFormatterTest.php \Drupal\Tests\lingotek\Functional\FieldFormatters\LingotekSourceStatusFormatterTest::testLingotekSourceStatusFormatter()
  8. 3.6.x tests/src/Functional/FieldFormatters/LingotekSourceStatusFormatterTest.php \Drupal\Tests\lingotek\Functional\FieldFormatters\LingotekSourceStatusFormatterTest::testLingotekSourceStatusFormatter()
  9. 3.7.x tests/src/Functional/FieldFormatters/LingotekSourceStatusFormatterTest.php \Drupal\Tests\lingotek\Functional\FieldFormatters\LingotekSourceStatusFormatterTest::testLingotekSourceStatusFormatter()
  10. 3.8.x tests/src/Functional/FieldFormatters/LingotekSourceStatusFormatterTest.php \Drupal\Tests\lingotek\Functional\FieldFormatters\LingotekSourceStatusFormatterTest::testLingotekSourceStatusFormatter()

Tests that if debug is not enabled, metadata tab is not available.

File

tests/src/Functional/FieldFormatters/LingotekSourceStatusFormatterTest.php, line 51

Class

LingotekSourceStatusFormatterTest
Tests the Lingotek source status field formatter.

Namespace

Drupal\Tests\lingotek\Functional\FieldFormatters

Code

public function testLingotekSourceStatusFormatter() {
  $basepath = \Drupal::request()
    ->getBasePath();

  // Create a node.
  $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
    ->saveAndPublishNodeForm($edit);
  $this
    ->assertSession()
    ->addressEquals('/node/1');
  $this
    ->drupalGet('/metadata/1');
  $this
    ->assertSession()
    ->responseContains('<span class="language-icon source-importing" title="Source importing"><a href="' . $basepath . '/admin/lingotek/entity/check_upload/dummy-document-hash-id?destination=' . $basepath . '/metadata/1">EN</a></span>');
}