Install

Works with Drupal: ^9.4 || ^10

Using Composer to manage Drupal site dependencies

Alternative installation files

Download tar.gz 135.52 KB
MD5: 3790cd5d090519cf90d39075c1b0aed5
SHA-1: ab500e5b9a68b8d8d7ceb5bc0ecf24a4949c43a2
SHA-256: 629e66ebdc11881166ef1d978d6ef33d927b7b866bbcdfea940d0373d87e19cf
Download zip 193.48 KB
MD5: 9fbedc1153a0677a4a94ec2ece9587cb
SHA-1: 4a5f482345373e6413955d67af9f414c98831181
SHA-256: bab1d2e63c82b05240b77f863756932800216cdee2ea403b756652801fdbba97

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
Created by: murz
Created on: 1 Nov 2023 at 07:57 UTC
Last updated: 2 Nov 2023 at 07:48 UTC
New features
Unsupported

Other releases