Start testing your extension NOW
TYPO3camp Berlin 2019
O MORE EXCUSES
I really would like to do this testing stuff.
But I have no clue where to start.
Most common excuse
▪ Senior TYPO3 Developer @ sitegeist
▪ TYPO3 CMS Certified Developer
▪ Working with TYPO3 since version 3.8
▪ TYPO3 developer since 2004
▪ TYPO3 core contributor since 11/2014
▪ Cartographer, Food Blogger and
▪ Twitter: @buccaneer23
What to test?
I refuse to answer that
Audiences often understand "What ONLY to test?"
The obvious answer must be "Everything"
Ask yourself "Does this piece of code something meaningful?"
What (probably) not to test?
• Should do only trivial stuff (e.g. getTitle(), setTitle())
• Business logic should be moved to Services or Utilities (e.g. getValidityDate())
• You can rely on the core to test that database stuff
• Should only be in control
• Gather data
• Call business logic
• Assign data to view
• Single units (e.g. single functions)
• Closed scope - only own code
• No 3rd party requirements (e.g. Database, TYPO3 Core functions)
Integration testing (a.k.a. functional testing)
• Composed functionality (e.g. "validate form and save values to database")
• Useful for public APIs (e.g. REST services)
• 3rd party requirements
(User) acceptance testing
• Frontend functionality
All units on deck
"test:php-unit": "./bin/phpunit --color -d memory_limit=-1 ↵