PHPUnit probe to publish test results to Probe Dock.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

PHPUnit probe for Probe Dock

PHPUnit listener to publish test results to Probe Dock.


Add probedock-phpunit as a dependency in your composer.json file:

  "name": "my/package",
  "require": {
    "probedock/probedock-phpunit": "^0.2.0"

Then run php composer.phar update.

If you haven't done so already, set up your Probe Dock configuration file(s). This procedure is described here:

You must then add the Probe Dock PHPUnit listener to your PHPUnit configuration file (e.g. phpunit.xml.dist). This is the listener you must add:

<listener class="ProbeDock\ProbeDockPHPUnit\ProbeDockPHPUnitListener">

Here's a complete sample of a phpunit.xml.dist configuration file from a Symfony project, showing where to add the listener (at the bottom):

<?xml version="1.0" encoding="UTF-8"?>

<!-- -->
<phpunit xmlns:xsi=""

    <ini name="error_reporting" value="-1" />
    <server name="KERNEL_DIR" value="app/" />

    <testsuite name="Project Test Suite">


    <listener class="ProbeDock\ProbeDockPHPUnit\ProbeDockPHPUnitListener">

All test results will now be published to Probe Dock the next time you run your test suite!


To enrich tests with more information, you can use the @ProbeDock annotation:


namespace Tests\AppBundle\Controller;

use ProbeDock\ProbeDockPHPUnit\ProbeDock;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

class DefaultControllerTest extends WebTestCase {

   * @ProbeDock(name="Custom name different than the function name", category="Web Test", tags="api,http,get")
  public function testIndex() {
    $client = static::createClient();

    $crawler = $client->request('GET', '/');

    $this->assertEquals(200, $client->getResponse()->getStatusCode());
    $this->assertContains('Welcome to Symfony', $crawler->filter('#container h1')->text());


AnnotationException: the annotation was never imported

This library uses Doctrine annotations so you can enrich tests with additional information such as tags.

If you are using other annotations, they may come into conflict with the Doctrine annotations library. For example, this error may occur in a project where an @expectedException annotation was used in the tests:

Uncaught Doctrine\Common\Annotations\AnnotationException: [Semantical Error] The annotation "@expectedException" in method My\Class::testMethod() was never imported. Did you maybe forget to add a "use" statement for this annotation?

To solve this issue, you must add the annotations not known by Doctrine to its global ignore list. The following code in your tests' bootstrap file will do the trick:

namespace Doctrine\Common\Annotations {
  require __DIR__ . '/../vendor/autoload.php';
  use Doctrine\Common\Annotations\AnnotationReader;

  // Repeat the line above to ignore other annotations...

If you do not already have a bootstrap file for your tests, you can create it and add its path to the <phpunit> tag in your phpunit.xml.dist configuration file:

<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./tests/bootstrap.php" colors="true">
  <!-- Your PHPUnit configuration... -->


  • Fork
  • Create a topic branch - git checkout -b feature
  • Push to your branch - git push origin feature
  • Create a pull request from your branch

Please add a changelog entry with your name for new features and bug fixes.



probedock-phpunit is licensed under the MIT License. See LICENSE.txt for the full text.