3 namespace Drupal\Tests\views\Functional\Entity;
5 use Drupal\language\Entity\ConfigurableLanguage;
6 use Drupal\language_test\Entity\NoLanguageEntityTest;
7 use Drupal\Tests\BrowserTestBase;
10 * Tests the view creation of non-translatable entities.
14 class ViewNonTranslatableEntityTest extends BrowserTestBase {
21 public static $modules = [
23 'content_translation',
29 * Tests displaying a view of non-translatable entities.
31 public function testViewNoTranslatableEntity() {
32 // Add a new language.
33 ConfigurableLanguage::createFromLangcode('sr')->save();
35 // Create a non-translatable entity.
36 $no_language_entity = NoLanguageEntityTest::create();
37 $no_language_entity->save();
39 // Visit the view page and assert it is displayed properly.
40 $this->drupalGet('no-entity-translation-view');
41 $this->assertResponse(200);
42 $this->assertText('No Entity Translation View');
43 $this->assertText($no_language_entity->uuid());