I got error when I run tests when developing locally

Hi everyone, I don’t know if this is the right place to ask about this topic. But l need help. l try to Run PHP tests in a container. I type this code:
docker compose run --build --rm server ./vendor/bin/phpunit tests/HelloWorldTest.php
on a terminal and the output should be like this:

Hello, Docker!PHPUnit 9.6.13 by Sebastian Bergmann and contributors.

. 1 / 1 (100%)

Time: 00:00.003, Memory: 4.00 MB

OK (1 test, 1 assertion)

But l got this error /usr/local/bin/docker-php-entrypoint: 9: exec: ./vendor/bin/phpunit: not found. Any help would be much appreciated.


Did you ask your in the Docker forum?

It is very unlikely that you will find someone with enough Docker/PHP experience here.

Yes I have. But did not get response yet.

Sorry to hear that, the big majority of the people here are students. Maybe one of the pros helping out here has the necessary experience.

1 Like

I know that, that’s why l put this sentence I don’t know if this is the right place to ask. Thank u Daniel for your reply.

There are some basic steps that you can follow:

  • Install PHPUnit within the Container.
  • Specify the Correct Path (if PHPUnit is already installed)
  • You can also override the ENTRYPOINT in docker-compose.yml
  • Verifying the Composer Installation and Configuration
    After following these points you can resolve your coding issues. Exact coding cannot be given as it is against the community guidelines of freecodecamp.
1 Like