You are here

public function LingotekSourceStatusFormatterTest::testLingotekSourceStatusFormatter in Lingotek Translation 3.4.x

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

Tests LingotekSourceStatusFormatter.

File

src/Tests/Kernel/FieldFormatters/LingotekSourceStatusFormatterTest.php, line 114

Class

LingotekSourceStatusFormatterTest
Tests the Lingotek source status formatter.

Namespace

Drupal\lingotek\Tests\Kernel\FieldFormatters

Code

public function testLingotekSourceStatusFormatter() {
  $expected = '<span class="language-icon source-untracked" title="Upload"><a href="/admin/lingotek/entity/upload/entity_test/1?destination=/">EN</a></span>';
  $english = ConfigurableLanguage::load('en');
  $component = $this->display
    ->getComponent($this->fieldName);
  $component['type'] = 'lingotek_source_status';
  $this->display
    ->setComponent($this->fieldName, $component);
  $entity = EntityTest::create([
    'id' => 1,
  ]);
  $entity->{$this->fieldName}->value = $english;
  $this
    ->renderEntityFields($entity, $this->display);
  $this
    ->assertRaw($expected);
}