Advanced OOP For WordPress Pt. 4: Setting Up With WordPress Test Suite For Integration Testing

By Josh Pollock

In my previous articles in this series, I showed how to structure a WordPress plugin using object-oriented PHP. Then I covered unit testing. Unit tests cover each component, totally isolated from all other parts of the system. Unit tests should not be concerned with how the object interacts with any dependencies including the database and WordPress.

Instead, once we have unit tests, we use integration tests to cover the effects of our code on the environment it is in. In general, we use phpunit for both types of tests. We just use them differently. We can think of phpunit as …read more

Source:: Torque

No comments