Update to drupal-org-drupal 8.0.0-rc2. For more information, see https://www.drupal.org/node/2598668

This commit is contained in:
Pantheon Automation 2015-10-21 21:44:50 -07:00 committed by Greg Anderson
parent f32e58e4b1
commit 8e18df8c36
3062 changed files with 15044 additions and 172506 deletions

View file

@ -47,25 +47,25 @@ a.tabledrag-handle:hover .handle,
a.tabledrag-handle:focus .handle {
background-image: url(../../../../misc/icons/000000/move.svg);
}
.touch .draggable td {
.touchevents .draggable td {
padding: 0 10px;
}
.touch .draggable .menu-item__link {
.touchevents .draggable .menu-item__link {
display: inline-block;
padding: 10px 0;
}
.touch a.tabledrag-handle {
.touchevents a.tabledrag-handle {
height: 44px;
width: 40px;
}
.touch a.tabledrag-handle .handle {
.touchevents a.tabledrag-handle .handle {
background-position: 40% 19px; /* LTR */
height: 21px;
}
[dir="rtl"] .touch a.tabledrag-handle .handle {
background-position: right 40% top 19px;
}
.touch .draggable.drag a.tabledrag-handle .handle {
.touchevents .draggable.drag a.tabledrag-handle .handle {
background-position: 50% -32px;
}
.tabledrag-toggle-weight-wrapper {

View file

@ -5,7 +5,7 @@
(function ($, Drupal, drupalSettings) {
"use strict";
'use strict';
var dateFormats = drupalSettings.dateFormats;

View file

@ -5,7 +5,7 @@
(function ($, Drupal, drupalSettings) {
"use strict";
'use strict';
// Cache IDs in an array for ease of use.
var ids = [];

View file

@ -5,7 +5,7 @@
(function ($, Drupal, debounce) {
"use strict";
'use strict';
/**
* Filters the module list table by a text input search string.

View file

@ -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;

View file

@ -8,7 +8,6 @@
namespace Drupal\system\Entity;
use Drupal\Core\Config\Entity\ConfigEntityBase;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\system\MenuInterface;
/**

View file

@ -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;

View file

@ -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.

View file

@ -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;

View file

@ -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();

View file

@ -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;

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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;

View file

@ -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;

View file

@ -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.

View file

@ -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);
}
/**

View file

@ -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;

View file

@ -7,7 +7,6 @@
namespace Drupal\system\Tests\Common;
use Drupal\Core\Render\MainContent\HtmlRenderer;
use Drupal\simpletest\KernelTestBase;
/**

View file

@ -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;
/**

View file

@ -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;
/**

View file

@ -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.

View file

@ -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')

View file

@ -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();

View file

@ -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);

View file

@ -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)));
}

View file

@ -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;

View file

@ -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.

View file

@ -7,7 +7,6 @@
namespace Drupal\system\Tests\Path;
use Drupal\Core\Url;
use Drupal\simpletest\WebTestBase;
/**

View file

@ -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;

View file

@ -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.

View file

@ -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']));
}
/**

View file

@ -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'));
}
/**

View file

@ -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.');

View file

@ -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.

View file

@ -8,7 +8,6 @@
namespace Drupal\system\Tests\Theme;
use Drupal\simpletest\WebTestBase;
use Drupal\Core\Template\Attribute;
/**
* Tests Drupal's Twig filters.

View file

@ -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;
/**

View file

@ -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.

View file

@ -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.
*

View file

@ -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.
*

View file

@ -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.');

View file

@ -5,11 +5,7 @@
* Admin page callbacks for the system module.
*/
use Drupal\Component\Utility\SafeMarkup;
use Drupal\Component\Utility\Xss;
use Drupal\Component\Utility\Html;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Extension\Extension;
use Drupal\Core\Render\Element;
use Drupal\Core\Template\Attribute;

View file

@ -7,11 +7,9 @@
use Drupal\Component\Utility\Crypt;
use Drupal\Component\Utility\Environment;
use Drupal\Component\Utility\SafeMarkup;
use Drupal\Core\Url;
use Drupal\Core\Database\Database;
use Drupal\Core\DrupalKernel;
use Drupal\Core\Language\Language;
use Drupal\Core\Site\Settings;
use Drupal\Core\StreamWrapper\PrivateStream;
use Drupal\Core\StreamWrapper\PublicStream;

View file

@ -7,8 +7,6 @@
namespace Drupal\cache_test\Controller;
use Drupal\Component\Utility\SafeMarkup;
use Drupal\Core\Render\HtmlResponse;
use Drupal\Core\Url;
/**

View file

@ -1,7 +1,6 @@
<?php
use Drupal\Core\Database\Query\AlterableInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
/**
* Implements hook_query_alter().

View file

@ -62,26 +62,6 @@ class EntityTestController extends ControllerBase {
return $form;
}
/**
* Displays the 'Edit existing entity_test' form.
*
* @param \Drupal\Core\Routing\RouteMatchInterface $route_match
* The route match object to get entity type from.
* @param string $entity_type_id
* The entity type ID.
*
* @return array
* The processed form for the edited entity.
*
* @see \Drupal\entity_test\Routing\EntityTestRoutes::routes()
*/
public function testEdit(RouteMatchInterface $route_match, $entity_type_id) {
$entity = $route_match->getParameter($entity_type_id);
$form = $this->entityFormBuilder()->getForm($entity);
$form['#title'] = $entity->label();
return $form;
}
/**
* Returns an empty page.
*

View file

@ -28,10 +28,14 @@ use Drupal\user\UserInterface;
* "default" = "Drupal\entity_test\EntityTestForm",
* "delete" = "Drupal\entity_test\EntityTestDeleteForm"
* },
* "route_provider" = {
* "html" = "Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider",
* },
* "translation" = "Drupal\content_translation\ContentTranslationHandler",
* "views_data" = "Drupal\entity_test\EntityTestViewsData"
* },
* base_table = "entity_test",
* admin_permission = "administer entity_test content",
* persistent_cache = FALSE,
* list_cache_contexts = { "entity_test_view_grants" },
* entity_keys = {
@ -43,7 +47,7 @@ use Drupal\user\UserInterface;
* },
* links = {
* "canonical" = "/entity_test/{entity_test}",
* "edit-form" = "/entity_test/manage/{entity_test}",
* "edit-form" = "/entity_test/manage/{entity_test}/edit",
* "delete-form" = "/entity_test/delete/entity_test/{entity_test}",
* },
* field_ui_base_route = "entity.entity_test.admin_form",

View file

@ -0,0 +1,49 @@
<?php
/**
* @file
* Contains \Drupal\entity_test\Entity\EntityTestAdminRoutes.
*/
namespace Drupal\entity_test\Entity;
/**
* Defines a test entity type with administrative routes.
*
* @ContentEntityType(
* id = "entity_test_admin_routes",
* label = @Translation("Test entity - admin routes"),
* handlers = {
* "view_builder" = "Drupal\entity_test\EntityTestViewBuilder",
* "access" = "Drupal\entity_test\EntityTestAccessControlHandler",
* "form" = {
* "default" = "Drupal\entity_test\EntityTestForm",
* "delete" = "Drupal\entity_test\EntityTestDeleteForm"
* },
* "translation" = "Drupal\content_translation\ContentTranslationHandler",
* "views_data" = "Drupal\views\EntityViewsData",
* "route_provider" = {
* "html" = "Drupal\Core\Entity\Routing\AdminHtmlRouteProvider",
* },
* },
* base_table = "entity_test_admin_routes",
* data_table = "entity_test_admin_routes_property_data",
* admin_permission = "administer entity_test content",
* translatable = TRUE,
* entity_keys = {
* "id" = "id",
* "uuid" = "uuid",
* "bundle" = "type",
* "label" = "name",
* "langcode" = "langcode",
* },
* links = {
* "canonical" = "/entity_test_admin_routes/manage/{entity_test_admin_routes}",
* "edit-form" = "/entity_test_admin_routes/manage/{entity_test_admin_routes}/edit",
* "delete-form" = "/entity_test/delete/entity_test_admin_routes/{entity_test_admin_routes}",
* },
* )
*/
class EntityTestAdminRoutes extends EntityTest {
}

View file

@ -9,6 +9,7 @@ namespace Drupal\entity_test\Entity;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Field\BaseFieldDefinition;
use Drupal\entity_test\FieldStorageDefinition;
/**
* Defines a test entity class for base fields display.
@ -21,16 +22,23 @@ use Drupal\Core\Field\BaseFieldDefinition;
* "form" = {
* "default" = "Drupal\entity_test\EntityTestForm"
* },
* "translation" = "Drupal\content_translation\ContentTranslationHandler"
* "translation" = "Drupal\content_translation\ContentTranslationHandler",
* "route_provider" = {
* "html" = "Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider",
* },
* },
* base_table = "entity_test",
* base_table = "entity_test_base_field_display",
* admin_permission = "administer entity_test content",
* entity_keys = {
* "id" = "id",
* "label" = "name",
* "uuid" = "uuid",
* "bundle" = "type"
* },
* links = {
* "canonical" = "/entity_test_base_field_display/{entity_test_base_field_display}/edit",
* "edit-form" = "/entity_test_base_field_display/manage/{entity_test_base_field_display}",
* "delete-form" = "/entity_test/delete/entity_test_base_field_display/{entity_test_base_field_display}/edit",
* },
* field_ui_base_route = "entity.entity_test_base_field_display.admin_form",
* )
@ -70,6 +78,18 @@ class EntityTestBaseFieldDisplay extends EntityTest {
'weight' => 11,
));
$fields['test_display_multiple'] = BaseFieldDefinition::create('text')
->setLabel(t('A field with multiple values'))
->setCardinality(FieldStorageDefinition::CARDINALITY_UNLIMITED)
->setDisplayOptions('view', array(
'type' => 'text_default',
'weight' => 12,
))
->setDisplayOptions('form', array(
'type' => 'text_textfield',
'weight' => 12,
));
return $fields;
}

View file

@ -7,10 +7,6 @@
namespace Drupal\entity_test\Entity;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Field\BaseFieldDefinition;
use Drupal\entity_test\Entity\EntityTest;
/**
* Defines the test entity class.
*
@ -25,10 +21,14 @@ use Drupal\entity_test\Entity\EntityTest;
* "delete" = "Drupal\entity_test\EntityTestDeleteForm"
* },
* "translation" = "Drupal\content_translation\ContentTranslationHandler",
* "views_data" = "Drupal\views\EntityViewsData"
* "views_data" = "Drupal\views\EntityViewsData",
* "route_provider" = {
* "html" = "Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider",
* },
* },
* base_table = "entity_test_mul",
* data_table = "entity_test_mul_property_data",
* admin_permission = "administer entity_test content",
* translatable = TRUE,
* entity_keys = {
* "id" = "id",
@ -39,7 +39,7 @@ use Drupal\entity_test\Entity\EntityTest;
* },
* links = {
* "canonical" = "/entity_test_mul/manage/{entity_test_mul}",
* "edit-form" = "/entity_test_mul/manage/{entity_test_mul}",
* "edit-form" = "/entity_test_mul/manage/{entity_test_mul}/edit",
* "delete-form" = "/entity_test/delete/entity_test_mul/{entity_test_mul}",
* },
* field_ui_base_route = "entity.entity_test_mul.admin_form",

View file

@ -25,6 +25,9 @@ use Drupal\Core\Field\BaseFieldDefinition;
* "default" = "Drupal\entity_test\EntityTestForm",
* "delete" = "Drupal\entity_test\EntityTestDeleteForm"
* },
* "route_provider" = {
* "html" = "Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider",
* },
* "translation" = "Drupal\content_translation\ContentTranslationHandler",
* "views_data" = "Drupal\views\EntityViewsData"
* },
@ -40,7 +43,7 @@ use Drupal\Core\Field\BaseFieldDefinition;
* },
* links = {
* "canonical" = "/entity_test_mul_changed/manage/{entity_test_mul_changed}",
* "edit-form" = "/entity_test_mul_changed/manage/{entity_test_mul_changed}",
* "edit-form" = "/entity_test_mul_changed/manage/{entity_test_mul_changed}/edit",
* "delete-form" = "/entity_test/delete/entity_test_mul_changed/{entity_test_mul_changed}",
* },
* field_ui_base_route = "entity.entity_test_mul_changed.admin_form",

View file

@ -23,10 +23,14 @@ use Drupal\Core\Entity\EntityTypeInterface;
* "delete" = "Drupal\entity_test\EntityTestDeleteForm"
* },
* "translation" = "Drupal\content_translation\ContentTranslationHandler",
* "views_data" = "Drupal\views\EntityViewsData"
* "views_data" = "Drupal\views\EntityViewsData",
* "route_provider" = {
* "html" = "Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider",
* },
* },
* base_table = "entity_test_mul_langcode_key",
* data_table = "entity_test_mul_langcode_key_field_data",
* admin_permission = "administer entity_test content",
* translatable = TRUE,
* entity_keys = {
* "id" = "id",
@ -38,7 +42,7 @@ use Drupal\Core\Entity\EntityTypeInterface;
* },
* links = {
* "canonical" = "/entity_test_mul_langcode_key/manage/{entity_test_mul_langcode_key}",
* "edit-form" = "/entity_test_mul_langcode_key/manage/{entity_test_mul_langcode_key}",
* "edit-form" = "/entity_test_mul_langcode_key/manage/{entity_test_mul_langcode_key}/edit",
* "delete-form" = "/entity_test/delete/entity_test_mul_langcode_key/{entity_test_mul_langcode_key}",
* },
* field_ui_base_route = "entity.entity_test_mul_langcode_key.admin_form",

View file

@ -7,10 +7,6 @@
namespace Drupal\entity_test\Entity;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Field\BaseFieldDefinition;
use Drupal\entity_test\Entity\EntityTestRev;
/**
* Defines the test entity class.
*
@ -25,12 +21,16 @@ use Drupal\entity_test\Entity\EntityTestRev;
* "delete" = "Drupal\entity_test\EntityTestDeleteForm"
* },
* "translation" = "Drupal\content_translation\ContentTranslationHandler",
* "views_data" = "Drupal\views\EntityViewsData"
* "views_data" = "Drupal\views\EntityViewsData",
* "route_provider" = {
* "html" = "Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider",
* },
* },
* base_table = "entity_test_mulrev",
* data_table = "entity_test_mulrev_property_data",
* revision_table = "entity_test_mulrev_revision",
* revision_data_table = "entity_test_mulrev_property_revision",
* admin_permission = "administer entity_test content",
* translatable = TRUE,
* entity_keys = {
* "id" = "id",
@ -43,7 +43,7 @@ use Drupal\entity_test\Entity\EntityTestRev;
* links = {
* "canonical" = "/entity_test_mulrev/manage/{entity_test_mulrev}",
* "delete-form" = "/entity_test/delete/entity_test_mulrev/{entity_test_mulrev}",
* "edit-form" = "/entity_test_mulrev/manage/{entity_test_mulrev}",
* "edit-form" = "/entity_test_mulrev/manage/{entity_test_mulrev}/edit",
* "revision" = "/entity_test_mulrev/{entity_test_mulrev}/revision/{entity_test_mulrev_revision}/view",
* }
* )

View file

@ -23,6 +23,9 @@ use Drupal\Core\Field\BaseFieldDefinition;
* "default" = "Drupal\entity_test\EntityTestForm",
* "delete" = "Drupal\entity_test\EntityTestDeleteForm"
* },
* "route_provider" = {
* "html" = "Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider",
* },
* "translation" = "Drupal\content_translation\ContentTranslationHandler",
* "views_data" = "Drupal\views\EntityViewsData"
* },
@ -42,7 +45,7 @@ use Drupal\Core\Field\BaseFieldDefinition;
* links = {
* "canonical" = "/entity_test_mulrev_changed/manage/{entity_test_mulrev_changed}",
* "delete-form" = "/entity_test/delete/entity_test_mulrev_changed/{entity_test_mulrev_changed}",
* "edit-form" = "/entity_test_mulrev_changed/manage/{entity_test_mulrev_changed}",
* "edit-form" = "/entity_test_mulrev_changed/manage/{entity_test_mulrev_changed}/edit",
* "revision" = "/entity_test_mulrev_changed/{entity_test_mulrev_changed}/revision/{entity_test_mulrev_changed_revision}/view",
* }
* )

View file

@ -9,7 +9,6 @@ namespace Drupal\entity_test\Entity;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Field\BaseFieldDefinition;
use Drupal\entity_test\Entity\EntityTest;
/**
* Defines the test entity class.
@ -19,16 +18,21 @@ use Drupal\entity_test\Entity\EntityTest;
* label = @Translation("Test entity - revisions"),
* handlers = {
* "access" = "Drupal\entity_test\EntityTestAccessControlHandler",
* "view_builder" = "Drupal\entity_test\EntityTestViewBuilder",
* "form" = {
* "default" = "Drupal\entity_test\EntityTestForm",
* "delete" = "Drupal\entity_test\EntityTestDeleteForm"
* },
* "view_builder" = "Drupal\entity_test\EntityTestViewBuilder",
* "translation" = "Drupal\content_translation\ContentTranslationHandler",
* "views_data" = "Drupal\views\EntityViewsData"
* "views_data" = "Drupal\views\EntityViewsData",
* "route_provider" = {
* "html" = "Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider",
* },
* },
* base_table = "entity_test_rev",
* revision_table = "entity_test_rev_revision",
* admin_permission = "administer entity_test content",
* entity_keys = {
* "id" = "id",
* "uuid" = "uuid",
@ -40,7 +44,7 @@ use Drupal\entity_test\Entity\EntityTest;
* links = {
* "canonical" = "/entity_test_rev/manage/{entity_test_rev}",
* "delete-form" = "/entity_test/delete/entity_test_rev/{entity_test_rev}",
* "edit-form" = "/entity_test_rev/manage/{entity_test_rev}",
* "edit-form" = "/entity_test_rev/manage/{entity_test_rev}/edit",
* "revision" = "/entity_test_rev/{entity_test_rev}/revision/{entity_test_rev_revision}/view",
* }
* )

View file

@ -20,9 +20,13 @@ use Drupal\Core\Entity\EntityTypeInterface;
* "form" = {
* "default" = "Drupal\entity_test\EntityTestForm"
* },
* "translation" = "Drupal\content_translation\ContentTranslationHandler"
* "translation" = "Drupal\content_translation\ContentTranslationHandler",
* "route_provider" = {
* "html" = "Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider",
* },
* },
* base_table = "entity_test_string",
* admin_permission = "administer entity_test content",
* entity_keys = {
* "id" = "id",
* "uuid" = "uuid",

View file

@ -10,7 +10,6 @@ namespace Drupal\entity_test;
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityAccessControlHandler;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Session\AccountInterface;
/**

View file

@ -9,7 +9,6 @@ namespace Drupal\entity_test;
use Drupal\Component\Utility\Random;
use Drupal\Core\Entity\ContentEntityForm;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Language\LanguageInterface;
/**
* Form controller for the test entity edit forms.

View file

@ -7,7 +7,6 @@
namespace Drupal\entity_test\Plugin\Validation\Constraint;
use Drupal\Core\Entity\EntityTypeInterface;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;

View file

@ -33,30 +33,6 @@ class EntityTestRoutes {
array('_permission' => 'administer entity_test content')
);
$routes["entity.$entity_type_id.canonical"] = new Route(
$entity_type_id . '/manage/{' . $entity_type_id . '}',
array('_controller' => '\Drupal\entity_test\Controller\EntityTestController::testEdit', 'entity_type_id' => $entity_type_id),
array('_permission' => 'administer entity_test content'),
array('parameters' => array(
$entity_type_id => array('type' => 'entity:' . $entity_type_id),
))
);
$routes["entity.$entity_type_id.edit_form"] = new Route(
$entity_type_id . '/manage/{' . $entity_type_id . '}',
array('_controller' => '\Drupal\entity_test\Controller\EntityTestController::testEdit', 'entity_type_id' => $entity_type_id),
array('_permission' => 'administer entity_test content'),
array('parameters' => array(
$entity_type_id => array('type' => 'entity:' . $entity_type_id),
))
);
$routes["entity.$entity_type_id.delete_form"] = new Route(
'entity_test/delete/' . $entity_type_id . '/{' . $entity_type_id . '}',
array('_entity_form' => $entity_type_id . '.delete'),
array('_permission' => 'administer entity_test content')
);
$routes["entity.$entity_type_id.admin_form"] = new Route(
"$entity_type_id/structure/{bundle}",
array('_controller' => '\Drupal\entity_test\Controller\EntityTestController::testAdmin'),

View file

@ -8,7 +8,6 @@
namespace Drupal\menu_test;
use Drupal\Component\Utility\SafeMarkup;
use Drupal\Core\Entity\EntityInterface;
/**
* Controllers for testing the menu integration routing system.

View file

@ -7,7 +7,6 @@
namespace Drupal\plugin_test\Plugin\plugin_test\mock_block;
use Drupal\Core\Plugin\Context\ContextDefinition;
use Drupal\Core\Plugin\ContextAwarePluginBase;
/**

View file

@ -7,8 +7,6 @@
namespace Drupal\plugin_test\Plugin\plugin_test\mock_block;
use Drupal\Component\Plugin\PluginBase;
/**
* Mock implementation of a menu block plugin used by Plugin API unit tests.
*

View file

@ -7,7 +7,6 @@
namespace Drupal\plugin_test\Plugin\plugin_test\mock_block;
use Drupal\Core\Plugin\Context\ContextDefinition;
use Drupal\Core\Plugin\ContextAwarePluginBase;
/**

View file

@ -8,7 +8,6 @@
namespace Drupal\session_test\Controller;
use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

View file

@ -275,6 +275,13 @@ class SystemTestController extends ControllerBase {
return new Response('test');
}
/**
* A plain Symfony reponse with Cache-Control: public, max-age=60.
*/
public function respondWithPublicResponse() {
return (new Response('test'))->setPublic()->setMaxAge(60);
}
/**
* A simple page callback that uses a CacheableResponse object.
*/

View file

@ -137,6 +137,13 @@ system_test.respond_response:
requirements:
_access: 'TRUE'
system_test.respond_public_response:
path: '/system-test/respond-public-response'
defaults:
_controller: '\Drupal\system_test\Controller\SystemTestController::respondWithPublicResponse'
requirements:
_access: 'TRUE'
system_test.respond_cacheable_response:
path: '/system-test/respond-cacheable-reponse'
defaults:

View file

@ -7,8 +7,6 @@
namespace Drupal\test_page_test\Controller;
use Drupal\Component\Utility\Html;
/**
* Defines a test controller for page titles.
*/

View file

@ -43,3 +43,22 @@ function update_test_postupdate_post_update_test0() {
return 'Test0 update';
}
/**
* Testing batch processing in post updates update.
*/
function update_test_postupdate_post_update_test_batch(&$sandbox = NULL) {
if (!isset($sandbox['steps'])) {
$sandbox['current_step'] = 0;
$sandbox['steps'] = 3;
}
$sandbox['current_step']++;
$execution = \Drupal::state()->get('post_update_test_execution', []);
$execution[] = __FUNCTION__ . '-' . $sandbox['current_step'];
\Drupal::state()->set('post_update_test_execution', $execution);
$sandbox['#finished'] = $sandbox['current_step'] / $sandbox['steps'];
return 'Test post update batches';
}

View file

@ -153,7 +153,7 @@ class EntityReferenceSelectionReferenceableTest extends KernelTestBase {
// Referenceables containing '_', limited to 3. Expecting 3 limited items
// ('Xyz_', 'xyabz_', 'foo_') and 5 total.
['_', 'CONTAINS', 3, 3, ['Xyz_', 'xyabz_', 'foo_'], 6],
// Referenceables ending with with 'z_', limited to 3. Expecting 3 limited
// Referenceables ending with 'z_', limited to 3. Expecting 3 limited
// items ('Xyz_', 'xyabz_', 'baz_') and 4 total.
['z_', 'ENDS_WITH', 3, 3, ['Xyz_', 'xyabz_', 'baz_'], 4],
// Referenceables identical with 'xyabz_', no limit. Expecting 1 item

View file

@ -7,7 +7,6 @@
namespace Drupal\Tests\system\Kernel\Extension;
use Drupal\Component\FileCache\FileCacheFactory;
use Drupal\Core\DependencyInjection\ContainerBuilder;
use \Drupal\Core\Extension\ModuleUninstallValidatorException;
use Drupal\KernelTests\KernelTestBase;

View file

@ -11,7 +11,6 @@ use Drupal\Core\Access\AccessResult;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Link;
use Drupal\Core\Access\AccessResultAllowed;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\StringTranslation\TranslationInterface;
use Drupal\Core\Url;
use Drupal\Core\Utility\LinkGeneratorInterface;
@ -21,7 +20,6 @@ use Symfony\Cmf\Component\Routing\RouteObjectInterface;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\HttpFoundation\ParameterBag;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\RequestContext;
use Symfony\Component\Routing\Route;
/**