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

Cees-Jan Kiewiet:
Smoke testing ReactPHP applications with Cigar
Feb 27, 2018 @ 16:47:31

In a new post to his site Cees-Jan Kiewiet covers a new library he discovered - Cigar - and how to use it for smoke testing a ReactPHP application. Smoke testing (or "sanity testing") is the evaluation of the major functionality of an application rather than individual pieces of code.

Last week I came across Cigar, a smoke testing tool by Matt Brunt. Which, to me, is great stepping stone for my personal projects/sites to integration tests. In this post we not only go into Cigar, but also how to start your HTTP ReactPHP application, run cigar against it, and shut it down again. (Note that it doesn't have to be a ReactPHP application it can also be a NodeJS app, or PHP's build in webserver you use for testing.)

He then walks through the process of installing Cigar and creating the initial configuration file of endpoints to test (along with expected statuses). He then shows how to automate things further and creates a bash script that starts the ReactPHP application, runs the tests then shuts the application down. It's a simple script but can help save a few keystrokes every time the tests are run.

tagged: smoketest cigar testing reactphp bash automation library

Link: https://blog.wyrihaximus.net/2018/02/smoke-testing-reactphp-applications-with-cigar/


Trending Topics: