Skip to content

Instantly share code, notes, and snippets.

@erithmetic
Created January 27, 2010 15:45
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save erithmetic/287950 to your computer and use it in GitHub Desktop.
Save erithmetic/287950 to your computer and use it in GitHub Desktop.
autotest for PHPUnit
# Prereqs:
# * Ruby
# * gem install watchr
# Usage:
# copy autounit to php project directory
# run watchr autounit
watch('test/.*Test\.php') do |md|
puts "\e[H\e[2J" #clear console
system("phpunit #{md[0]}")
end
watch('lib/(.*)\.php') do |md| # runs test/Class/* whenever lib/class.php is changed
puts "\e[H\e[2J" #clear console
testpath = md[1].sub(/./) { |s| s.upcase }
system("phpunit test/#{testpath}")
end
@hlegius
Copy link

hlegius commented Jul 25, 2011

nice gambeta !

@esampaio
Copy link

awesome gamberz!!!11oneone11!!!!

@slavahatnuke
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment