2017 © Pedro Peláez
 

library phpunit-runner

The lib allows to watch phpunit tests

image

hot/phpunit-runner

The lib allows to watch phpunit tests

  • Friday, June 26, 2015
  • by slavahatnuke
  • Repository
  • 7 Watchers
  • 27 Stars
  • 19,681 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 9 Forks
  • 1 Open issues
  • 4 Versions
  • 3 % Grown

The README.md

hot/phpunit-runner

Requirements: php, phpunit, git, find, (*1)

Watcher for php classes and tests

bin/hot-phpunit-runner --config=app/phpunit.xml --watch, (*2)

  • When you change entity XXXClass this watcher looking for and run tests for this entity.
  • When you change test for entity XXXClassTest this watcher run this test too.
PHPUnit HotRunner has been started


> phpunit -c app/phpunit.xml ./src/.../....../XXXClassTest.php

PHPUnit 3.7.21 by Sebastian Bergmann.

Configuration read from /Users/slava/project/xxx/app/phpunit.xml

....

Time: 1 second, Memory: 10.00Mb

OK (4 tests, 9 assertions)


[OK]

[notice] If you run bin/hot-phpunit-runner without any options then you run all tests (or test for entity) based on git status (one time). FYI, runner will not run tests next time. ( result is cached for watcher ), (*3)

Default running looks like:

  • bin/hot-phpunit-runner --watch
  • bin/hot-phpunit-runner --config=app/phpunit.xml --watch

Options

 --config=app/phpunit.xml # custom phpunit config file
 --phpunit-options="-c app/ --testdox" # custom phpunit options (alternative for `--config`)
 --phpunit-bin=bin/phpunit # custom path to phpunit
 --watch # watcher mode
 --period=2 # sec. watcher period
 --clean # this option remove cached result and re-test full
 --test-similarity=100 # percentage of similarity 0..100 (entity vs test)
 --coverage=coverage.xml # collect coverage and write Clover xml
 --on-pass="echo 'pass callback';" # CLI command after pass
 --on-fail="echo 'fail callback';" # CLI command after fail
 --notify # notifications # OSX / UBUNTU notifications

Install

  • composer: "hot/phpunit-runner": "dev-master"
  • http://packagist.org/packages/hot/phpunit-runner
  • https://github.com/slavahatnuke/hot-phpunit-runner

Workflows

  1. bin/hot-phpunit-runner --watch # default watcher
  2. bin/hot-phpunit-runner --config=app/phpunit.xml --watch # with phpunit config file
  3. bin/hot-phpunit-runner --config=app/phpunit.xml --phpunit-bin=bin/phpunit --watch # with custom phpunit
  4. bin/hot-phpunit-runner --clean # clear cache and re-test changeset (when watcher working)
  5. bin/hot-phpunit-runner --config=app/phpunit.xml --watch --period=1 # with phpunit config hot watcher with --period=1
  6. bin/hot-phpunit-runner --config=app/phpunit.xml --watch & # with phpunit config file and with & (background process)
  7. bin/hot-phpunit-runner --watch --test-similarity=50 # default watcher with --test-similarity=50 # watcher can not find my tests. I need to reduce the similarity.
  8. bin/hot-phpunit-runner --options="-c app/ --testdox" --watch # watcher with --options="-c app/ --testdox" # with custom phpunit options
  9. bin/hot-phpunit-runner --config=app/phpunit.xml --coverage=coverage.xml --watch # with --config=app/phpunit.xml --coverage=coverage.xml. collect coverage just for changes
  10. bin/hot-phpunit-runner --notify --watch # OSX / UBUNTU notifications

PhpStorm

Highlight coverage in PhpStorm, (*4)

bin/hot-phpunit-runner --config=app/phpunit.xml --coverage=coverage.xml --watch # required --config=app/phpunit.xml phpunit config file, in this case runner collect coverage for changes, (*5)

plugin: download wiki home, (*6)

PhpStorm settings, (*7)

PhpStorm highlight, (*8)

or, (*9)

PhpStorm highlight, (*10)

Notifications

bin/hot-phpunit-runner --notify --watch, (*11)

osx notification, (*12)

ubuntu notification, (*13)

--notify has dependents:, (*14)

  • OSX: terminal-notifier https://github.com/alloy/terminal-notifier
  • UBUNTU: notify-send man

The Versions

26/06 2015

dev-master

9999999-dev https://github.com/slavahatnuke/hot-phpunit-runner

The lib allows to watch phpunit tests

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

test phpunit git php realtime tests ci daemon watcher observer find hot

25/09 2013

005.x-dev

005.9999999.9999999.9999999-dev https://github.com/slavahatnuke/hot-phpunit-runner

The lib allows to watch phpunit tests

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

test phpunit git php realtime tests ci daemon watcher observer find hot

23/09 2013

002.x-dev

002.9999999.9999999.9999999-dev https://github.com/slavahatnuke/hot-phpunit-runner

The lib allows to watch phpunit tests

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

test phpunit git realtime tests ci daemon watcher observer find

23/09 2013

001.x-dev

001.9999999.9999999.9999999-dev https://github.com/slavahatnuke/hot-phpunit-runner

The lib allows to watch phpunit tests

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

test phpunit git realtime tests ci daemon watcher observer find