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,8 +7,6 @@
|
|||
|
||||
namespace Drupal\cache_test\Controller;
|
||||
|
||||
use Drupal\Component\Utility\SafeMarkup;
|
||||
use Drupal\Core\Render\HtmlResponse;
|
||||
use Drupal\Core\Url;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
|
||||
use Drupal\Core\Database\Query\AlterableInterface;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
|
||||
/**
|
||||
* Implements hook_query_alter().
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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 {
|
||||
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
* }
|
||||
* )
|
||||
|
|
|
@ -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",
|
||||
* }
|
||||
* )
|
||||
|
|
|
@ -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",
|
||||
* }
|
||||
* )
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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;
|
||||
|
||||
/**
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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'),
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
namespace Drupal\plugin_test\Plugin\plugin_test\mock_block;
|
||||
|
||||
use Drupal\Core\Plugin\Context\ContextDefinition;
|
||||
use Drupal\Core\Plugin\ContextAwarePluginBase;
|
||||
|
||||
/**
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
namespace Drupal\plugin_test\Plugin\plugin_test\mock_block;
|
||||
|
||||
use Drupal\Core\Plugin\Context\ContextDefinition;
|
||||
use Drupal\Core\Plugin\ContextAwarePluginBase;
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
|
||||
namespace Drupal\test_page_test\Controller;
|
||||
|
||||
use Drupal\Component\Utility\Html;
|
||||
|
||||
/**
|
||||
* Defines a test controller for page titles.
|
||||
*/
|
||||
|
|
|
@ -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';
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
/**
|
||||
|
|
Reference in a new issue