function TermTranslationUITest::testTranslationUI

Same name in other branches
  1. 9 core/modules/taxonomy/tests/src/Functional/TermTranslationUITest.php \Drupal\Tests\taxonomy\Functional\TermTranslationUITest::testTranslationUI()
  2. 10 core/modules/taxonomy/tests/src/Functional/TermTranslationUITest.php \Drupal\Tests\taxonomy\Functional\TermTranslationUITest::testTranslationUI()
  3. 11.x core/modules/taxonomy/tests/src/Functional/TermTranslationUITest.php \Drupal\Tests\taxonomy\Functional\TermTranslationUITest::testTranslationUI()

Overrides ContentTranslationUITestBase::testTranslationUI

File

core/modules/taxonomy/tests/src/Functional/TermTranslationUITest.php, line 95

Class

TermTranslationUITest
Tests the Term Translation UI.

Namespace

Drupal\Tests\taxonomy\Functional

Code

public function testTranslationUI() {
    parent::testTranslationUI();
    // Make sure that no row was inserted for taxonomy vocabularies which do
    // not have translations enabled.
    $rows = Database::getConnection()->query('SELECT tid, count(tid) AS count FROM {taxonomy_term_field_data} WHERE vid <> :vid GROUP BY tid', [
        ':vid' => $this->bundle,
    ])
        ->fetchAll();
    foreach ($rows as $row) {
        $this->assertTrue($row->count < 2, 'Term does not have translations.');
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.