Sign inSign up
dev-stack logo

rvolt/dev-stack

By rvolt

•Updated over 8 years ago

My dev stacks

Image
0

435

rvolt/dev-stack repository overview

⁠LAMP stacks with xdebug and PHPunit

Add xdebug and phpunit to the official php:7-apache image.

See ECLIPSE.md⁠ to configure Eclipse.

See the sample⁠ code for a basic lamp stack.

⁠Requirement

  • Eclipse PDT
  • docker
  • docker-compose

⁠Start server

cd sample/
docker-compose up
# press Ctrl+c to stop

⁠Debug app

  • Run Eclipse debugger
  • Open any url from your browser

⁠Debug tests

  • Run Eclipse debugger
  • Run PHPUnit :
    • Using a bash session
      # Start a bash session
      docker exec -it <CONTAINER_ID> bash 
      # Automaticly run tests on files changes
      watch-phpunit -c specs/suite.xml
      # Use PHPUnit cli
      phpunit --bootstrap specs/autoload.php specs/tests/
      
    • Using docker exec
      # Automaticly run tests on files changes
      docker exec -it <CONTAINER_ID> watch-phpunit -c specs/suite.xml
      # Use PHPUnit cli
      docker exec -it <CONTAINER_ID> phpunit --bootstrap specs/autoload.php specs/tests/
      

⁠Live reload PhpUnit

watch-phpunit [-c <config> | -b <bootstrap> -f <file>] [-w <dir-or-file-to-watch> default:/var/www/html]
    # Examples
    watch-phpunit -b autoload.php -f specs/tests/MyTest.php
    watch-phpunit -c suite.xml
    watch-phpunit -c suite.xml -w index.php
    watch-phpunit -c suite.xml -w specs/tests

Tag summary

Content type

Image

Digest

Size

212.8 MB

Last updated

over 8 years ago

docker pull rvolt/dev-stack:lamp