~/talk

Writing Unit Tests Using PHPUnit

Talkat PHP UK Conference 2013 · 2013-02-21..02-23· [testing]
links:none on file
slides:none on file

Live coding shows PHPUnit used to write real unit tests that actually run and fail then turn green: a simple double() test, a user model test that replaces a mailer with a getMock and asserts the mailer method is called with specific args, and a fix exposed by a reflection call that initially reports bananas as blue. The workflow uses Composer autoloading, PHPUnit assertions and mocks, and coverage reporting including the CRAP index to prioritize what to test.

AI-written summary · about

  1. 0:00Introduction
  2. 1:00Overview
  3. 2:37Why is unit testing important
  4. 5:45Writing the first unit test
  5. 7:33Creating a folder for unit tests
  6. 15:42Writing unit tests
  7. 16:22Writing complex unit tests
  8. 17:02The essence of unit testing
  9. 27:37Dependency injection
  10. 29:02Dependency containers
  11. 32:32Writing testable code
  12. 33:22Voodoo
  13. 33:37Testing Private Methods
  14. 36:32Warning Sign
  15. 37:22Database Tests
  16. 38:57Testdriven development
  17. 39:12Fixing bugs
  18. 40:32What to test
  19. 41:27CREP index
  20. 43:52Conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.