Further Drupal 8.6.4 changes. Some core files were not committed before a commit...
[yaffs-website] / web / core / modules / views / tests / src / Functional / Entity / ViewNonTranslatableEntityTest.php
1 <?php
2
3 namespace Drupal\Tests\views\Functional\Entity;
4
5 use Drupal\language\Entity\ConfigurableLanguage;
6 use Drupal\language_test\Entity\NoLanguageEntityTest;
7 use Drupal\Tests\BrowserTestBase;
8
9 /**
10  * Tests the view creation of non-translatable entities.
11  *
12  * @group views
13  */
14 class ViewNonTranslatableEntityTest extends BrowserTestBase {
15
16   /**
17    * Modules to enable.
18    *
19    * @var array
20    */
21   public static $modules = [
22     'entity_test',
23     'content_translation',
24     'language_test',
25     'views_ui',
26   ];
27
28   /**
29    * Tests displaying a view of non-translatable entities.
30    */
31   public function testViewNoTranslatableEntity() {
32     // Add a new language.
33     ConfigurableLanguage::createFromLangcode('sr')->save();
34
35     // Create a non-translatable entity.
36     $no_language_entity = NoLanguageEntityTest::create();
37     $no_language_entity->save();
38
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());
44   }
45
46 }