- Issue created by @dpi
Theres quite a lot of use of the \Drupal\Tests\BrowserTestBase::drupalPlaceBlock
from \Drupal\Tests\block\Traits\BlockCreationTrait
in tests. Each use of this method requires the block.module to be installed, along with Block config, its associated schema. Bringing in block.module cause the \Drupal\block\Plugin\DisplayVariant\BlockPageVariant
display variant to engage.
There are many usages of drupalPlaceBlock
with typical navigation blocks such as:
\Drupal\Core\Block\Plugin\Block\PageTitleBlock
page_title_block\Drupal\Core\Menu\Plugin\Block\LocalTasksBlock
local_tasks_block\Drupal\Core\Menu\Plugin\Block\LocalActionsBlock
local_actions_block\Drupal\system\Plugin\Block\SystemBreadcrumbBlock
system_breadcrumb_blockEach of which is either defined in core, or uses services fundamentally defined by core.
It would make sense to reduce the dependency on block.module, in tests which do not have a dependency on the specific rendering of BlockPageVariant
and specifically \Drupal\block\Entity\Block
configuration entities.
We're able to implement a simple test module in core implementing a variant which programmatically outputs the typical build/render-arrays of the above navigation blocks.
Doing this will remove the dependency on Block, so there's less to go wrong, less setup, and potential performance improvements.
Discuss, implement.
None.
None.
New module.
Tweaks to tests, which may break tests extending core tests. (not covered by BC?)
None.
Maybe.
Active
11.0 🔥
phpunit