Commit 4dd3e6a5 authored by alexpott's avatar alexpott
Browse files

Issue #2751363 by jibran: Don't allow test entities to share base table

parent f2d19d2d
......@@ -271,6 +271,7 @@ public function testEntityFormatterRecursiveRendering() {
* Tests the label formatter.
*/
public function testLabelFormatter() {
$this->installEntitySchema('entity_test_label');
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
$formatter = 'entity_reference_label';
......
......@@ -15,7 +15,7 @@
* },
* "translation" = "Drupal\content_translation\ContentTranslationHandler"
* },
* base_table = "entity_test",
* base_table = "entity_test_cache",
* entity_keys = {
* "id" = "id",
* "uuid" = "uuid",
......
......@@ -15,7 +15,7 @@
* "default" = "Drupal\entity_test\EntityTestForm"
* }
* },
* base_table = "entity_test",
* base_table = "entity_test_constraint_violation",
* persistent_cache = FALSE,
* entity_keys = {
* "id" = "id",
......
......@@ -8,7 +8,7 @@
* @ContentEntityType(
* id = "entity_test_default_access",
* label = @Translation("Test entity with default access"),
* base_table = "entity_test",
* base_table = "entity_test_default_access",
* entity_keys = {
* "id" = "id",
* "bundle" = "type"
......
......@@ -12,7 +12,7 @@
* "access" = "Drupal\entity_test\EntityTestAccessControlHandler",
* "view_builder" = "Drupal\entity_test\EntityTestViewBuilder"
* },
* base_table = "entity_test",
* base_table = "entity_test_label",
* render_cache = FALSE,
* entity_keys = {
* "uuid" = "uuid",
......
......@@ -9,7 +9,7 @@
* id = "entity_test_label_callback",
* label = @Translation("Entity test label callback"),
* persistent_cache = FALSE,
* base_table = "entity_test",
* base_table = "entity_test_label_callback",
* label_callback = "entity_test_label_callback",
* entity_keys = {
* "id" = "id",
......
......@@ -9,7 +9,7 @@
* id = "entity_test_no_label",
* label = @Translation("Entity Test without label"),
* persistent_cache = FALSE,
* base_table = "entity_test",
* base_table = "entity_test_no_label",
* entity_keys = {
* "id" = "id",
* "bundle" = "type"
......
......@@ -12,7 +12,7 @@
* "access" = "Drupal\entity_test\EntityTestAccessControlHandler",
* "view_builder" = "Drupal\entity_test\EntityTestViewBuilderOverriddenView",
* },
* base_table = "entity_test",
* base_table = "entity_test_view_builder",
* render_cache = FALSE,
* entity_keys = {
* "id" = "id",
......
......@@ -165,6 +165,7 @@ public function testEntityViewBuilderCacheToggling() {
$this->assertTrue(isset($build['#cache']) && array_keys($build['#cache']) == ['tags', 'contexts', 'max-age'], 'A view mode with render cache disabled has the correct output (only cache tags, contexts and max-age).');
// Test that an entity type can opt out of render caching completely.
$this->installEntitySchema('entity_test_label');
$entity_test_no_cache = $this->createTestEntity('entity_test_label');
$entity_test_no_cache->save();
$build = $this->container->get('entity.manager')->getViewBuilder('entity_test_label')->view($entity_test_no_cache, 'full');
......
......@@ -274,6 +274,7 @@ function testFieldWrite() {
function testLongNames() {
// Use one of the longest entity_type names in core.
$entity_type = $bundle = 'entity_test_label_callback';
$this->installEntitySchema('entity_test_label_callback');
$storage = $this->container->get('entity.manager')->getStorage($entity_type);
// Create two fields and generate random values.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment