Last active
December 13, 2015 19:09
-
-
Save banksy89/4960692 to your computer and use it in GitHub Desktop.
Rake file for calling all PHPUnit unit tests within a directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# setting the path of Admin suite unit tests | |
admin_units = "admin/tests/units" | |
desc "Testing all admin unit tests" | |
task :admin_units do | |
puts "Going to test all unit tests now....hold tight...." | |
tests = Dir.entries(admin_units) | |
tests.each do |file| | |
if file != '.' && file != '..' | |
units = Dir.entries("#{admin_units}/#{file}") | |
units.each do |unit| | |
if unit != '.' && unit != '..' | |
puts "Running Unit Test: #{admin_units}/#{file}/#{unit}......" | |
# adding colours to the terminal | |
system("phpunit --colors --verbose #{admin_units}/#{file}/#{unit}") | |
end | |
end | |
end | |
end | |
end | |
task :default => ["admin_units"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment