Join 34,000+ subscribers and receive articles from our
blog about software quality, testing, QA and security.

Using PHPUnit for testing and api of TestRail



does anyone have experience with PHPUnit in the combination with TestRail and its API?

Thanks for any ideas or hints, or even better, examples.



Hi Ralf,

Thanks for your posting! Most teams let their test runs outside/independently of TestRail and then submit the results via TestRail’s API afterwards:

A typical workflow would be to use the result file generated by the test automation tools and then write a small script or similar that uses this file and submits the test results to TestRail. A good starting point for this is our PHP API binding which is available here:



Thanks Tobias,

I’m quite familiar with the TestRail API and sending back test results to it. The tests themselves are using JUnit, Jenkins, Jenkins-TestRail-Plugin and ANT for building the chain (1) start, (2) run, (3) transfer back test results. My idea is to shorten this chain by staying within the same programming language anyhow. Therefore I’m searching for experience.
So, for example the trigger.php could start a package of tests (aligned to a test suite) including the evaluation/generation of test results on the basis of PHPUnit (assertEqual and similar methods).


Hi Ralf,

Ah okay, got it. We would usually recommend using your existing infrastructure and tools you already use for automated tests. The trigger.php example would usually only trigger the tests and not run them themselves and using your existing tools/environment usually works best in this case.