Mercurial > hg > isophonics-drupal-site
view core/modules/taxonomy/tests/src/Functional/VocabularyTranslationTest.php @ 13:5fb285c0d0e3
Update Drupal core to 8.4.7 via Composer. Security update; I *think* we've
been lucky to get away with this so far, as we don't support self-registration
which seems to be used by the so-called "drupalgeddon 2" attack that 8.4.5
was vulnerable to.
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:33:26 +0100 |
parents | 4c8ae668cc8c |
children | 129ea1e6d783 |
line wrap: on
line source
<?php namespace Drupal\Tests\taxonomy\Functional; use Drupal\Component\Utility\Unicode; /** * Tests content translation for vocabularies. * * @group taxonomy */ class VocabularyTranslationTest extends TaxonomyTestBase { /** * {@inheritdoc} */ public static $modules = ['content_translation', 'language']; /** * {@inheritdoc} */ protected function setUp() { parent::setUp(); // Create an administrative user. $this->drupalLogin($this->drupalCreateUser([ 'administer taxonomy', 'administer content translation', ])); } /** * Tests language settings for vocabularies. */ public function testVocabularyLanguage() { $this->drupalGet('admin/structure/taxonomy/add'); // Check that the field to enable content translation is available. $this->assertField('edit-default-language-content-translation', 'The content translation checkbox is present on the page.'); // Create the vocabulary. $vid = Unicode::strtolower($this->randomMachineName()); $edit['name'] = $this->randomMachineName(); $edit['description'] = $this->randomMachineName(); $edit['langcode'] = 'en'; $edit['vid'] = $vid; $edit['default_language[content_translation]'] = TRUE; $this->drupalPostForm(NULL, $edit, t('Save')); // Check if content translation is enabled on the edit page. $this->drupalGet('admin/structure/taxonomy/manage/' . $vid); $this->assertFieldChecked('edit-default-language-content-translation', 'The content translation was correctly selected.'); } }