We have this code in (almost) all of our Kernel tests:

    // Manually set the tracking page size since the module's default
    // configuration is not installed automatically in kernel tests.
    \Drupal::configFactory()
      ->getEditable('search_api.settings')
      ->set('tracking_page_size', 100)
      ->save();

However, we can instead just install our default configuration with $this->installConfig('search_api');, which would be self-explanatory, a lot shorter and also more future-proof (if we ever need another default config value).

Comments

drunken monkey created an issue. See original summary.

tilenav’s picture

Status: Active » Needs review
StatusFileSize
new16.27 KB

I believe I replaced all I could find.

borisson_’s picture

Status: Needs review » Reviewed & tested by the community

I reviewed this by doing "ag getEditable", then applying the patch and doing the same thing. The remaining calls to getEditable are legit.

RTBC!

drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Yes, looks very good, thanks a lot!
Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.