Last active
August 29, 2015 14:03
-
-
Save cognifloyd/cfc8ba37dd7c711342f1 to your computer and use it in GitHub Desktop.
Guard + Guard-PhpUnit2 + TYPO3.Flow based application
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
# http://erichogue.ca/2012/09/php/continuous-testing-in-php-with-guard/ | |
#Unit Tests | |
guard 'phpunit2', | |
:command => './bin/phpunit', | |
:cli => '-c Build/BuildEssentials/PhpUnit/UnitTests.xml', | |
#Important! No trailing slash! | |
:tests_path => Dir.glob('Packages/{Framework,Applications,Boilerplates}/*/Tests/Unit'), | |
#realtime uses log-json which emits tons of Notices about "Array to string conversion" when testing TYPO3.Eel/Context | |
:realtime => true, | |
:keep_failed => true, | |
:all_on_start => true, | |
:all_after_pass => true do | |
#Tests | |
watch(%r{^Packages/(Framework|Applications|Boilerplates)/(.+)/Tests/Unit/(.+)Test\.php$}) | |
#PSR-0 Classes | |
watch(%r{^Packages/(Framework|Applications|Boilerplates)/(.+)/Classes/([^/]+)/([^/]+)/(.+)\.php$}) { |m| "Packages/#{m[1]}/#{m[2]}/Tests/Unit/#{m[5]}Test.php" } | |
#PSR-4 Classes | |
watch(%r{^Packages/(Framework|Applications|Boilerplates)/(.+)/Classes/(.+)\.php$}) { |m| "Packages/#{m[1]}/#{m[2]}/Tests/Unit/#{m[3]}Test.php" } | |
end | |
#Functional Tests | |
guard 'phpunit2', | |
:command => './bin/phpunit', | |
:cli => '-c Build/BuildEssentials/PhpUnit/FunctionalTests.xml', | |
:tests_path => Dir.glob('Packages/{Framework,Applications,Boilerplates}/*/Tests/Functional'), | |
:realtime => true, | |
:keep_failed => true, | |
:all_on_start => true, | |
:all_after_pass => true do | |
watch(%r{^Packages/(Framework|Applications|Boilerplates)/(.+)/Tests/Functional/(.+)Test\.php$}) | |
end | |
#Behat Tests | |
# See http://erichogue.ca/2012/09/php/continuous-testing-in-php-with-guard/ Inline Guard | |
#Documentation Generation? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Place this at
~/.Guardfile
or at<projectRoot>/Guardfile
. Then, open a new terminal that you can leave open during development. In the flow distribution (same directory as ./flow), runguard
. Enjoy your growl or inotify notifications.