Making the Best of PHPUnit Data Providers
When writing unit or integration tests for PHP, occasionally you need to test a specific scenario multiple times, with different input data. To make this easy and less repetitive, PHPUnit provides what is called Data Providers. A data provider is a method in some test case file, providing several sets of input data for one […]
How to Test Container Components in React
Assuming you would want to unit-test container components in React (i.e., connected components in a Redux-based project), or any component that is wrapped in a higher-order component (HOC) etc. really, here’s a simple thing you should always do: 👉 Also export the “naked” component! I am talking about something like this: // … export { […]
WordCamp Europe 2018: Unit Testing Workshop
I’m super excited to be hosting a workshop on unit testing at WordCamp Europe 2018. If you want to know why that is, you might want to read this post.
An Introduction to Unit Testing (for WordPress)
Talking about “testable code” is usually done in the context of unit testing. Writing testable code thus requires understanding unit testing. Learn it now.