LanguageConfigSchemaTest.php in Zircon Profile 8.0
File
core/modules/language/src/Tests/LanguageConfigSchemaTest.php
View source
<?php
namespace Drupal\language\Tests;
use Drupal\config\Tests\SchemaCheckTestTrait;
use Drupal\simpletest\WebTestBase;
class LanguageConfigSchemaTest extends WebTestBase {
use SchemaCheckTestTrait;
public static $modules = array(
'language',
'menu_link_content',
);
protected $adminUser;
protected function setUp() {
parent::setUp();
$this->adminUser = $this
->drupalCreateUser(array(
'administer languages',
));
$this
->drupalLogin($this->adminUser);
}
function testValidLanguageConfigSchema() {
$config_data = $this
->config('language.settings')
->get();
$this
->assertTrue(empty($config_data));
$settings_path = 'admin/config/regional/content-language';
$edit['entity_types[menu_link_content]'] = TRUE;
$edit['settings[menu_link_content][menu_link_content][settings][language][language_alterable]'] = TRUE;
$edit['entity_types[user]'] = TRUE;
$edit['settings[user][user][settings][language][language_alterable]'] = TRUE;
$edit['settings[user][user][settings][language][langcode]'] = 'en';
$this
->drupalPostForm($settings_path, $edit, t('Save configuration'));
$config_data = $this
->config('language.content_settings.menu_link_content.menu_link_content');
$this
->assertTrue($config_data
->get('language_alterable'));
$this
->assertConfigSchema(\Drupal::service('config.typed'), $config_data
->getName(), $config_data
->get());
}
}