Created
February 13, 2011 13:48
-
-
Save shostakovich/824697 to your computer and use it in GitHub Desktop.
A simple watch script for symfony
This file contains 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
def run_unit_test(file) | |
system("php5 symfony test:unit #{file}") | |
end | |
def run_functional_test(app, controller) | |
system("php5 symfony test:functional #{app} #{controller}Actions") | |
end | |
def build_schema | |
system("php5 symfony doctrine:build --all-classes") | |
run_all_tests | |
end | |
def run_all_tests | |
system("php5 symfony test:all") | |
end | |
watch( 'lib/(.*)\.class\.php' ) {|m| run_unit_test m[1]} | |
watch( 'apps/(.*)/modules/(.*)/actions/(.*)\.class\.php' ) {|m| run_functional_test m[1],m[2]} | |
watch( 'apps/(.*)/modules/(.*)/templates/(.*)\.php' ) {|m| run_functional_test m[1],m[2]} | |
watch( 'test/functional/(.*)/(.*)ActionsTest\.php' ) {|m| run_functional_test m[1],m[2]} | |
watch( 'test/unit/(.*)Test\.php' ) {|m| run_unit_test m[1]} | |
watch( 'config/doctrine/(.*)\.yml' ){ build_schema } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment