Update to Drupal 8.0.1. For more information, see https://www.drupal.org/node/2627402

This commit is contained in:
Pantheon Automation 2015-12-02 11:38:43 -08:00 committed by Greg Anderson
parent 013aaaf2ff
commit 1a0e9d9fac
153 changed files with 1268 additions and 670 deletions

View file

@ -181,8 +181,8 @@ class LanguageNegotiationContentEntity extends LanguageNegotiationMethodBase imp
* \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationContentEntity::processOutbound().
*
* @return bool
* TRUE if the the content entity language negotiator has higher priority
* than the url language negotiator, FALSE otherwise.
* TRUE if the content entity language negotiator has higher priority than
* the url language negotiator, FALSE otherwise.
*/
protected function hasLowerLanguageNegotiationWeight() {
if (!isset($this->hasLowerLanguageNegotiationWeightResult)) {

View file

@ -23,14 +23,14 @@ class LanguageNegotiationInfoTest extends WebTestBase {
*
* @var array
*/
public static $modules = array('language');
public static $modules = ['language', 'content_translation'];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$admin_user = $this->drupalCreateUser(array('administer languages', 'access administration pages', 'view the administration theme'));
$admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages', 'view the administration theme', 'administer modules']);
$this->drupalLogin($admin_user);
$this->drupalPostForm('admin/config/regional/language/add', array('predefined_langcode' => 'it'), t('Add language'));
}
@ -174,4 +174,41 @@ class LanguageNegotiationInfoTest extends WebTestBase {
}
}
}
/**
* Tests altering config of configurable language types.
*/
public function testConfigLangTypeAlterations() {
// Default of config.
$test_type = LanguageInterface::TYPE_CONTENT;
$this->assertFalse($this->isLanguageTypeConfigurable($test_type), 'Language type is not configurable.');
// Editing config.
$edit = [$test_type . '[configurable]' => TRUE];
$this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings'));
$this->assertTrue($this->isLanguageTypeConfigurable($test_type), 'Language type is now configurable.');
// After installing another module, the config should be the same.
$this->drupalPostForm('admin/modules', ['modules[Testing][test_module][enable]' => 1], t('Install'));
$this->assertTrue($this->isLanguageTypeConfigurable($test_type), 'Language type is still configurable.');
// After uninstalling the other module, the config should be the same.
$this->drupalPostForm('admin/modules/uninstall', ['uninstall[test_module]' => 1], t('Uninstall'));
$this->assertTrue($this->isLanguageTypeConfigurable($test_type), 'Language type is still configurable.');
}
/**
* Checks whether the given language type is configurable.
*
* @param string $type
* The language type.
*
* @return bool
* TRUE if the specified language type is configurable, FALSE otherwise.
*/
protected function isLanguageTypeConfigurable($type) {
$configurable_types = $this->config('language.types')->get('configurable');
return in_array($type, $configurable_types);
}
}