updated core to 8.6.1 via composer

This commit is contained in:
2018-09-12 13:58:26 +02:00
parent a9a219f2ed
commit ea56b9fba3
4443 changed files with 112098 additions and 40708 deletions
@@ -4,4 +4,3 @@ description: 'Support module for testing early bootstrap getting of annotations
core: 8.x
package: Testing
version: VERSION
@@ -25,11 +25,6 @@ class LocaleConfigTranslationImportTest extends BrowserTestBase {
*/
protected function setUp() {
parent::setUp();
// @todo Re-enable the test and only skip it when the translation cannot be
// downloaded, or provide a translation as a fixture instead. See
// https://www.drupal.org/project/drupal/issues/2828143.
$this->markTestSkipped();
}
/**
@@ -51,6 +46,7 @@ class LocaleConfigTranslationImportTest extends BrowserTestBase {
// tests.
$this->config('locale.settings')
->set('translation.import_enabled', TRUE)
->set('translation.use_source', LOCALE_TRANSLATION_USE_SOURCE_LOCAL)
->save();
// Add translation permissions now that the locale module has been enabled.
@@ -96,6 +92,7 @@ class LocaleConfigTranslationImportTest extends BrowserTestBase {
// tests.
$this->config('locale.settings')
->set('translation.import_enabled', TRUE)
->set('translation.use_source', LOCALE_TRANSLATION_USE_SOURCE_LOCAL)
->save();
// Add predefined language.
@@ -134,7 +131,7 @@ class LocaleConfigTranslationImportTest extends BrowserTestBase {
$expected = [
'translatable_no_default' => 'This translation is preserved',
'translatable_default_with_translation' => 'This translation is preserved',
'translatable_default_with_no_translation' => 'This translation is preserved'
'translatable_default_with_no_translation' => 'This translation is preserved',
];
$this->assertEqual($expected, $override->get());
}
@@ -154,6 +151,7 @@ class LocaleConfigTranslationImportTest extends BrowserTestBase {
// tests.
$this->config('locale.settings')
->set('translation.import_enabled', TRUE)
->set('translation.use_source', LOCALE_TRANSLATION_USE_SOURCE_LOCAL)
->save();
// Add predefined language.
@@ -191,6 +189,7 @@ class LocaleConfigTranslationImportTest extends BrowserTestBase {
// tests.
$this->config('locale.settings')
->set('translation.import_enabled', TRUE)
->set('translation.use_source', LOCALE_TRANSLATION_USE_SOURCE_LOCAL)
->save();
// Add predefined language.
@@ -205,7 +204,7 @@ class LocaleConfigTranslationImportTest extends BrowserTestBase {
$expected = [
'translatable_default_with_translation' => 'Locale can translate Afrikaans',
'translatable_no_default' => 'This translation is preserved',
'translatable_default_with_no_translation' => 'This translation is preserved'
'translatable_default_with_no_translation' => 'This translation is preserved',
];
$this->assertEqual($expected, $override->get());
@@ -227,7 +226,7 @@ class LocaleConfigTranslationImportTest extends BrowserTestBase {
$override = \Drupal::languageManager()->getLanguageConfigOverride('af', 'locale_test_translate.settings');
$expected = [
'translatable_no_default' => 'This translation is preserved',
'translatable_default_with_no_translation' => 'This translation is preserved'
'translatable_default_with_no_translation' => 'This translation is preserved',
];
$this->assertEqual($expected, $override->get());
}
@@ -38,6 +38,7 @@ class LocaleConfigTranslationTest extends BrowserTestBase {
// tests.
$this->config('locale.settings')
->set('translation.import_enabled', TRUE)
->set('translation.use_source', LOCALE_TRANSLATION_USE_SOURCE_LOCAL)
->save();
// Add custom language.
@@ -45,7 +45,7 @@ class LocaleFileSystemFormTest extends BrowserTestBase {
// The setting should persist.
$translation_path = $this->publicFilesDirectory . '/translations_changed';
$fields = [
'translation_path' => $translation_path
'translation_path' => $translation_path,
];
$this->drupalPostForm(NULL, $fields, t('Save configuration'));
$this->drupalGet('admin/config/media/file-system');
@@ -52,6 +52,7 @@ class LocaleImportFunctionalTest extends BrowserTestBase {
// tests.
$this->config('locale.settings')
->set('translation.import_enabled', TRUE)
->set('translation.use_source', LOCALE_TRANSLATION_USE_SOURCE_LOCAL)
->save();
}
@@ -4,7 +4,7 @@ namespace Drupal\Tests\locale\Functional;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Tests\BrowserTestBase;
use Drupal\Component\Utility\SafeMarkup;
use Drupal\Component\Render\FormattableMarkup;
/**
* Tests parsing js files for translatable strings.
@@ -92,10 +92,10 @@ class LocaleJavascriptTranslationTest extends BrowserTestBase {
$args = ['%source' => $str, '%context' => $context];
// Make sure that the string was found in the file.
$this->assertTrue(isset($source_strings[$str]), SafeMarkup::format('Found source string: %source', $args));
$this->assertTrue(isset($source_strings[$str]), new FormattableMarkup('Found source string: %source', $args));
// Make sure that the proper context was matched.
$message = $context ? SafeMarkup::format('Context for %source is %context', $args) : SafeMarkup::format('Context for %source is blank', $args);
$message = $context ? new FormattableMarkup('Context for %source is %context', $args) : new FormattableMarkup('Context for %source is blank', $args);
$this->assertTrue(isset($source_strings[$str]) && $source_strings[$str] === $context, $message);
}
@@ -0,0 +1,21 @@
<?php
namespace Drupal\Tests\locale\Functional;
/**
* Tests installing in a different language with a dev version string.
*
* @group locale
*/
class LocaleNonInteractiveDevInstallTest extends LocaleNonInteractiveInstallTest {
/**
* {@inheritdoc}
*/
protected function getVersionStringToTest() {
include_once $this->root . '/core/includes/install.core.inc';
$version = _install_get_version_info(\Drupal::VERSION);
return $version['major'] . '.' . $version['minor'] . '.x';
}
}
@@ -0,0 +1,57 @@
<?php
namespace Drupal\Tests\locale\Functional;
use Drupal\Tests\BrowserTestBase;
/**
* Tests installing in a different language with a non-dev version string.
*
* @group locale
*/
class LocaleNonInteractiveInstallTest extends BrowserTestBase {
/**
* Gets the version string to use in the translation file.
*
* @return string
* The version string to test, for example, '8.0.0' or '8.6.x'.
*/
protected function getVersionStringToTest() {
include_once $this->root . '/core/includes/install.core.inc';
$version = _install_get_version_info(\Drupal::VERSION);
return $version['major'] . '.0.0';
}
/**
* {@inheritdoc}
*/
protected function installParameters() {
$parameters = parent::installParameters();
// Install Drupal in German.
$parameters['parameters']['langcode'] = 'de';
// Create a po file so we don't attempt to download one from
// localize.drupal.org and to have a test translation that will not change.
\Drupal::service('file_system')->mkdir($this->publicFilesDirectory . '/translations', NULL, TRUE);
$contents = <<<ENDPO
msgid ""
msgstr ""
msgid "Enter the password that accompanies your username."
msgstr "Geben sie das Passwort für ihren Benutzernamen ein."
ENDPO;
$version = $this->getVersionStringToTest();
file_put_contents($this->publicFilesDirectory . "/translations/drupal-{$version}.de.po", $contents);
return $parameters;
}
/**
* Tests that the expected translated text appears on the login screen.
*/
public function testInstallerTranslations() {
$this->drupalGet('user/login');
$this->assertSession()->responseContains('Geben sie das Passwort für ihren Benutzernamen ein.');
}
}
@@ -0,0 +1,65 @@
<?php
namespace Drupal\Tests\locale\Functional;
use Drupal\Core\StreamWrapper\PublicStream;
use Drupal\language\Entity\ConfigurableLanguage;
use org\bovigo\vfs\vfsStream;
/**
* Tests locale translation download.
*
* @group locale
*/
class LocaleTranslationDownloadTest extends LocaleUpdateBase {
/**
* The virtual file stream for storing translations.
*
* @var \org\bovigo\vfs\vfsStreamDirectory
*/
protected $translationsStream;
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$moduleHandler = $this->container->get('module_handler');
$moduleHandler->loadInclude('locale', 'inc', 'locale.batch');
ConfigurableLanguage::createFromLangcode('de')->save();
// Let the translations:// stream wrapper point to a virtual file system to
// make it independent from the test environment.
$this->translationsStream = vfsStream::setup('translations');
\Drupal::configFactory()->getEditable('locale.settings')
->set('translation.path', $this->translationsStream->url())
->save();
}
/**
* Tests translation download from remote sources.
*/
public function testUpdateImportSourceRemote() {
// Provide remote and 'previously' downloaded translation file.
$this->setTranslationFiles();
vfsStream::create([
'contrib_module_one-8.x-1.1.de._po' => '__old_content__',
], $this->translationsStream);
$url = \Drupal::service('url_generator')->generateFromRoute('<front>', [], ['absolute' => TRUE]);
$uri = $url . PublicStream::basePath() . '/remote/8.x/contrib_module_one/contrib_module_one-8.x-1.1.de._po';
$source_file = (object) [
'uri' => $uri,
];
$result = locale_translation_download_source($source_file, 'translations://');
$this->assertEquals('translations://contrib_module_one-8.x-1.1.de._po', $result->uri);
$this->assertFalse(file_exists('translations://contrib_module_one-8.x-1.1.de_0._po'));
$this->assertTrue(file_exists('translations://contrib_module_one-8.x-1.1.de._po'));
$this->assertNotContains('__old_content__', file_get_contents('translations://contrib_module_one-8.x-1.1.de._po'));
}
}
@@ -5,7 +5,7 @@ namespace Drupal\Tests\locale\Functional;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\Tests\BrowserTestBase;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Component\Utility\SafeMarkup;
use Drupal\Component\Render\FormattableMarkup;
/**
* Adds a new locale and translates its name. Checks the validation of
@@ -259,13 +259,13 @@ class LocaleTranslationUiTest extends BrowserTestBase {
$locale_javascripts = \Drupal::state()->get('locale.translation.javascript') ?: [];
$js_file = 'public://' . $config->get('javascript.directory') . '/' . $langcode . '_' . $locale_javascripts[$langcode] . '.js';
$this->assertTrue($result = file_exists($js_file), SafeMarkup::format('JavaScript file created: %file', ['%file' => $result ? $js_file : 'not found']));
$this->assertTrue($result = file_exists($js_file), new FormattableMarkup('JavaScript file created: %file', ['%file' => $result ? $js_file : 'not found']));
// Test JavaScript translation rebuilding.
file_unmanaged_delete($js_file);
$this->assertTrue($result = !file_exists($js_file), SafeMarkup::format('JavaScript file deleted: %file', ['%file' => $result ? $js_file : 'found']));
$this->assertTrue($result = !file_exists($js_file), new FormattableMarkup('JavaScript file deleted: %file', ['%file' => $result ? $js_file : 'found']));
_locale_rebuild_js($langcode);
$this->assertTrue($result = file_exists($js_file), SafeMarkup::format('JavaScript file rebuilt: %file', ['%file' => $result ? $js_file : 'not found']));
$this->assertTrue($result = file_exists($js_file), new FormattableMarkup('JavaScript file rebuilt: %file', ['%file' => $result ? $js_file : 'not found']));
}
/**
@@ -5,7 +5,7 @@ namespace Drupal\Tests\locale\Functional;
use Drupal\Core\StreamWrapper\PublicStream;
use Drupal\file\Entity\File;
use Drupal\Tests\BrowserTestBase;
use Drupal\Component\Utility\SafeMarkup;
use Drupal\Component\Render\FormattableMarkup;
/**
* Base class for testing updates to string translations.
@@ -63,6 +63,7 @@ abstract class LocaleUpdateBase extends BrowserTestBase {
// tests.
$this->config('locale.settings')
->set('translation.import_enabled', TRUE)
->set('translation.use_source', LOCALE_TRANSLATION_USE_SOURCE_LOCAL)
->save();
}
@@ -88,7 +89,7 @@ abstract class LocaleUpdateBase extends BrowserTestBase {
$edit = ['predefined_langcode' => $langcode];
$this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
$this->container->get('language_manager')->reset();
$this->assertTrue(\Drupal::languageManager()->getLanguage($langcode), SafeMarkup::format('Language %langcode added.', ['%langcode' => $langcode]));
$this->assertTrue(\Drupal::languageManager()->getLanguage($langcode), new FormattableMarkup('Language %langcode added.', ['%langcode' => $langcode]));
}
/**
@@ -84,7 +84,7 @@ class LocaleUpdateCronTest extends LocaleUpdateBase {
// Check whether tasks are added to the queue.
$queue = \Drupal::queue('locale_translation', TRUE);
$this->assertEqual($queue->numberOfItems(), 3, 'Queue holds tasks for one project.');
$this->assertEqual($queue->numberOfItems(), 2, 'Queue holds tasks for one project.');
$item = $queue->claimItem();
$queue->releaseItem($item);
$this->assertEqual($item->data[1][0], 'contrib_module_two', 'Queue holds tasks for contrib module one.');
@@ -95,7 +95,7 @@ class LocaleUpdateCronTest extends LocaleUpdateBase {
// Check whether no more tasks are added to the queue.
$queue = \Drupal::queue('locale_translation', TRUE);
$this->assertEqual($queue->numberOfItems(), 3, 'Queue holds tasks for one project.');
$this->assertEqual($queue->numberOfItems(), 2, 'Queue holds tasks for one project.');
// Ensure last checked is updated to a greater time than the initial value.
sleep(1);
@@ -3,7 +3,6 @@
namespace Drupal\Tests\locale\Functional;
use Drupal\Component\Render\FormattableMarkup;
use Drupal\Component\Utility\SafeMarkup;
/**
* Tests for the user interface of project interface translations.
@@ -86,7 +85,7 @@ class LocaleUpdateInterfaceTest extends LocaleUpdateBase {
$release_details = new FormattableMarkup('@module (@version). @info', [
'@module' => 'Locale test translate',
'@version' => '1.3-dev',
'@info' => t('File not found at %local_path', ['%local_path' => 'core/modules/locale/tests/test.de.po'])
'@info' => t('File not found at %local_path', ['%local_path' => 'core/modules/locale/tests/test.de.po']),
]);
$this->assertRaw($release_details->__toString(), 'Release details');
@@ -112,7 +111,7 @@ class LocaleUpdateInterfaceTest extends LocaleUpdateBase {
// Check if translations are available for Drupal core.
$this->drupalGet('admin/reports/translations');
$this->assertText(t('Updates for: @project', ['@project' => t('Drupal core')]), 'Translations found');
$this->assertText(SafeMarkup::format('@module (@date)', ['@module' => t('Drupal core'), '@date' => format_date(REQUEST_TIME, 'html_date')]), 'Core translation update');
$this->assertText(new FormattableMarkup('@module (@date)', ['@module' => t('Drupal core'), '@date' => format_date(REQUEST_TIME, 'html_date')]), 'Core translation update');
$update_button = $this->xpath('//input[@type="submit"][@value="' . t('Update translations') . '"]');
$this->assertTrue($update_button, 'Update translations button');
}
@@ -37,7 +37,7 @@ class LocaleConfigSubscriberTest extends KernelTestBase {
/**
* The string storage used in this test.
*
* @var \Drupal\locale\StringStorageInterface;
* @var \Drupal\locale\StringStorageInterface
*/
protected $stringStorage;
@@ -187,7 +187,6 @@ class LocaleConfigSubscriberTest extends KernelTestBase {
$this->assertNoTranslation($config_name, $langcode);
}
/**
* Sets up a configuration string with a translation.
*
@@ -41,7 +41,6 @@ class LocaleTranslationProjectsTest extends KernelTestBase {
\Drupal::state()->set('locale.remove_core_project', TRUE);
}
/**
* Tests locale_translation_clear_cache_projects().
*/
@@ -21,7 +21,6 @@ class StringBaseTest extends UnitTestCase {
$string->save();
}
/**
* @covers ::delete
*/