Install
Works with Drupal: ^9.4 || ^10Using Composer to manage Drupal site dependencies
Alternative installation files
Release notes
Reworked services initialization flow to simplify the flow.
Some internal functions were reworked to use original YAML files from core. This gives an ability to proper implement parent services, container parameters and simplify the logic.
Because of a lot of changes under the hood, I've released a beta version to wide test this before the stable release. Please report issues.
If your unit tests with the previous version stop working with the current release, the most common reason is that the service is replaced by a stub, or starts auto initializing. To fix this, explicitly set the $initService argument like this:
TestHelpers::service('renderer', initService: FALSE),
Added stubs and auto initializations for more Core services:
- cache.config
- class_resolver
- config.factory
- config.storage.active
- config.storage.snapshot
- language.default
- renderer
- request_stack
- router.route_provider
- url_generator.non_bubbling
- cache.backend.memory
- cache.config
- config.storage
- path.current
- database.replica_kill_switch
- link_generator
- logger.factory
- path_processor_manager
- router.no_access_checks
- session.flash_bag
- settings
- unrouted_url_assembler
- url_generator
Contributors (3)
Murz, j.cowher, maksim_matuzka
Changelog
Issues: 5 issues resolved.
Changes since 1.2.0:
Bug
Feature
- #3398074: Add stubs for url_generator and link_generator services
- #3388492: Add a stub for the renderer service
- #3396940: Add support for initiating services with parent service
- #3386688 by maksim_matuzka: Add support for entities with bundles but without bundle_entity_type, like MenuLinkContent