WordCamp GR 2019 – Confidently Testing WordPress – Steve Grunwell
/

WordCamp GR 2019 – Confidently Testing WordPress – Steve Grunwell

https://stevegrunwell.github.io/confidently-testing-wordpress/#/ Testing Fundamentals Automated Testing Reduces time + chance of human error Easily reproducible Gateway to CI/CD Test Types Unit – Test the smallest possible unit of an app. Often a single function Integration – How individual components interact End-to-End(E2E) – An entire path through an application Automated Testing Pyramid ROI for Testing System Under Test (SUT) The system we’re currently testing: A single method A class A whole feature WordPress Testing is Complicated Tightly-coupled system Difficult to test anything in true isolation Testing Toolbox PhpUnit – https://phpunit.de/ Structure Test Suite – Collection of test classes Test Class (class) – Collection of test methods Test Case (method) – A single scenario to be tested Assertions True or False Equality Verify Contents – contains, regular expression…