Sign inSign up

bfitech/php-xdebug

By bfitech

•Updated over 5 years ago

PHP interpreters for testing and continuous integration.

Image
0

4.2K

bfitech/php-xdebug repository overview

⁠php-xdebug docker images

A collection of docker images for testing and continuous integration.

⁠Features

Additional extensions enabled:

  • pgsql
  • pdo_mysql
  • pdo_pgsql
  • xdebug
  • zip
  • redis
  • mongodb
  • phar
  • cassandra for PHP 5.6, 7.0, 7.1

Additional programs installed:

  • bash
  • composer
  • git
  • ssh
  • make
  • doxygen

Additional user: tester. Use this to run tests as unprivileged user with uid 1000.


⁠Build
$ VERSION=5.5.38
$ ./build.sh $VERSION

⁠Pull
$ docker pull bfitech/php-xdebug:$VERSION

⁠Usage

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

Tag summary

Content type

Image

Digest

Size

72.8 MB

Last updated

over 5 years ago

docker pull bfitech/php-xdebug