Norway


In a post to his Medium.com 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 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 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 . 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.



Source link

LEAVE A REPLY

Please enter your comment!
Please enter your name here