File tree Expand file tree Collapse file tree
core/modules/block_content/tests/src/Functional/Update Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,9 +41,24 @@ public function testParentFieldsAddition() {
4141 // 'info' field.
4242 $ this ->container ->get ('module_installer ' )->install (['block_content_view_override ' ]);
4343
44+ // Ensure that parent entity fields are not present before updates.
45+ $ this ->assertEmpty ($ entity_definition_update_manager ->getFieldStorageDefinition ('parent_entity_type ' , 'block_content ' ));
46+ $ this ->assertEmpty ($ entity_definition_update_manager ->getFieldStorageDefinition ('parent_entity_id ' , 'block_content ' ));
47+
48+ // Ensure that 'has_parent' filter is not present before updates.
49+ $ view_config = \Drupal::configFactory ()->get ('views.view.block_content ' );
50+ $ this ->assertFalse ($ view_config ->isNew ());
51+ $ this ->assertEmpty ($ view_config ->get ('display.default.display_options.filters.has_parent ' ));
52+ $ this ->assertEmpty ($ view_config ->get ('display.page_2.display_options.filters.has_parent ' ));
4453 // Run updates.
4554 $ this ->runUpdates ();
4655
56+ // Ensure that 'has_parent' filter is present after updates.
57+ \Drupal::configFactory ()->clearStaticCache ();
58+ $ view_config = \Drupal::configFactory ()->get ('views.view.block_content ' );
59+ $ this ->assertNotEmpty ($ view_config ->get ('display.default.display_options.filters.has_parent ' ));
60+ $ this ->assertNotEmpty ($ view_config ->get ('display.page_2.display_options.filters.has_parent ' ));
61+
4762 // Check that the 'parent_entity_type' field exists and is configured
4863 // correctly.
4964 $ parent_type_field = $ entity_definition_update_manager ->getFieldStorageDefinition ('parent_entity_type ' , 'block_content ' );
You can’t perform that action at this time.
0 commit comments