I just want to test my PHP code using phpunit on GitLab, what am I doing wrong?

image: php:latest

# Install & enable Xdebug for code coverage reports
- pecl install xdebug
- docker-php-ext-enable xdebug

# Run our tests
# If Xdebug was installed you can generate a coverage report and see code coverage metrics.
- phpunit Test.php

  • 0
    The config looks good. What's the problem?
  • 0
    @korrat this is the error
    266 /bin/bash: line 92: phpunit: command not found
    270 ERROR: Job failed: exit code 1

    entire log : https://pastebin.com/11ZZM7kg
  • 0
    Do you use phpunit through composer? Their documentation states that you should run ./phpunit Test.php. Does that work?
  • 1
    @korrat I have phpunit.xml as config, btw I managed to work it around by adding a shell script to install phpunit and then running the config, I don't know how that worked xD
Add Comment