entityTypeId = 'user'; parent::setUp(); // Assign user 1 a language code so that the entity can be translated. $user = User::load(1); $user->langcode = 'en'; $user->save(); // Assign user 2 LANGCODE_NOT_SPECIFIED code so entity can't be translated. $user = User::load(2); $user->langcode = Language::LANGCODE_NOT_SPECIFIED; $user->save(); ViewTestData::createTestViews(get_class($this), ['content_translation_test_views']); } /** * {@inheritdoc} */ protected function getTranslatorPermissions() { $permissions = parent::getTranslatorPermissions(); $permissions[] = 'access user profiles'; return $permissions; } /** * Tests the content translation overview link field handler. */ public function testTranslationLink() { $this->drupalGet('test-entity-translations-link'); $this->assertLinkByHref('user/1/translations'); $this->assertNoLinkByHref('user/2/translations', 'The translations link is not present when content_translation_translate_access() is FALSE.'); } }