Skip to content

Testing WebEngine applications

Greg Bowler edited this page May 9, 2026 · 2 revisions
  • Explain the difference between testing business logic, page behaviour, and full request flows.
  • Explain why WebEngine’s separation of concerns helps testing.

What and when to test

  • Test-driven development is the way in the "perfect world", but sometimes isn't practical.
  • Application classes in isolation tested with PHPUnit.
  • Page logic behaviour tested with Behat.

Practical test strategy

  • Keep unit tests focused on application classes. Try to test all application functionality as it's built.
  • Use behavioural tests for page-level integration.
  • Avoid over-testing framework or language internals.

Test-driven development

  • Explain that this is a discipline, but getting into the habbit genuinely transforms development quality.
  • With TDD, nothing the application can do can happen without being tested.
  • Confidence in user-critical flows, confidence in data handling and business rules, confidence in rendering of important pages.
  • Link to todo list TDD tutorial.

When you're ready to deploy to production, have a production checklist to hand.

Clone this wiki locally