comparison core/modules/language/tests/src/Functional/LanguageConfigurationElementTest.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 4c8ae668cc8c
children
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
168 $uuid = $configuration->uuid(); 168 $uuid = $configuration->uuid();
169 $this->assertEqual($configuration->getDefaultLangcode(), 'current_interface', 'The default language configuration has been saved on the Article content type.'); 169 $this->assertEqual($configuration->getDefaultLangcode(), 'current_interface', 'The default language configuration has been saved on the Article content type.');
170 $this->assertTrue($configuration->isLanguageAlterable(), 'The alterable language configuration has been saved on the Article content type.'); 170 $this->assertTrue($configuration->isLanguageAlterable(), 'The alterable language configuration has been saved on the Article content type.');
171 // Update the article content type by changing the title label. 171 // Update the article content type by changing the title label.
172 $edit = [ 172 $edit = [
173 'title_label' => 'Name' 173 'title_label' => 'Name',
174 ]; 174 ];
175 $this->drupalPostForm('admin/structure/types/manage/article', $edit, t('Save content type')); 175 $this->drupalPostForm('admin/structure/types/manage/article', $edit, t('Save content type'));
176 // Check that we still have the settings for the updated node type. 176 // Check that we still have the settings for the updated node type.
177 $configuration = ContentLanguageSettings::loadByEntityTypeBundle('node', 'article'); 177 $configuration = ContentLanguageSettings::loadByEntityTypeBundle('node', 'article');
178 $this->assertEqual($configuration->getDefaultLangcode(), 'current_interface', 'The default language configuration has been kept on the updated Article content type.'); 178 $this->assertEqual($configuration->getDefaultLangcode(), 'current_interface', 'The default language configuration has been kept on the updated Article content type.');
187 // Create the article content type first if the profile used is not the 187 // Create the article content type first if the profile used is not the
188 // standard one. 188 // standard one.
189 if ($this->profile != 'standard') { 189 if ($this->profile != 'standard') {
190 $this->drupalCreateContentType([ 190 $this->drupalCreateContentType([
191 'type' => 'article', 191 'type' => 'article',
192 'name' => 'Article' 192 'name' => 'Article',
193 ]); 193 ]);
194 } 194 }
195 $admin_user = $this->drupalCreateUser(['administer content types']); 195 $admin_user = $this->drupalCreateUser(['administer content types']);
196 $this->drupalLogin($admin_user); 196 $this->drupalLogin($admin_user);
197 197
238 $uuid = $configuration->uuid(); 238 $uuid = $configuration->uuid();
239 $this->assertEqual($configuration->getDefaultLangcode(), 'current_interface', 'The default language configuration has been saved on the Country vocabulary.'); 239 $this->assertEqual($configuration->getDefaultLangcode(), 'current_interface', 'The default language configuration has been saved on the Country vocabulary.');
240 $this->assertTrue($configuration->isLanguageAlterable(), 'The alterable language configuration has been saved on the Country vocabulary.'); 240 $this->assertTrue($configuration->isLanguageAlterable(), 'The alterable language configuration has been saved on the Country vocabulary.');
241 // Update the vocabulary. 241 // Update the vocabulary.
242 $edit = [ 242 $edit = [
243 'name' => 'Nation' 243 'name' => 'Nation',
244 ]; 244 ];
245 $this->drupalPostForm('admin/structure/taxonomy/manage/country', $edit, t('Save')); 245 $this->drupalPostForm('admin/structure/taxonomy/manage/country', $edit, t('Save'));
246 // Check that we still have the settings for the updated vocabulary. 246 // Check that we still have the settings for the updated vocabulary.
247 $configuration = ContentLanguageSettings::loadByEntityTypeBundle('taxonomy_term', 'country'); 247 $configuration = ContentLanguageSettings::loadByEntityTypeBundle('taxonomy_term', 'country');
248 $this->assertEqual($configuration->getDefaultLangcode(), 'current_interface', 'The default language configuration has been kept on the updated Country vocabulary.'); 248 $this->assertEqual($configuration->getDefaultLangcode(), 'current_interface', 'The default language configuration has been kept on the updated Country vocabulary.');