Update to drupal-org-drupal 8.0.0-rc2. For more information, see https://www.drupal.org/node/2598668
This commit is contained in:
parent
f32e58e4b1
commit
8e18df8c36
3062 changed files with 15044 additions and 172506 deletions
|
@ -7,7 +7,6 @@
|
|||
|
||||
namespace Drupal\system\Controller;
|
||||
|
||||
use Drupal\Component\Serialization\Json;
|
||||
use Drupal\Core\Cache\CacheableMetadata;
|
||||
use Drupal\Core\Controller\ControllerBase;
|
||||
use Drupal\Core\Entity\Query\QueryFactory;
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
namespace Drupal\system\Entity;
|
||||
|
||||
use Drupal\Core\Config\Entity\ConfigEntityBase;
|
||||
use Drupal\Core\Entity\EntityStorageInterface;
|
||||
use Drupal\system\MenuInterface;
|
||||
|
||||
/**
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
namespace Drupal\system\EventSubscriber;
|
||||
|
||||
use Drupal\Core\Cache\Cache;
|
||||
use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
|
||||
use Drupal\Core\Config\ConfigCrudEvent;
|
||||
use Drupal\Core\Config\ConfigEvents;
|
||||
|
|
|
@ -10,7 +10,6 @@ namespace Drupal\system\Form;
|
|||
use Drupal\Component\Utility\Unicode;
|
||||
use Drupal\Core\Config\PreExistingConfigException;
|
||||
use Drupal\Core\Config\UnmetDependenciesException;
|
||||
use Drupal\Core\Controller\TitleResolverInterface;
|
||||
use Drupal\Core\Access\AccessManagerInterface;
|
||||
use Drupal\Core\Extension\Extension;
|
||||
use Drupal\Core\Extension\ModuleHandlerInterface;
|
||||
|
@ -18,15 +17,11 @@ use Drupal\Core\Extension\ModuleInstallerInterface;
|
|||
use Drupal\Core\Form\FormBase;
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
use Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface;
|
||||
use Drupal\Core\Menu\MenuLinkManagerInterface;
|
||||
use Drupal\Core\Render\Element;
|
||||
use Drupal\Core\Routing\RouteMatchInterface;
|
||||
use Drupal\Core\Routing\RouteProviderInterface;
|
||||
use Drupal\Core\Session\AccountInterface;
|
||||
use Drupal\user\PermissionHandlerInterface;
|
||||
use Drupal\Core\Url;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
* Provides module installation interface.
|
||||
|
|
|
@ -14,7 +14,6 @@ use Drupal\Core\Extension\ModuleInstallerInterface;
|
|||
use Drupal\Core\Form\ConfirmFormBase;
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
use Drupal\Core\Url;
|
||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface;
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ use Drupal\Core\StreamWrapper\PublicStream;
|
|||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use Drupal\Core\Cache\Cache;
|
||||
use Drupal\Core\Config\ConfigFactoryInterface;
|
||||
use Drupal\Core\Extension\ModuleHandlerInterface;
|
||||
use Drupal\Core\Form\ConfigFormBase;
|
||||
|
@ -429,34 +428,32 @@ class ThemeSettingsForm extends ConfigFormBase {
|
|||
|
||||
// If the user uploaded a new logo or favicon, save it to a permanent location
|
||||
// and use it in place of the default theme-provided file.
|
||||
if ($this->moduleHandler->moduleExists('file')) {
|
||||
if ($file = $values['logo_upload']) {
|
||||
$filename = file_unmanaged_copy($file->getFileUri());
|
||||
$values['default_logo'] = 0;
|
||||
$values['logo_path'] = $filename;
|
||||
$values['toggle_logo'] = 1;
|
||||
}
|
||||
if ($file = $values['favicon_upload']) {
|
||||
$filename = file_unmanaged_copy($file->getFileUri());
|
||||
$values['default_favicon'] = 0;
|
||||
$values['favicon_path'] = $filename;
|
||||
$values['toggle_favicon'] = 1;
|
||||
}
|
||||
unset($values['logo_upload']);
|
||||
unset($values['favicon_upload']);
|
||||
if (!empty($values['logo_upload'])) {
|
||||
$filename = file_unmanaged_copy($values['logo_upload']->getFileUri());
|
||||
$values['default_logo'] = 0;
|
||||
$values['logo_path'] = $filename;
|
||||
$values['toggle_logo'] = 1;
|
||||
}
|
||||
if (!empty($values['favicon_upload'])) {
|
||||
$filename = file_unmanaged_copy($values['favicon_upload']->getFileUri());
|
||||
$values['default_favicon'] = 0;
|
||||
$values['favicon_path'] = $filename;
|
||||
$values['toggle_favicon'] = 1;
|
||||
}
|
||||
unset($values['logo_upload']);
|
||||
unset($values['favicon_upload']);
|
||||
|
||||
// If the user entered a path relative to the system files directory for
|
||||
// a logo or favicon, store a public:// URI so the theme system can handle it.
|
||||
if (!empty($values['logo_path'])) {
|
||||
$values['logo_path'] = $this->validatePath($values['logo_path']);
|
||||
}
|
||||
if (!empty($values['favicon_path'])) {
|
||||
$values['favicon_path'] = $this->validatePath($values['favicon_path']);
|
||||
}
|
||||
// If the user entered a path relative to the system files directory for
|
||||
// a logo or favicon, store a public:// URI so the theme system can handle it.
|
||||
if (!empty($values['logo_path'])) {
|
||||
$values['logo_path'] = $this->validatePath($values['logo_path']);
|
||||
}
|
||||
if (!empty($values['favicon_path'])) {
|
||||
$values['favicon_path'] = $this->validatePath($values['favicon_path']);
|
||||
}
|
||||
|
||||
if (empty($values['default_favicon']) && !empty($values['favicon_path'])) {
|
||||
$values['favicon_mimetype'] = $this->mimeTypeGuesser->guess($values['favicon_path']);
|
||||
}
|
||||
if (empty($values['default_favicon']) && !empty($values['favicon_path'])) {
|
||||
$values['favicon_mimetype'] = $this->mimeTypeGuesser->guess($values['favicon_path']);
|
||||
}
|
||||
|
||||
theme_settings_convert_to_config($values, $config)->save();
|
||||
|
|
|
@ -7,13 +7,11 @@
|
|||
|
||||
namespace Drupal\system\Plugin\Block;
|
||||
|
||||
use Drupal\Component\Utility\SafeMarkup;
|
||||
use Drupal\Core\Block\BlockBase;
|
||||
use Drupal\Core\Cache\Cache;
|
||||
use Drupal\Core\Config\ConfigFactoryInterface;
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
|
||||
use Drupal\Component\Utility\Xss;
|
||||
use Drupal\Core\Url;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
|
|
|
@ -9,8 +9,6 @@ namespace Drupal\system\Plugin\Block;
|
|||
|
||||
use Drupal\Core\Block\BlockBase;
|
||||
use Drupal\Core\Block\MainContentBlockPluginInterface;
|
||||
use Drupal\Core\Cache\Cache;
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
|
||||
/**
|
||||
* Provides a 'Main page content' block.
|
||||
|
|
|
@ -10,7 +10,6 @@ namespace Drupal\system\Plugin\Block;
|
|||
use Drupal\Core\Block\BlockBase;
|
||||
use Drupal\Core\Block\MessagesBlockPluginInterface;
|
||||
use Drupal\Core\Cache\Cache;
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
|
||||
/**
|
||||
* Provides a block to display the messages.
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
namespace Drupal\system\Plugin\Block;
|
||||
|
||||
use Drupal\Core\Block\BlockBase;
|
||||
use Drupal\Core\Cache\Cache;
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
|
||||
/**
|
||||
* Provides a 'Powered by Drupal' block.
|
||||
|
|
|
@ -14,7 +14,6 @@ use Drupal\Core\Path\AliasManagerInterface;
|
|||
use Drupal\Core\Path\CurrentPathStack;
|
||||
use Drupal\Core\Path\PathMatcherInterface;
|
||||
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
|
||||
use Drupal\Core\StringTranslation\StringTranslationTrait;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
|
||||
|
|
|
@ -11,8 +11,6 @@ use Drupal\Core\Menu\MenuActiveTrailInterface;
|
|||
use Drupal\Core\Menu\MenuLinkTreeInterface;
|
||||
use Drupal\Core\Menu\MenuLinkInterface;
|
||||
use Drupal\Core\Menu\MenuTreeParameters;
|
||||
use Symfony\Cmf\Component\Routing\RouteObjectInterface;
|
||||
use Drupal\Core\Database\Connection;
|
||||
use Drupal\Core\Extension\ModuleHandlerInterface;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
|
||||
|
|
|
@ -295,7 +295,7 @@ class SystemMenuBlockTest extends KernelTestBase {
|
|||
* Converts the result of MenuLinkTree::build() in a "menu link ID tree".
|
||||
*
|
||||
* @param array $build
|
||||
* The return value of of MenuLinkTree::build()
|
||||
* The return value of MenuLinkTree::build()
|
||||
*
|
||||
* @return array
|
||||
* The "menu link ID tree" representation of the given render array.
|
||||
|
|
|
@ -87,6 +87,15 @@ class ApcuBackendUnitTest extends GenericCacheBackendUnitTestBase {
|
|||
return;
|
||||
}
|
||||
parent::testSetGet();
|
||||
|
||||
// Make sure entries are permanent (i.e. no TTL).
|
||||
$backend = $this->getCacheBackend($this->getTestBin());
|
||||
$key = $backend->getApcuKey('TEST8');
|
||||
foreach (new \APCIterator('user', '/^' . $key . '/') as $item) {
|
||||
$this->assertEqual(0, $item['ttl']);
|
||||
$found = TRUE;
|
||||
}
|
||||
$this->assertTrue($found);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,7 +9,6 @@ namespace Drupal\system\Tests\Common;
|
|||
|
||||
use Drupal\Component\Serialization\Json;
|
||||
use Drupal\Component\Utility\Unicode;
|
||||
use Drupal\Component\Utility\Crypt;
|
||||
use Drupal\Core\Asset\AttachedAssets;
|
||||
use Drupal\simpletest\KernelTestBase;
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
namespace Drupal\system\Tests\Common;
|
||||
|
||||
use Drupal\Core\Render\MainContent\HtmlRenderer;
|
||||
use Drupal\simpletest\KernelTestBase;
|
||||
|
||||
/**
|
||||
|
|
|
@ -7,10 +7,7 @@
|
|||
|
||||
namespace Drupal\system\Tests\Common;
|
||||
|
||||
use Drupal\Component\Serialization\Json;
|
||||
use Drupal\Component\Utility\Html;
|
||||
use Drupal\Core\Render\Element;
|
||||
use Drupal\Core\Url;
|
||||
use Drupal\simpletest\KernelTestBase;
|
||||
|
||||
/**
|
||||
|
|
|
@ -7,9 +7,7 @@
|
|||
|
||||
namespace Drupal\system\Tests\Database;
|
||||
|
||||
use Doctrine\Common\Reflection\StaticReflectionProperty;
|
||||
use Drupal\Core\Database\Database;
|
||||
use Drupal\Core\Site\Settings;
|
||||
use Drupal\simpletest\KernelTestBase;
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,7 +9,6 @@ namespace Drupal\system\Tests\DrupalKernel;
|
|||
|
||||
use Drupal\simpletest\KernelTestBase;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Event\PostResponseEvent;
|
||||
|
||||
/**
|
||||
* Tests that services are correctly destructed.
|
||||
|
|
|
@ -569,7 +569,7 @@ class ConfigEntityQueryTest extends KernelTestBase {
|
|||
->condition('array.level1.level2', 3)
|
||||
->execute();
|
||||
$this->assertResults(array('5'));
|
||||
// Make sure that values on the wildcard level do not match if if there are
|
||||
// Make sure that values on the wildcard level do not match if there are
|
||||
// sub-keys defined. This must not find anything even if entity 2 has a
|
||||
// top-level key number with value 41.
|
||||
$this->queryResults = $this->factory->get('config_query_test')
|
||||
|
|
|
@ -390,7 +390,7 @@ class ContentEntityChangedTest extends EntityUnitTestBase {
|
|||
|
||||
$this->assertFalse(
|
||||
$this->getRevisionTranslationAffectedFlag($german),
|
||||
'Changed flag of of the German translation is not set for new revision without changes.'
|
||||
'Changed flag of the German translation is not set for new revision without changes.'
|
||||
);
|
||||
|
||||
$entity->setNewRevision();
|
||||
|
|
|
@ -26,7 +26,7 @@ class EntityFormTest extends WebTestBase {
|
|||
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$web_user = $this->drupalCreateUser(array('administer entity_test content'));
|
||||
$web_user = $this->drupalCreateUser(array('administer entity_test content', 'view test entity'));
|
||||
$this->drupalLogin($web_user);
|
||||
|
||||
// Add a language.
|
||||
|
@ -84,14 +84,14 @@ class EntityFormTest extends WebTestBase {
|
|||
$this->assertTrue($entity, format_string('%entity_type: Entity found in the database.', array('%entity_type' => $entity_type)));
|
||||
|
||||
$edit['name[0][value]'] = $name2;
|
||||
$this->drupalPostForm($entity_type . '/manage/' . $entity->id(), $edit, t('Save'));
|
||||
$this->drupalPostForm($entity_type . '/manage/' . $entity->id() . '/edit', $edit, t('Save'));
|
||||
$entity = $this->loadEntityByName($entity_type, $name1);
|
||||
$this->assertFalse($entity, format_string('%entity_type: The entity has been modified.', array('%entity_type' => $entity_type)));
|
||||
$entity = $this->loadEntityByName($entity_type, $name2);
|
||||
$this->assertTrue($entity, format_string('%entity_type: Modified entity found in the database.', array('%entity_type' => $entity_type)));
|
||||
$this->assertNotEqual($entity->name->value, $name1, format_string('%entity_type: The entity name has been modified.', array('%entity_type' => $entity_type)));
|
||||
|
||||
$this->drupalGet($entity_type . '/manage/' . $entity->id());
|
||||
$this->drupalGet($entity_type . '/manage/' . $entity->id() . '/edit');
|
||||
$this->clickLink(t('Delete'));
|
||||
$this->drupalPostForm(NULL, array(), t('Delete'));
|
||||
$entity = $this->loadEntityByName($entity_type, $name2);
|
||||
|
@ -125,12 +125,12 @@ class EntityFormTest extends WebTestBase {
|
|||
$this->assertEqual($translated_entity->name->value, $name1_ro, format_string('%entity_type: The translation has been added.', array('%entity_type' => $entity_type_id)));
|
||||
|
||||
$edit['name[0][value]'] = $name2_ro;
|
||||
$this->drupalPostForm('ro/' . $entity_type_id . '/manage/' . $entity->id(), $edit, t('Save'));
|
||||
$this->drupalPostForm('ro/' . $entity_type_id . '/manage/' . $entity->id() . '/edit', $edit, t('Save'));
|
||||
$translated_entity = $this->loadEntityByName($entity_type_id, $name1)->getTranslation('ro');
|
||||
$this->assertTrue($translated_entity, format_string('%entity_type: Modified translation found in the database.', array('%entity_type' => $entity_type_id)));
|
||||
$this->assertEqual($translated_entity->name->value, $name2_ro, format_string('%entity_type: The name of the translation has been modified.', array('%entity_type' => $entity_type_id)));
|
||||
|
||||
$this->drupalGet('ro/' . $entity_type_id . '/manage/' . $entity->id());
|
||||
$this->drupalGet('ro/' . $entity_type_id . '/manage/' . $entity->id() . '/edit');
|
||||
$this->clickLink(t('Delete'));
|
||||
$this->drupalPostForm(NULL, array(), t('Delete Romanian translation'));
|
||||
$entity = $this->loadEntityByName($entity_type_id, $name1);
|
||||
|
|
|
@ -37,6 +37,7 @@ class EntityRevisionsTest extends WebTestBase {
|
|||
// Create and login user.
|
||||
$this->webUser = $this->drupalCreateUser(array(
|
||||
'administer entity_test content',
|
||||
'view test entity',
|
||||
));
|
||||
$this->drupalLogin($this->webUser);
|
||||
}
|
||||
|
@ -110,7 +111,7 @@ class EntityRevisionsTest extends WebTestBase {
|
|||
|
||||
// Confirm the correct revision text appears in the edit form.
|
||||
$entity = entity_load($entity_type, $entity->id->value);
|
||||
$this->drupalGet($entity_type . '/manage/' . $entity->id->value);
|
||||
$this->drupalGet($entity_type . '/manage/' . $entity->id->value . '/edit');
|
||||
$this->assertFieldById('edit-name-0-value', $entity->name->value, format_string('%entity_type: Name matches in UI.', array('%entity_type' => $entity_type)));
|
||||
$this->assertFieldById('edit-field-test-text-0-value', $entity->field_test_text->value, format_string('%entity_type: Text matches in UI.', array('%entity_type' => $entity_type)));
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
namespace Drupal\system\Tests\Entity;
|
||||
|
||||
use Drupal\system\Tests\Entity\EntityUnitTestBase;
|
||||
use Drupal\system\Tests\TypedData;
|
||||
use Drupal\Core\TypedData\DataDefinition;
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@ namespace Drupal\system\Tests\Form;
|
|||
|
||||
use Drupal\Core\Form\FormState;
|
||||
use Drupal\simpletest\WebTestBase;
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
|
||||
/**
|
||||
* Tests the tableselect form element for expected behavior.
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
namespace Drupal\system\Tests\Path;
|
||||
|
||||
use Drupal\Core\Url;
|
||||
use Drupal\simpletest\WebTestBase;
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\system\Tests\Theme\TableTest.
|
||||
* Contains \Drupal\system\Tests\Render\Element\TableTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\system\Tests\Theme;
|
||||
namespace Drupal\system\Tests\Render\Element;
|
||||
|
||||
use Drupal\simpletest\KernelTestBase;
|
||||
|
|
@ -7,9 +7,7 @@
|
|||
|
||||
namespace Drupal\system\Tests\Routing;
|
||||
|
||||
use Drupal\Core\Routing\RequestHelper;
|
||||
use Drupal\simpletest\WebTestBase;
|
||||
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
|
||||
|
||||
/**
|
||||
* Function Tests for the routing permission system.
|
||||
|
|
|
@ -11,7 +11,6 @@ use Drupal\Core\Cache\Cache;
|
|||
use Drupal\Core\EventSubscriber\MainContentViewSubscriber;
|
||||
use Drupal\Core\Language\LanguageInterface;
|
||||
use Drupal\simpletest\WebTestBase;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Exception\RouteNotFoundException;
|
||||
use Drupal\Core\Url;
|
||||
|
||||
|
@ -92,6 +91,18 @@ class RouterTest extends WebTestBase {
|
|||
$headers = $this->drupalGetHeaders();
|
||||
$this->assertEqual($headers['x-drupal-cache-contexts'], 'user.roles');
|
||||
$this->assertEqual($headers['x-drupal-cache-tags'], '');
|
||||
|
||||
// Finally, verify that the X-Drupal-Cache-Contexts and X-Drupal-Cache-Tags
|
||||
// headers are not sent when their container parameter is set to FALSE.
|
||||
$this->drupalGet('router_test/test18');
|
||||
$headers = $this->drupalGetHeaders();
|
||||
$this->assertTrue(isset($headers['x-drupal-cache-contexts']));
|
||||
$this->assertTrue(isset($headers['x-drupal-cache-tags']));
|
||||
$this->setHttpResponseDebugCacheabilityHeaders(FALSE);
|
||||
$this->drupalGet('router_test/test18');
|
||||
$headers = $this->drupalGetHeaders();
|
||||
$this->assertFalse(isset($headers['x-drupal-cache-contexts']));
|
||||
$this->assertFalse(isset($headers['x-drupal-cache-tags']));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -184,6 +184,12 @@ class ThemeTest extends WebTestBase {
|
|||
)
|
||||
);
|
||||
$this->assertEqual($elements[0]['src'], file_create_url($uploaded_filename));
|
||||
|
||||
$this->container->get('theme_handler')->install(array('bartik'));
|
||||
$this->drupalGet('admin/appearance/settings/bartik');
|
||||
// The logo field should only be present on the global theme settings form.
|
||||
$this->assertNoFieldByName('logo_path');
|
||||
$this->drupalPostForm(NULL, [], t('Save configuration'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -70,7 +70,7 @@ class TokenReplaceUnitTest extends TokenReplaceUnitTestBase {
|
|||
// Non-existing token.
|
||||
$source .= '[bogus:token]';
|
||||
|
||||
// Replace with with the clear parameter, only the valid token should remain.
|
||||
// Replace with the clear parameter, only the valid token should remain.
|
||||
$target = Html::escape($this->config('system.site')->get('name'));
|
||||
$result = $this->tokenService->replace($source, array(), array('langcode' => $this->interfaceLanguage->getId(), 'clear' => TRUE));
|
||||
$this->assertEqual($target, $result, 'Valid tokens replaced while invalid tokens ignored.');
|
||||
|
|
|
@ -7,11 +7,7 @@
|
|||
|
||||
namespace Drupal\system\Tests\System;
|
||||
|
||||
use Drupal\Core\Site\Settings;
|
||||
use Drupal\Core\Url;
|
||||
use Drupal\simpletest\WebTestBase;
|
||||
use Drupal\user\Entity\User;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
* Tests output on the status overview page.
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
namespace Drupal\system\Tests\Theme;
|
||||
|
||||
use Drupal\simpletest\WebTestBase;
|
||||
use Drupal\Core\Template\Attribute;
|
||||
|
||||
/**
|
||||
* Tests Drupal's Twig filters.
|
||||
|
|
|
@ -7,10 +7,7 @@
|
|||
|
||||
namespace Drupal\system\Tests\Theme;
|
||||
|
||||
use Drupal\Component\Utility\SafeMarkup;
|
||||
use Drupal\Core\Language\LanguageInterface;
|
||||
use Drupal\Core\Url;
|
||||
use Drupal\language\Entity\ConfigurableLanguage;
|
||||
use Drupal\simpletest\WebTestBase;
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
namespace Drupal\system\Tests\Update;
|
||||
|
||||
use Drupal\filter\Entity\FilterFormat;
|
||||
use Drupal\system\Tests\Update\UpdatePathTestBase;
|
||||
|
||||
/**
|
||||
* Tests that the allowed html configutations are updated with attributes.
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
|
||||
namespace Drupal\system\Tests\Update;
|
||||
|
||||
use Drupal\node\Entity\Node;
|
||||
|
||||
/**
|
||||
* Tests the upgrade path for converting seven secondary local tasks into a block.
|
||||
*
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
|
||||
namespace Drupal\system\Tests\Update;
|
||||
|
||||
use Drupal\node\Entity\Node;
|
||||
|
||||
/**
|
||||
* Tests the upgrade path for local actions/tasks being converted into blocks.
|
||||
*
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
|
||||
namespace Drupal\system\Tests\Update;
|
||||
|
||||
use Drupal\Component\Render\FormattableMarkup;
|
||||
|
||||
/**
|
||||
* Tests hook_post_update().
|
||||
*
|
||||
|
@ -32,7 +34,7 @@ class UpdatePostUpdateTest extends UpdatePathTestBase {
|
|||
|
||||
// Ensure that normal and post_update updates are merged together on the
|
||||
// selection page.
|
||||
$this->assertRaw('<ul><li>8001 - Normal update_N() function. </li><li>First update.</li><li>Second update.</li><li>Test1 update.</li><li>Test0 update.</li></ul>');
|
||||
$this->assertRaw('<ul><li>8001 - Normal update_N() function. </li><li>First update.</li><li>Second update.</li><li>Test1 update.</li><li>Test0 update.</li><li>Testing batch processing in post updates update.</li></ul>');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -49,24 +51,34 @@ class UpdatePostUpdateTest extends UpdatePathTestBase {
|
|||
$this->assertRaw('Test1 update');
|
||||
$this->assertRaw('<h3>Update test0</h3>');
|
||||
$this->assertRaw('Test0 update');
|
||||
$this->assertRaw('<h3>Update test_batch</h3>');
|
||||
$this->assertRaw('Test post update batches');
|
||||
|
||||
// Test state value set by each post update.
|
||||
$updates = [
|
||||
'update_test_postupdate_post_update_first',
|
||||
'update_test_postupdate_post_update_second',
|
||||
'update_test_postupdate_post_update_test1',
|
||||
'update_test_postupdate_post_update_test0',
|
||||
'update_test_postupdate_post_update_test_batch-1',
|
||||
'update_test_postupdate_post_update_test_batch-2',
|
||||
'update_test_postupdate_post_update_test_batch-3',
|
||||
];
|
||||
$this->assertIdentical($updates, \Drupal::state()->get('post_update_test_execution', []));
|
||||
|
||||
$key_value = \Drupal::keyValue('post_update');
|
||||
$updates = array_merge([
|
||||
'block_post_update_disable_blocks_with_missing_contexts',
|
||||
'field_post_update_save_custom_storage_property',
|
||||
'field_post_update_entity_reference_handler_setting',
|
||||
'system_post_update_recalculate_configuration_entity_dependencies',
|
||||
'views_post_update_update_cacheability_metadata',
|
||||
], $updates);
|
||||
$this->assertEqual($updates, $key_value->get('existing_updates'));
|
||||
// Test post_update key value stores contains a list of the update functions
|
||||
// that have run.
|
||||
$existing_updates = array_count_values(\Drupal::keyValue('post_update')->get('existing_updates'));
|
||||
$expected_updates = [
|
||||
'update_test_postupdate_post_update_first',
|
||||
'update_test_postupdate_post_update_second',
|
||||
'update_test_postupdate_post_update_test1',
|
||||
'update_test_postupdate_post_update_test0',
|
||||
'update_test_postupdate_post_update_test_batch',
|
||||
];
|
||||
foreach ($expected_updates as $expected_update) {
|
||||
$this->assertEqual($existing_updates[$expected_update], 1, new FormattableMarkup("@expected_update exists in 'existing_updates' key and only appears once.", ['@expected_update' => $expected_update]));
|
||||
}
|
||||
|
||||
$this->drupalGet('update.php/selection');
|
||||
$this->assertText('No pending updates.');
|
||||
|
|
Reference in a new issue