Writing PHPUnit tests for TYPO3 extensionsOliver Klee, 2023-08 @[email protected] | [email protected]
View Slide
About meOliver „Oli“ Klee#bonn#extension-dev#workshop-teacher#unit-testing-guy#phpstan-guy#best-practices-team#motivation-research-team#team-leadership-working-group#game-cooking#powermetal
Unit Tests?
Manual testing is cumbersome
Automated testing is fast
Unit tests for the TYPO3 Core
Unit Tests 406 (144) tests/s
Functional Tests 8.13 (1.97) tests/s
Acceptance Tests .009 (.003) tests/s
Verify that your codedoes what you expect
Make sure that your changes won‘t break anything
Keep others from breaking your code
Don’t break anything even in complex projects
Create a safety netfor refactoringor for TYPO3, PHPor Symfony updates
Improvethe structureof your code
Find the location of bugs
Green feels good!
Test levelshttp://filipdefar.com/2015/06/tested-be-thy-name.html
Unit tests aresmall and fast
Functional teststest how componentswork togetheralso calledintegration tests
Acceptance testsCodeception Cypress
The testing pyramidUnitFunctional/ IntegrationAcceptancePhoto by Eugene Tkachenko on Unsplash: https://unsplash.com/photos/TF47p5PHW18