PHP interpreters for testing and continuous integration.
4.2K
A collection of docker images for testing and continuous integration.
Additional extensions enabled:
pgsqlpdo_mysqlpdo_pgsqlxdebugzipredismongodbpharcassandra for PHP 5.6, 7.0, 7.1Additional programs installed:
bashcomposergitsshmakedoxygenAdditional user: tester. Use this to run tests as unprivileged user with uid 1000.
$ VERSION=5.5.38
$ ./build.sh $VERSION
$ docker pull bfitech/php-xdebug:$VERSION
Prepare your composer.json. Dependencies may contain private repositories only accessible via git+ssh.
$ cat composer.json
{
"name": "your/library",
"description": "Your awesome lib.",
"type": "library",
"repositories": [
{
"type": "vcs",
"url": "[email protected]:your/tool"
}
],
"require": {
"php": ">=5.5 <7.4",
"your/tool": "dev-master"
},
"require-dev": {
"phpunit/phpunit": "~4.8"
},
"autoload": {
"psr-4": {
"Your\\Library\\": "src"
}
},
"minimum-stability": "dev"
}
Prepare your phpunit.xml. Set target directory of HTML code coverage report accordingly. We're gonna mount this directory to /tmp/docs as to not clutter the codebase.
$ grep -A2 docs phpunit.xml
<log type="coverage-html" target="./docs/coverage"
lowUpperBound="35" highLowerBound="70"/>
Run the test suite. Mount SSH key from host if necessary. Also mount composer cache directory /tmp/cache to host to share cache among tests.
$ docker run --rm -it \
> -v `pwd`:/data \
> -v /tmp/docs:/data/docs \
> -v /tmp/.composer/cache:/tmp/cache \
> -v ~/.ssh/id_rsa:/root/.ssh/id_rsa:ro \
> -v ~/.ssh/known_hosts:/root/.ssh/known_hosts:ro
> bfitech/php-xdebug:$VERSION \
> sh -c 'composer -vvv update -no && php ./vendor/bin/phpunit'
Inspect your coverage report.
$ x-www-browser /tmp/docs/coverage/index.html
Content type
Image
Digest
Size
72.8 MB
Last updated
over 5 years ago
docker pull bfitech/php-xdebug