iakio/phpunit-growlprinter

PHPUnit Growl(GNTP) Printer

0.6.0 2015-12-05 07:40 UTC

This package is not auto-updated.

Last update: 2024-12-18 14:26:59 UTC


README

Build Status

growl

Requirements

  • PHP >= 5.3
  • phpunit >= 4.8.*,<5.5

Usage

PHAR

  1. Download phpunit-growlprinter.phar from here.

  2. Create new bootstrap file.

<?php
// bootstrap_growl.php
require_once "phpunit-growlprinter.phar";
// Put your own bootstrap file here
// require_once "bootstrap.php";
  1. Run
$ phpunit --bootstrap=bootstrap_growl.php --printer=iakio\\phpunit\\GrowlPrinter

Composer

  1. Install
$ php composer.phar require --dev iakio/phpunit-growlprinter:*
  1. Specify printerClass in your phpunit.xml,
<phpunit printerClass="iakio\phpunit\GrowlPrinter"
         printerFile="vendor/iakio/phpunit-growlprinter/src/iakio/phpunit/GrowlPrinter.php">
...
</phpunit>

or commandline.

$ phpunit --printer=iakio\\phpunit\\GrowlPrinter

Tips

If you want to use remote PHPUnit with local Growl, Use portforwarding:

$ ssh -R:23053:localhost:23053 myremotehost

or, override GrowlPrinter class.

<?php
// src/MyGrowlPrinter.php
namespace app;
use iakio\GntpNotify\GNTP;
use iakio\GntpNotify\IO;
use iakio\phpunit\GrowlPrinter;

class MyGrowlPrinter extends GrowlPrinter
{
    protected function createGrowl()
    {
        return new GNTP(new IO("10.0.2.2", 23053));
    }
}
<phpunit printerClass="app\MyGrowlPrinter"
         printerFile="src/MyGrowlPrinter.php">
...
</phpunit>