public function LingotekSourceStatusFormatterTest::testLingotekSourceStatusFormatter in Lingotek Translation 8.2
Same name in this branch
- 8.2 tests/src/Functional/FieldFormatters/LingotekSourceStatusFormatterTest.php \Drupal\Tests\lingotek\Functional\FieldFormatters\LingotekSourceStatusFormatterTest::testLingotekSourceStatusFormatter()
- 8.2 src/Tests/Kernel/FieldFormatters/LingotekSourceStatusFormatterTest.php \Drupal\lingotek\Tests\Kernel\FieldFormatters\LingotekSourceStatusFormatterTest::testLingotekSourceStatusFormatter()
Same name and namespace in other branches
- 4.0.x src/Tests/Kernel/FieldFormatters/LingotekSourceStatusFormatterTest.php \Drupal\lingotek\Tests\Kernel\FieldFormatters\LingotekSourceStatusFormatterTest::testLingotekSourceStatusFormatter()
- 3.0.x src/Tests/Kernel/FieldFormatters/LingotekSourceStatusFormatterTest.php \Drupal\lingotek\Tests\Kernel\FieldFormatters\LingotekSourceStatusFormatterTest::testLingotekSourceStatusFormatter()
- 3.1.x src/Tests/Kernel/FieldFormatters/LingotekSourceStatusFormatterTest.php \Drupal\lingotek\Tests\Kernel\FieldFormatters\LingotekSourceStatusFormatterTest::testLingotekSourceStatusFormatter()
- 3.2.x src/Tests/Kernel/FieldFormatters/LingotekSourceStatusFormatterTest.php \Drupal\lingotek\Tests\Kernel\FieldFormatters\LingotekSourceStatusFormatterTest::testLingotekSourceStatusFormatter()
- 3.3.x src/Tests/Kernel/FieldFormatters/LingotekSourceStatusFormatterTest.php \Drupal\lingotek\Tests\Kernel\FieldFormatters\LingotekSourceStatusFormatterTest::testLingotekSourceStatusFormatter()
- 3.4.x src/Tests/Kernel/FieldFormatters/LingotekSourceStatusFormatterTest.php \Drupal\lingotek\Tests\Kernel\FieldFormatters\LingotekSourceStatusFormatterTest::testLingotekSourceStatusFormatter()
- 3.5.x src/Tests/Kernel/FieldFormatters/LingotekSourceStatusFormatterTest.php \Drupal\lingotek\Tests\Kernel\FieldFormatters\LingotekSourceStatusFormatterTest::testLingotekSourceStatusFormatter()
- 3.6.x src/Tests/Kernel/FieldFormatters/LingotekSourceStatusFormatterTest.php \Drupal\lingotek\Tests\Kernel\FieldFormatters\LingotekSourceStatusFormatterTest::testLingotekSourceStatusFormatter()
- 3.7.x src/Tests/Kernel/FieldFormatters/LingotekSourceStatusFormatterTest.php \Drupal\lingotek\Tests\Kernel\FieldFormatters\LingotekSourceStatusFormatterTest::testLingotekSourceStatusFormatter()
- 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\FieldFormattersCode
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);
}