Skip to main content
Joachim's blog

Main navigation

  • Home
  • About
  • Hire me

Breadcrumb

  1. Home
By joachim, Wed, 01/04/2026 - 08:14

Speed up your PHPUnit Browser tests with this one trick

It's true, no April fools. You can make your Browser tests run much quicker. How? By deleting them!

You will of course need to add a corresponding Kernel test - and that's the trick. Kernel tests run much faster than Browser tests.

But Browser tests make requests to the test site using an internal web browser, I hear you say, whereas Kernel tests make API calls directly. Kernel tests have their uses for testing APIs, but Browser tests are needed to test actual HTML output.

Tags

  • tests
By joachim, Thu, 19/03/2026 - 12:45

New Module Builder documentation site

Module Builder now has its own documentation site.

This covers the many options it offers developers for fine-tuning their module code, from dependency injection to plugin inheritance, entity base fields, form elements, permissions, library asset files, and more.

Tags

  • module builder
By joachim, Tue, 24/02/2026 - 09:52

Release more code: the technical stuff

At LocalGov Drupal Dev Days in London earlier this month, the topic came up of releasing custom project code as contrib modules.

Tags

  • contributing code
  • LocalGov Drupal
By joachim, Fri, 23/01/2026 - 11:49

Converting hooks to OO methods made easy

Rector is a really powerful tool for making refactoring changes to your codebase. It's easy to use, but it's not obvious, and a lot of the documentation and articles about it are outdated or incomplete. For instance, when you go to the project page (https://www.drupal.org/project/rector) there's no clear indication of how to install it!

Tags

  • Rector
  • deprecation
  • phpcs
By joachim, Tue, 02/09/2025 - 13:17

The big plugin attribute change-over made easy

Attributes are here and they're great. I hated annotations; they were a necessary evil, but putting working code into comments just felt wrong.

Tags

  • module builder
  • plugins
  • Rector
  • deprecation
  • regex
By joachim, Wed, 27/08/2025 - 20:18

Drupal on cPanel: Confusion, Pain, and Never-Ending Lousiness

My site is back up, after a brief interlude: I moved hosts, because Gandi doubled their hosting costs. I'd left it quite late to renew, because up until now it's just been a case of ticking a box and paying money, so I didn't have much time to shop around.

I chose Krystal, because they use green energy and their procedure for transferring my domain seemed simple (there was a German hosting firm I was recommended too, but that one said something about filling in a form in a PDF and it looked horrendous).

Tags

  • hosting
By joachim, Thu, 24/10/2024 - 11:25

Changing your mind about dependency injection

When I start writing a class that has a dependency injection, I have a clear idea about which services it needs. I generate it -- the plugin, form, controller, or service -- and specify those services.

Then nearly always, unless it's something really very simple, I find that no matter how much I thought about it and planned it, I need to add more services. Maybe remove some too.

Fortunately, because Module Builder saves the configuration of the module code you've generated, it's easy to go back to it and edit it to add more services:

Tags

  • dependency injection
  • Drupal Code Builder
  • module builder

Frequent tags

  • Drupal Code Builder (9)
  • module builder (7)
  • git (7)
  • 6.x (5)
  • drupal commerce (4)
  • Rector (3)
  • Drush (3)
  • Composer (3)
  • contributing code (3)
  • development (3)
  • Entity API (3)
  • tests (3)
  • Field API (3)
  • patching (3)
  • developer tools (2)
  • wtf (2)
  • code style (2)
  • contrib module (2)
  • maintaining projects (2)
  • debugging (2)
  • drupal.org (2)
  • multisite (2)
  • deprecation (2)
  • Drupal core (2)
  • core (2)
  • issue queue (2)
  • modules (2)
  • roadmap (2)
  • 7.x (2)
Powered by Drupal