Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

TJ Miller:
Separate Interactive Test Suites
Mar 26, 2018 @ 17:56:24

In a post to his Medium.com site TJ Miller has a quick post for the PHPUnit users out there showing how to isolate your tests and prevent them from interacting by splitting them into different test suites.

On a recent Full Stack Radio episode Adam Wathan and Taylor Otwell were talking about testing Laravel applications. During the episode, they spoke about isolating interactive integration tests from your normal testing e.g. payment gateways, third-party integrations.

TJ shares an example of a project he's working on where this is useful: avoiding interactions with an HTTP API every time the tests run. He then shows how, with a single PHPUnit configuration, you can split up the tests by name and directory to prevent them all from executing every time. Then the "testsuite" option can be used to isolate the execution from the command-line. An example of the XML configuration is also included in the post.

tagged: tutorial phpunit separate test suite isolation configuration

Link: https://medium.com/@sixlive/separate-interactive-test-suites-f6fd59316ec2


Trending Topics: