You are here

public function ViewNonTranslatableEntityTest::testViewNoTranslatableEntity in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Tests/Entity/ViewNonTranslatableEntityTest.php \Drupal\views\Tests\Entity\ViewNonTranslatableEntityTest::testViewNoTranslatableEntity()

Tests displaying a view of non-translatable entities.

File

core/modules/views/src/Tests/Entity/ViewNonTranslatableEntityTest.php, line 36
Contains \Drupal\views\Tests\Entity\ViewNonTranslatableEntityTest.

Class

ViewNonTranslatableEntityTest
Tests the view creation of non-translatable entities.

Namespace

Drupal\views\Tests\Entity

Code

public function testViewNoTranslatableEntity() {

  // Add a new language.
  ConfigurableLanguage::createFromLangcode('sr')
    ->save();

  // Create a non-translatable entity.
  $no_language_entity = NoLanguageEntityTest::create();
  $no_language_entity
    ->save();

  // Visit the view page and assert it is displayed properly.
  $this
    ->drupalGet('no-entity-translation-view');
  $this
    ->assertResponse(200);
  $this
    ->assertText('No Entity Translation View');
  $this
    ->assertText($no_language_entity
    ->uuid());
}