https://github.com/dflydev/just-run-phpunit
Allow developers to "just run phpunit."
https://github.com/dflydev/just-run-phpunit
Last synced: about 1 year ago
JSON representation
Allow developers to "just run phpunit."
- Host: GitHub
- URL: https://github.com/dflydev/just-run-phpunit
- Owner: dflydev
- License: mit
- Created: 2013-09-28T19:18:17.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-09-29T17:23:34.000Z (over 12 years ago)
- Last Synced: 2025-01-26T07:11:15.061Z (over 1 year ago)
- Homepage:
- Size: 108 KB
- Stars: 27
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Just Run PHPUnit
================
The goal of this project is to allow PHP developers to just type naked `phpunit`
wherever they are but actually executing `vendor/bin/phpunit` for projects that
have PHPUnit required via Composer and falling back to a globally installed
version of PHPUnit if not.
So the goal is literally to allow developers to "just run phpunit." No more
having to decided if you need to run `vendor/bin/phpunit`, `bin/phpunit`, or
`phpunit`, just run `phpunit` and this utility takes care of the rest.
Usage
-----
Include the appropriate `just-run-phpunit` script from one of the shell
subdirectories. This file will likely need to be sourced in such a way that the
functions or aliases become available when your user logs in. This differs from
shell to shell.
In all cases, this utility relies on the `PHPUNIT_PATH` environment variable. It
contains a list of `:` separated paths similar to the `PATH` environment
variable. Each path will be checked for an executable file called `phpunit`. The
first time this file is found it will be executed and the return value of the
execution is returned.
The `PATH` is queried last to determine if a globaly installed version of
PHPUnit is available.
If you need to extend the search path (say you regularly have Composer's vendor
bin redirected somewhere non-standard like `vendor-bins`) you can prepend or
append it to `PHPUNIT_PATH`. For example:
export PHPUNIT_PATH="${PHPUNIT_PATH}:vendor-bins"
This will ensure that `vendor-bins` will be checked after the other default
paths have been checked.