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

@ -7,7 +7,7 @@
namespace Drupal\locale;
use Drupal\Core\Config\InstallStorage;
use Drupal\Core\Config\ExtensionInstallStorage;
use Drupal\Core\Config\StorageInterface;
use Drupal\language\ConfigurableLanguageManagerInterface;
@ -66,8 +66,8 @@ class LocaleDefaultConfigStorage {
$this->configStorage = $config_storage;
$this->languageManager = $language_manager;
$this->requiredInstallStorage = new InstallStorage();
$this->optionalInstallStorage = new InstallStorage(InstallStorage::CONFIG_OPTIONAL_DIRECTORY);
$this->requiredInstallStorage = new ExtensionInstallStorage($this->configStorage);
$this->optionalInstallStorage = new ExtensionInstallStorage($this->configStorage, ExtensionInstallStorage::CONFIG_OPTIONAL_DIRECTORY);
}
/**

View file

@ -61,4 +61,17 @@ class LocaleConfigManagerTest extends KernelTestBase {
$this->assertFalse($translation_after->isNew());
$translation_after->setString('updated_translation')->save();
}
/**
* Tests getDefaultConfigLangcode().
*/
public function testGetDefaultConfigLangcode() {
// Install the Language module's configuration so we can use the
// module_installer service.
$this->installConfig(['language']);
$this->assertNull(\Drupal::service('locale.config_manager')->getDefaultConfigLangcode('locale_test_translate.settings'), 'Before installing a module the locale config manager can not access the shipped configuration.');
\Drupal::service('module_installer')->install(['locale_test_translate']);
$this->assertEqual('en', \Drupal::service('locale.config_manager')->getDefaultConfigLangcode('locale_test_translate.settings'), 'After installing a module the locale config manager can get the shipped configuration langcode.');
}
}

View file

@ -17,6 +17,13 @@ use Drupal\simpletest\WebTestBase;
*/
class LocalePluralFormatTest extends WebTestBase {
/**
* An admin user.
*
* @var \Drupal\user\Entity\User
*/
protected $adminUser;
/**
* Modules to enable.
*
@ -30,8 +37,8 @@ class LocalePluralFormatTest extends WebTestBase {
protected function setUp() {
parent::setUp();
$admin_user = $this->drupalCreateUser(array('administer languages', 'translate interface', 'access administration pages'));
$this->drupalLogin($admin_user);
$this->adminUser = $this->drupalCreateUser(array('administer languages', 'translate interface', 'access administration pages'));
$this->drupalLogin($this->adminUser);
}
/**
@ -158,7 +165,10 @@ class LocalePluralFormatTest extends WebTestBase {
// Set French as the site default language.
$this->config('system.site')->set('default_langcode', 'fr')->save();
// Visit User Info page before updating translation strings.
// Visit User Info page before updating translation strings. Change the
// created time to ensure that the we're dealing in seconds and it can't be
// exactly 1 minute.
$this->adminUser->set('created', time() - 1)->save();
$this->drupalGet('user');
// Member for time should be translated.
@ -199,9 +209,12 @@ class LocalePluralFormatTest extends WebTestBase {
// User interface input for translating seconds should not be duplicated
$this->assertUniqueText('@count seconds', 'Interface translation input for @count seconds only appears once.');
// Member for time should be translated.
// Member for time should be translated. Change the created time to ensure
// that the we're dealing in multiple seconds and it can't be exactly 1
// second or minute.
$this->adminUser->set('created', time() - 2)->save();
$this->drupalGet('user');
$this->assertText("seconde", "'Member for' text is translated.");
$this->assertText("secondes updated", "'Member for' text is translated.");
}
/**