Run phpunit or pest depending on the project
Remove the `p` and `pf` aliases that previously only worked for PHPUnit, and re-add them as functions that run either PHPUnit or Pest PHP based on the project dependencies. The checking is done within the `phpunit-or-pest` script and then used within the new `p` and `pf` functions.
This commit is contained in:
parent
ce9a65340e
commit
a85ff2e8bb
8
bin/phpunit-or-pest
Executable file
8
bin/phpunit-or-pest
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
if [[ -f "vendor/bin/pest" ]]; then
|
||||
echo "pest"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "phpunit"
|
|
@ -2,8 +2,6 @@ alias c="clear"
|
|||
alias l="ls -lah"
|
||||
alias m=make
|
||||
alias mkdir="mkdir -p"
|
||||
alias p=phpunit
|
||||
alias pf=phpunit --filter
|
||||
alias s=symfony
|
||||
alias v=vagrant
|
||||
|
||||
|
|
|
@ -21,3 +21,11 @@ function db {
|
|||
|
||||
is_linux() { [[ "$(uname)" == 'Linux' ]] }
|
||||
is_macos() { [[ "$(uname)" == "Darwin" ]] }
|
||||
|
||||
# Run 'phpunit' or 'pest' depending on the project.
|
||||
function p () {
|
||||
vendor/bin/$(phpunit-or-pest) $*;
|
||||
}
|
||||
function pf () {
|
||||
vendor/bin/$(phpunit-or-pest) --filter $*
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue