Skip to content

Instantly share code, notes, and snippets.

@diegofelix
Created December 26, 2017 12:38
Show Gist options
  • Save diegofelix/91331afb3bbd94b8a7dee919e4168bf0 to your computer and use it in GitHub Desktop.
Save diegofelix/91331afb3bbd94b8a7dee919e4168bf0 to your computer and use it in GitHub Desktop.
Run phpunit on the last modified test file. (Using Docker)
# Last Modified Test File
alias lastModifiedTestFile="(find tests -type f -printf '%T@ %p\n' | sort -k1,1nr | head -1 | grep -oE '[^ ]+$')"
# this function get the last modified file that are inside the `tests` folder
# and run the phpunit.
function phpunit() {
echo "Testing $(lastModifiedTestFile)...";
dctest $(lastModifiedTestFile);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment