{
  "id": 8665752,
  "title": "Using non-breakable spaces in test method names",
  "url": "https://urgent.news/2026/09/20/using-non-breakable-spaces-in-test-method-names",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-20T10:04:37.000Z",
  "source": {
    "name": "Lobsters",
    "slug": "lobsters",
    "url": "https://mnapoli.fr/using-non-breakable-spaces-in-test-method-names"
  },
  "original_language": "en",
  "account": "This article discusses the practice of using non-breaking spaces in test method names. The author explains that this approach is valid PHP code that works effectively. Non-breaking spaces, also known as HTML entities, appear as spaces in editors but are treated like any other character by PHP.\n\nIn the past, the author's team at Wizaplace used a different naming convention, such as snake_case instead of camelCase, for test methods. This change aimed to provide clearer explanations of what each test does. Although this style was not fully compliant with PSR-2 standards, the team gradually became comfortable with it.\n\nThe author shares that the team experimented with using non-breaking spaces in test method names. They found this approach to be even more readable than their previous style. They conducted a small controlled experiment and found it to be a great success over a year later. The tests remained clear and meaningful, making the entire testing process more understandable.\n\nThe author highlights that test methods written as sentences contribute to better clarity. They provide examples of pull requests where this naming convention was implemented. While some syntax highlighting tools initially had issues, they were resolved in subsequent pull requests.\n\nIntroducing this new naming convention to the team was initially challenging for new colleagues. However, the author emphasizes that once explained, the team quickly adapted to the new style. Both junior and senior developers embraced the change easily.\n\nThe author acknowledges that implementing non-breaking spaces in open-source projects could be more difficult, as contributors may not have direct guidance from the team. However, they believe that once the concept is explained, the benefits of using this style in practice are clear. They conclude by stating that, in their experience, employing non-breaking spaces in a closed-source project is straightforward, and they are happy with the results.",
  "summary": null,
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}