https://github.com/windler/zsh-phpunit-docker
Run phpunit tests in a docker container using zsh completion
https://github.com/windler/zsh-phpunit-docker
autocompletion docker docker-container phpunit phpunit-groups zsh
Last synced: 3 months ago
JSON representation
Run phpunit tests in a docker container using zsh completion
- Host: GitHub
- URL: https://github.com/windler/zsh-phpunit-docker
- Owner: windler
- License: mit
- Created: 2017-07-30T14:48:30.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-07T17:41:19.000Z (almost 8 years ago)
- Last Synced: 2025-01-20T16:53:40.606Z (5 months ago)
- Topics: autocompletion, docker, docker-container, phpunit, phpunit-groups, zsh
- Language: Shell
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Zsh-phpunit-dockertests
This is a `oh-my-zsh` plugin that lets you run `phpunit`-tests in a docker container.
This plugin comes with autocompletion for running containers, commands and phpunit groups.## Installation
In order to install you need `Docker` and `oh-my-zsh`. Then you can install the plugin doing the following:```
cd ~/.oh-my-zsh/custom/plugins
git clone https://github.com/windler/zsh-phpunit-docker.git
zsh
```## Preconditions
After installing the plugin you have to define two variables. This plugin needs to know where the phpunit
executable is located in your containers. If you want to generate coverage reports you also have to define the output folder. The archive this you can add the following variables to your `~/.zshrc` file:```
__DOCKER_PHPUNIT="./vendor/phpunit/phpunit/phpunit"
__DOCKER_PHPUNIT_COVERAGE_DIR="coverage_report"
```## Dockertests
The basic command is
```
dockertests [ []]##Example
dockertests my_php_fpm_container group integration_tests
```The argument `` is the name or id of a running container. You can use `tab`
for autocompletion. After choosing a container you have various options:
```
all - Runs all tests except the ignore-group (if used). This is the default command.
group - Runs tests for a phpunit group
filter - provides a filter for e.g. running one tests
coverage - runs all tests except ignore-group and prints coverage (console)
coverage-report - runs all tests except ignore-group with coverage report (html)
```If the `group` command is provided you can autocomplete the phpunit group (this takes a while).
## Dockerbash
In addition to run tests you can simply start a `bash` on a cotainer using```
dockerbash
```The argument `` is the name or id of a running container. You can use `tab`
for autocompletion.