f7b6191484dba4753000f1226423fbc7369d3b0a
[yaffs-website] / web / core / modules / language / tests / src / Functional / EntityTypeWithoutLanguageFormTest.php
1 <?php
2
3 namespace Drupal\Tests\language\Functional;
4
5 use Drupal\Tests\BrowserTestBase;
6
7 /**
8  * Tests entity type without language support.
9  *
10  * This is to ensure that an entity type without language support can not
11  * enable the language select from the content language settings page.
12  *
13  * @group language
14  */
15 class EntityTypeWithoutLanguageFormTest extends BrowserTestBase {
16
17   /**
18    * Modules to enable.
19    *
20    * @var array
21    */
22   public static $modules = [
23     'language',
24     'language_test',
25   ];
26
27   /**
28    * {@inheritdoc}
29    */
30   protected function setUp() {
31     parent::setUp();
32
33     // Create and log in administrative user.
34     $admin_user = $this->drupalCreateUser([
35       'administer languages',
36     ]);
37     $this->drupalLogin($admin_user);
38   }
39
40   /**
41    * Tests configuration options with an entity without language definition.
42    */
43   public function testEmptyLangcode() {
44     // Assert that we can not enable language select from
45     // content language settings page.
46     $this->drupalGet('admin/config/regional/content-language');
47     $this->assertNoField('entity_types[no_language_entity_test]');
48   }
49
50 }