Created
July 30, 2014 15:10
-
-
Save andersonfraga/896a92e1bfa0506f1d13 to your computer and use it in GitHub Desktop.
Code watchers default
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
#!/usr/bin/php | |
<?php | |
require '../phpwatcher.php'; | |
phpwatcher(['./tests/unit/', './module/'], '(.*)\.php', function ($file) { | |
echo ($exec = "php-cs-fixer fix {$file} --level=all") . PHP_EOL; | |
system($exec); | |
echo PHP_EOL; | |
}); |
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
#!/usr/bin/php | |
<?php | |
require '../phpwatcher.php'; | |
phpwatcher(['./module/','./tests/unit/'], '(.*)\.php', function ($file) { | |
echo "\nChanged {$file}\n"; | |
echo ($exec = 'cd ./tests/unit/ && phpunit .') . PHP_EOL; | |
system($exec); | |
echo PHP_EOL; | |
}); |
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
#!/usr/bin/php | |
<?php | |
require '../phpwatcher.php'; | |
phpwatcher('./tests/unit/', '(.*)Test\.php', function ($file, $objfile) { | |
$exec = 'cd ' . $objfile->getPathIdentifier() . ' && phpunit ' . str_replace([$objfile->getPathIdentifier(), '.php'], '', $file); | |
echo $exec . PHP_EOL; | |
system($exec); | |
echo PHP_EOL; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment