Update to Drupal 8.0-dev-2015-11-17. Commits through da81cd220, Tue Nov 17 15:53:49 2015 +0000, Issue #2617224 by Wim Leers: Move around/fix some documentation.
This commit is contained in:
parent
4afb23bbd3
commit
7784f4c23d
929 changed files with 19798 additions and 5304 deletions
|
@ -137,6 +137,7 @@ class EntityAutocompleteElementFormTest extends EntityUnitTestBase implements Fo
|
|||
$form['single_autocreate_no_validate'] = array(
|
||||
'#type' => 'entity_autocomplete',
|
||||
'#target_type' => 'entity_test',
|
||||
'#validate_reference' => FALSE,
|
||||
'#autocreate' => array(
|
||||
'bundle' => 'entity_test',
|
||||
),
|
||||
|
|
|
@ -691,8 +691,8 @@ class EntityFieldTest extends EntityUnitTestBase {
|
|||
->setSetting('target_type', 'node')
|
||||
->setSetting('handler_settings', ['target_bundles' => ['article' => 'article']]);
|
||||
$reference_field = \Drupal::TypedDataManager()->create($definition);
|
||||
$reference = $reference_field->appendItem(array('entity' => $node));
|
||||
$violations = $reference->validate();
|
||||
$reference_field->appendItem(array('entity' => $node));
|
||||
$violations = $reference_field->validate();
|
||||
$this->assertEqual($violations->count(), 1);
|
||||
|
||||
$node = entity_create('node', array(
|
||||
|
@ -701,8 +701,8 @@ class EntityFieldTest extends EntityUnitTestBase {
|
|||
'title' => $this->randomString(),
|
||||
));
|
||||
$node->save();
|
||||
$reference->setValue($node);
|
||||
$violations = $reference->validate();
|
||||
$reference_field->entity = $node;
|
||||
$violations = $reference_field->validate();
|
||||
$this->assertEqual($violations->count(), 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ class EntityReferenceFieldTest extends EntityUnitTestBase {
|
|||
$entity->{$this->fieldName}->target_id = $referenced_entity->id();
|
||||
$violations = $entity->{$this->fieldName}->validate();
|
||||
$this->assertEqual($violations->count(), 1, 'Validation throws a violation.');
|
||||
$this->assertEqual($violations[0]->getMessage(), t('The entity must be of bundle %bundle.', array('%bundle' => $this->bundle)));
|
||||
$this->assertEqual($violations[0]->getMessage(), t('This entity (%type: %id) cannot be referenced.', array('%type' => $this->referencedEntityType, '%id' => $referenced_entity->id())));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -40,8 +40,7 @@ class HtaccessUnitTest extends KernelTestBase {
|
|||
$this->assertTrue(strpos($content, "SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006") !== FALSE);
|
||||
$this->assertFalse(strpos($content, "Require all denied") !== FALSE);
|
||||
$this->assertFalse(strpos($content, "Deny from all") !== FALSE);
|
||||
$this->assertTrue(strpos($content, "Options None") !== FALSE);
|
||||
$this->assertTrue(strpos($content, "Options +FollowSymLinks") !== FALSE);
|
||||
$this->assertTrue(strpos($content, "Options -Indexes -ExecCGI -Includes -MultiViews") !== FALSE);
|
||||
$this->assertTrue(strpos($content, "SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003") !== FALSE);
|
||||
$this->assertFilePermissions($public . '/.htaccess', 0444);
|
||||
|
||||
|
@ -54,8 +53,7 @@ class HtaccessUnitTest extends KernelTestBase {
|
|||
$this->assertTrue(strpos($content, "SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006") !== FALSE);
|
||||
$this->assertTrue(strpos($content, "Require all denied") !== FALSE);
|
||||
$this->assertTrue(strpos($content, "Deny from all") !== FALSE);
|
||||
$this->assertTrue(strpos($content, "Options None") !== FALSE);
|
||||
$this->assertTrue(strpos($content, "Options +FollowSymLinks") !== FALSE);
|
||||
$this->assertTrue(strpos($content, "Options -Indexes -ExecCGI -Includes -MultiViews") !== FALSE);
|
||||
$this->assertTrue(strpos($content, "SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003") !== FALSE);
|
||||
$this->assertFilePermissions($private . '/.htaccess', 0444);
|
||||
|
||||
|
@ -68,8 +66,7 @@ class HtaccessUnitTest extends KernelTestBase {
|
|||
$this->assertTrue(strpos($content,"SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006") !== FALSE);
|
||||
$this->assertTrue(strpos($content, "Require all denied") !== FALSE);
|
||||
$this->assertTrue(strpos($content,"Deny from all") !== FALSE);
|
||||
$this->assertTrue(strpos($content,"Options None") !== FALSE);
|
||||
$this->assertTrue(strpos($content,"Options +FollowSymLinks") !== FALSE);
|
||||
$this->assertTrue(strpos($content,"Options -Indexes -ExecCGI -Includes -MultiViews") !== FALSE);
|
||||
$this->assertTrue(strpos($content, "SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003") !== FALSE);
|
||||
$this->assertFilePermissions($stream . '/.htaccess', 0444);
|
||||
|
||||
|
|
|
@ -40,6 +40,19 @@ class StandardInstallerTest extends ConfigAfterInstallerTestBase {
|
|||
parent::setUpSite();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function curlExec($curl_options, $redirect = FALSE) {
|
||||
// Ensure that we see the classy progress CSS on the batch page.
|
||||
// Batch processing happens as part of HTTP redirects, so we can access the
|
||||
// HTML of the batch page.
|
||||
if (strpos($curl_options[CURLOPT_URL], '&id=1&op=do_nojs') !== FALSE) {
|
||||
$this->assertRaw('themes/classy/css/components/progress.css');
|
||||
}
|
||||
return parent::curlExec($curl_options, $redirect);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that the exported standard configuration is up to date.
|
||||
*/
|
||||
|
|
|
@ -204,6 +204,7 @@ class MenuRouterTest extends WebTestBase {
|
|||
"éøïвβ中國書۞"; // Characters from various non-ASCII alphabets.
|
||||
$this->drupalGet($path);
|
||||
$this->assertRaw('This is the menuTestCallback content.');
|
||||
$this->assertNoText(t('The website encountered an unexpected error. Please try again later.'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -115,7 +115,7 @@ class RouteProviderTest extends KernelTestBase {
|
|||
public function testCandidateOutlines() {
|
||||
|
||||
$connection = Database::getConnection();
|
||||
$provider = new RouteProvider($connection, $this->state, $this->currentPath, $this->cache, $this->pathProcessor, $this->cacheTagsInvalidator, 'test_routes');
|
||||
$provider = new TestRouteProvider($connection, $this->state, $this->currentPath, $this->cache, $this->pathProcessor, $this->cacheTagsInvalidator, 'test_routes');
|
||||
|
||||
$parts = array('node', '5', 'edit');
|
||||
|
||||
|
@ -532,7 +532,7 @@ class RouteProviderTest extends KernelTestBase {
|
|||
*/
|
||||
public function testGetRoutesByPatternWithLongPatterns() {
|
||||
$connection = Database::getConnection();
|
||||
$provider = new RouteProvider($connection, $this->state, $this->currentPath, $this->cache, $this->pathProcessor, $this->cacheTagsInvalidator, 'test_routes');
|
||||
$provider = new TestRouteProvider($connection, $this->state, $this->currentPath, $this->cache, $this->pathProcessor, $this->cacheTagsInvalidator, 'test_routes');
|
||||
|
||||
$this->fixtures->createTables($connection);
|
||||
// This pattern has only 3 parts, so we will get candidates, but no routes,
|
||||
|
@ -613,3 +613,11 @@ class RouteProviderTest extends KernelTestBase {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
class TestRouteProvider extends RouteProvider {
|
||||
|
||||
public function getCandidateOutlines(array $parts) {
|
||||
return parent::getCandidateOutlines($parts);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -44,11 +44,6 @@ class DefaultMobileMetaTagsTest extends WebTestBase {
|
|||
* Verifies that the default mobile meta tags can be removed.
|
||||
*/
|
||||
public function testRemovingDefaultMetaTags() {
|
||||
// @todo remove once PHP7 on Drupal CI has the fix.
|
||||
if (version_compare(phpversion(), '7.0.0-dev') >= 0) {
|
||||
// @see https://bugs.php.net/bug.php?id=70808
|
||||
return;
|
||||
}
|
||||
\Drupal::service('module_installer')->install(array('system_module_test'));
|
||||
$this->drupalGet('');
|
||||
foreach ($this->defaultMetaTags as $name => $metatag) {
|
||||
|
|
|
@ -100,6 +100,7 @@ class ErrorHandlerTest extends WebTestBase {
|
|||
$this->assertErrorMessage($error_warning);
|
||||
$this->assertErrorMessage($error_user_notice);
|
||||
$this->assertNoRaw('<pre class="backtrace">', 'Did not find pre element with backtrace class.');
|
||||
$this->assertErrorLogged($fatal_error['@message']);
|
||||
|
||||
// Set error reporting to not collect notices.
|
||||
$config->set('error_level', ERROR_REPORTING_DISPLAY_SOME)->save();
|
||||
|
|
|
@ -52,6 +52,9 @@ class ThemeTest extends WebTestBase {
|
|||
$this->assertResponse(404, 'The theme settings form URL for a uninstalled theme could not be found.');
|
||||
$this->drupalGet('admin/appearance/settings/' . $this->randomMachineName());
|
||||
$this->assertResponse(404, 'The theme settings form URL for a non-existent theme could not be found.');
|
||||
$this->assertTrue(\Drupal::service('theme_installer')->install(['stable']));
|
||||
$this->drupalGet('admin/appearance/settings/stable');
|
||||
$this->assertResponse(404, 'The theme settings form URL for a hidden theme is unavailable.');
|
||||
|
||||
// Specify a filesystem path to be used for the logo.
|
||||
$file = current($this->drupalGetTestFiles('image'));
|
||||
|
@ -190,6 +193,23 @@ class ThemeTest extends WebTestBase {
|
|||
// The logo field should only be present on the global theme settings form.
|
||||
$this->assertNoFieldByName('logo_path');
|
||||
$this->drupalPostForm(NULL, [], t('Save configuration'));
|
||||
|
||||
// Ensure only valid themes are listed in the local tasks.
|
||||
$this->drupalPlaceBlock('local_tasks_block', ['region' => 'header']);
|
||||
$this->drupalGet('admin/appearance/settings');
|
||||
$theme_handler = \Drupal::service('theme_handler');
|
||||
$this->assertLink($theme_handler->getName('classy'));
|
||||
$this->assertLink($theme_handler->getName('bartik'));
|
||||
$this->assertNoLink($theme_handler->getName('stable'));
|
||||
|
||||
// If a hidden theme is an admin theme it should be viewable.
|
||||
\Drupal::configFactory()->getEditable('system.theme')->set('admin', 'stable')->save();
|
||||
\Drupal::service('router.builder')->rebuildIfNeeded();
|
||||
$this->drupalPlaceBlock('local_tasks_block', ['region' => 'header', 'theme' => 'stable']);
|
||||
$this->drupalGet('admin/appearance/settings');
|
||||
$this->assertLink($theme_handler->getName('stable'));
|
||||
$this->drupalGet('admin/appearance/settings/stable');
|
||||
$this->assertResponse(200, 'The theme settings form URL for a hidden theme that is the admin theme is available.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -255,8 +275,14 @@ class ThemeTest extends WebTestBase {
|
|||
* Test switching the default theme.
|
||||
*/
|
||||
function testSwitchDefaultTheme() {
|
||||
/** @var \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler */
|
||||
$theme_handler = \Drupal::service('theme_handler');
|
||||
// First, install Stark and set it as the default theme programmatically.
|
||||
$theme_handler->install(array('stark'));
|
||||
$theme_handler->setDefault('stark');
|
||||
|
||||
// Install Bartik and set it as the default theme.
|
||||
\Drupal::service('theme_handler')->install(array('bartik'));
|
||||
$theme_handler->install(array('bartik'));
|
||||
$this->drupalGet('admin/appearance');
|
||||
$this->clickLink(t('Set as default'));
|
||||
$this->assertEqual($this->config('system.theme')->get('default'), 'bartik');
|
||||
|
@ -266,10 +292,10 @@ class ThemeTest extends WebTestBase {
|
|||
$this->assertText('Bartik(' . t('active tab') . ')', 'Default local task on blocks admin page is the default theme.');
|
||||
// Switch back to Stark and test again to test that the menu cache is cleared.
|
||||
$this->drupalGet('admin/appearance');
|
||||
// Classy is the first 'Set as default' link.
|
||||
$this->clickLink(t('Set as default'), 0);
|
||||
// Stark is the first 'Set as default' link.
|
||||
$this->clickLink(t('Set as default'));
|
||||
$this->drupalGet('admin/structure/block');
|
||||
$this->assertText('Classy(' . t('active tab') . ')', 'Default local task on blocks admin page has changed.');
|
||||
$this->assertText('Stark(' . t('active tab') . ')', 'Default local task on blocks admin page has changed.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -328,8 +354,8 @@ class ThemeTest extends WebTestBase {
|
|||
// base theme of bartik.
|
||||
$this->assertNoRaw('Uninstall Classy theme', 'A link to uninstall the Classy theme does not appear on the theme settings page.');
|
||||
|
||||
// Change the default theme to stark, stark is third in the list.
|
||||
$this->clickLink(t('Set as default'), 2);
|
||||
// Change the default theme to stark, stark is second in the list.
|
||||
$this->clickLink(t('Set as default'), 1);
|
||||
|
||||
// Check that bartik can be uninstalled now.
|
||||
$this->assertRaw('Uninstall Bartik theme', 'A link to uninstall the Bartik theme does appear on the theme settings page.');
|
||||
|
@ -344,9 +370,9 @@ class ThemeTest extends WebTestBase {
|
|||
// Seven is the second in the list.
|
||||
$this->clickLink(t('Uninstall'));
|
||||
$this->assertRaw('The <em class="placeholder">Seven</em> theme has been uninstalled');
|
||||
// Now uninstall classy.
|
||||
$this->clickLink(t('Uninstall'));
|
||||
$this->assertRaw('The <em class="placeholder">Classy</em> theme has been uninstalled');
|
||||
|
||||
// Check that the classy theme still can't be uninstalled as it is hidden.
|
||||
$this->assertNoRaw('Uninstall Classy theme', 'A link to uninstall the Classy theme does not appear on the theme settings page.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -87,6 +87,7 @@ class UncaughtExceptionTest extends WebTestBase {
|
|||
$this->assertResponse(500);
|
||||
$this->assertText('The website encountered an unexpected error. Please try again later.');
|
||||
$this->assertText($this->expectedExceptionMessage);
|
||||
$this->assertErrorLogged($this->expectedExceptionMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -122,6 +123,7 @@ class UncaughtExceptionTest extends WebTestBase {
|
|||
|
||||
$this->assertRaw('The website encountered an unexpected error.');
|
||||
$this->assertRaw($this->expectedExceptionMessage);
|
||||
$this->assertErrorLogged($this->expectedExceptionMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -178,6 +180,7 @@ class UncaughtExceptionTest extends WebTestBase {
|
|||
$this->assertResponse(500);
|
||||
|
||||
$this->assertRaw($this->expectedExceptionMessage);
|
||||
$this->assertErrorLogged($this->expectedExceptionMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -199,6 +202,7 @@ class UncaughtExceptionTest extends WebTestBase {
|
|||
|
||||
$this->assertRaw('The website encountered an unexpected error');
|
||||
$this->assertRaw($this->expectedExceptionMessage);
|
||||
$this->assertErrorLogged($this->expectedExceptionMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -233,6 +237,7 @@ class UncaughtExceptionTest extends WebTestBase {
|
|||
$this->drupalGet('');
|
||||
$this->assertResponse(500);
|
||||
$this->assertRaw('PDOException');
|
||||
$this->assertErrorLogged($this->expectedExceptionMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -252,7 +257,8 @@ class UncaughtExceptionTest extends WebTestBase {
|
|||
|
||||
// Find fatal error logged to the simpletest error.log
|
||||
$errors = file(\Drupal::root() . '/' . $this->siteDirectory . '/error.log');
|
||||
$this->assertIdentical(count($errors), 1, 'Exactly one line logged to the PHP error log');
|
||||
$this->assertIdentical(count($errors), 2, 'The error + the error that the logging service is broken has been written to the error log.');
|
||||
$this->assertTrue(strpos($errors[0], 'Failed to log error') !== FALSE, 'The error handling logs when an error could not be logged to the logger.');
|
||||
|
||||
$expected_path = \Drupal::root() . '/core/modules/system/tests/modules/error_service_test/src/MonkeysInTheControlRoom.php';
|
||||
$expected_line = 63;
|
||||
|
|
|
@ -0,0 +1,185 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\system\Tests\Theme\StableLibraryOverrideTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\system\Tests\Theme;
|
||||
|
||||
use Drupal\simpletest\KernelTestBase;
|
||||
|
||||
/**
|
||||
* Tests Stable's library overrides.
|
||||
*
|
||||
* @group Theme
|
||||
*/
|
||||
class StableLibraryOverrideTest extends KernelTestBase {
|
||||
|
||||
/**
|
||||
* The theme manager.
|
||||
*
|
||||
* @var \Drupal\Core\Theme\ThemeManagerInterface
|
||||
*/
|
||||
protected $themeManager;
|
||||
|
||||
/**
|
||||
* The theme initialization.
|
||||
*
|
||||
* @var \Drupal\Core\Theme\ThemeInitializationInterface
|
||||
*/
|
||||
protected $themeInitialization;
|
||||
|
||||
/**
|
||||
* The library discovery service.
|
||||
*
|
||||
* @var \Drupal\Core\Asset\LibraryDiscoveryInterface
|
||||
*/
|
||||
protected $libraryDiscovery;
|
||||
|
||||
/**
|
||||
* A list of all core modules.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $allModules;
|
||||
|
||||
/**
|
||||
* A list of libraries to skip checking, in the format extension/library_name.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $librariesToSkip = [];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->themeManager = $this->container->get('theme.manager');
|
||||
$this->themeInitialization = $this->container->get('theme.initialization');
|
||||
$this->libraryDiscovery = $this->container->get('library.discovery');
|
||||
|
||||
$this->container->get('theme_installer')->install(['stable']);
|
||||
|
||||
// Enable all core modules.
|
||||
$all_modules = system_rebuild_module_data();
|
||||
$all_modules = array_filter($all_modules, function ($module) {
|
||||
// Filter contrib, hidden, already enabled modules and modules in the
|
||||
// Testing package.
|
||||
if ($module->origin !== 'core' || !empty($module->info['hidden']) || $module->status == TRUE || $module->info['package'] == 'Testing') {
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
});
|
||||
$this->allModules = array_keys($all_modules);
|
||||
sort($this->allModules);
|
||||
$this->enableModules($this->allModules);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that Stable overrides all relevant core library assets.
|
||||
*/
|
||||
public function testStableLibraryOverrides() {
|
||||
// First get the clean library definitions with no active theme.
|
||||
$libraries_before = $this->getAllLibraries();
|
||||
$libraries_before = $this->removeVendorAssets($libraries_before);
|
||||
|
||||
$this->themeManager->setActiveTheme($this->themeInitialization->getActiveThemeByName('stable'));
|
||||
$this->libraryDiscovery->clearCachedDefinitions();
|
||||
|
||||
// Now get the library definitions with Stable as the active theme.
|
||||
$libraries_after = $this->getAllLibraries();
|
||||
$libraries_after = $this->removeVendorAssets($libraries_after);
|
||||
|
||||
$root = \Drupal::root();
|
||||
foreach ($libraries_before as $extension => $libraries) {
|
||||
foreach ($libraries as $library_name => $library) {
|
||||
// Allow skipping libraries.
|
||||
if (in_array("$extension/$library_name", $this->librariesToSkip)) {
|
||||
continue;
|
||||
}
|
||||
$library_after = $libraries_after[$extension][$library_name];
|
||||
|
||||
// Check that all the CSS assets are overridden.
|
||||
foreach ($library['css'] as $index => $asset) {
|
||||
$clean_path = $asset['data'];
|
||||
$stable_path = $library_after['css'][$index]['data'];
|
||||
// Make core/misc assets look like they are coming from a "core"
|
||||
// module.
|
||||
$replacements = [
|
||||
'core/misc/' => "core/modules/core/css/",
|
||||
];
|
||||
$expected_path = strtr($clean_path, $replacements);
|
||||
|
||||
// Adjust the module asset paths to correspond with the Stable folder
|
||||
// structure.
|
||||
$expected_path = str_replace("core/modules/$extension/css/", "core/themes/stable/css/$extension/", $expected_path);
|
||||
$assert_path = str_replace("core/modules/$extension/", '', $clean_path);
|
||||
|
||||
$this->assertEqual($expected_path, $stable_path, "$assert_path from the $extension/$library_name library is overridden in Stable.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all vendor libraries and assets from the library definitions.
|
||||
*
|
||||
* @param array[] $all_libraries
|
||||
* An associative array of libraries keyed by extension, then by library
|
||||
* name, and so on.
|
||||
*
|
||||
* @return array[]
|
||||
* The reduced array of libraries.
|
||||
*/
|
||||
protected function removeVendorAssets($all_libraries) {
|
||||
foreach ($all_libraries as $extension => $libraries) {
|
||||
foreach ($libraries as $library_name => $library) {
|
||||
if (isset($library['remote'])) {
|
||||
unset($all_libraries[$extension][$library_name]);
|
||||
}
|
||||
foreach (['css', 'js'] as $asset_type) {
|
||||
foreach ($library[$asset_type] as $index => $asset) {
|
||||
if (strpos($asset['data'], 'core/assets/vendor') !== FALSE) {
|
||||
unset($all_libraries[$extension][$library_name][$asset_type][$index]);
|
||||
// Re-key the array of assets. This is needed because
|
||||
// libraries-override doesn't always preserve the order.
|
||||
if (!empty($all_libraries[$extension][$library_name][$asset_type])) {
|
||||
$all_libraries[$extension][$library_name][$asset_type] = array_values($all_libraries[$extension][$library_name][$asset_type]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $all_libraries;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all libraries for core and all installed modules.
|
||||
*
|
||||
* @return array[]
|
||||
* An associative array of libraries keyed by extension, then by library
|
||||
* name, and so on.
|
||||
*/
|
||||
protected function getAllLibraries() {
|
||||
$modules = \Drupal::moduleHandler()->getModuleList();
|
||||
$module_list = array_keys($modules);
|
||||
sort($module_list);
|
||||
$this->assertEqual($this->allModules, $module_list, 'All core modules are installed.');
|
||||
|
||||
$libraries['core'] = $this->libraryDiscovery->getLibrariesByExtension('core');
|
||||
|
||||
$root = \Drupal::root();
|
||||
foreach ($modules as $module_name => $module) {
|
||||
$library_file = $module->getPath() . '/' . $module_name . '.libraries.yml';
|
||||
if (is_file($root . '/' . $library_file)) {
|
||||
$libraries[$module_name] = $this->libraryDiscovery->getLibrariesByExtension($module_name);
|
||||
}
|
||||
}
|
||||
return $libraries;
|
||||
}
|
||||
|
||||
}
|
|
@ -30,8 +30,7 @@ class UpdatePathRC1TestBaseFilledTest extends UpdatePathRC1TestBaseTest {
|
|||
* Tests that the content and configuration were properly updated.
|
||||
*/
|
||||
public function testUpdatedSite() {
|
||||
// @todo there are no updates to run.
|
||||
//$this->runUpdates();
|
||||
$this->runUpdates();
|
||||
|
||||
$spanish = \Drupal::languageManager()->getLanguage('es');
|
||||
|
||||
|
|
|
@ -34,6 +34,8 @@ class UpdatePathRC1TestBaseTest extends UpdatePathTestBase {
|
|||
* Tests that the database was properly loaded.
|
||||
*/
|
||||
public function testDatabaseLoaded() {
|
||||
$extensions = \Drupal::service('config.storage')->read('core.extension');
|
||||
$this->assertFalse(isset($extensions['theme']['stable']), 'Stable is not installed before updating.');
|
||||
$hook_updates = [
|
||||
'user' => '8000',
|
||||
'node' => '8003',
|
||||
|
@ -57,11 +59,14 @@ class UpdatePathRC1TestBaseTest extends UpdatePathTestBase {
|
|||
$this->assertEqual($existing_updates[$expected_update], 1, new FormattableMarkup("@expected_update exists in 'existing_updates' key and only appears once.", ['@expected_update' => $expected_update]));
|
||||
}
|
||||
|
||||
// @todo there are no updates to run.
|
||||
// $this->runUpdates();
|
||||
$this->runUpdates();
|
||||
$this->assertEqual(\Drupal::config('system.site')->get('name'), 'Site-Install');
|
||||
$this->drupalGet('<front>');
|
||||
$this->assertText('Site-Install');
|
||||
$extensions = \Drupal::service('config.storage')->read('core.extension');
|
||||
$this->assertTrue(isset($extensions['theme']['stable']), 'Stable is installed after updating.');
|
||||
$blocks = \Drupal::entityManager()->getStorage('block')->loadByProperties(['theme' => 'stable']);
|
||||
$this->assertTrue(empty($blocks), 'No blocks have been placed for Stable.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Reference in a new issue