I'm trying to run a simple test in my project but I'm stuck on autoload problems. How do I run this image?
Simply doing: docker run --rm -v ${PWD}:/app --rm phpunit/phpunit run like in the readme gives Cannot open file "run.php"
And I do have a phpunit.xml file.
And trying one of the more advanced:
docker run --rm -v ${PWD}:/app --rm phpunit/phpunit /app/tests/AppBundle/StandaloneTest.php --filter testStandalone
or
docker run --rm -v ${PWD}:/app --rm phpunit/phpunit -c /app/phpunit.xml /app /tests/AppBundle/StandaloneTest.php --filter testStandalone
or
docker run --rm -v ${PWD}:/app --rm phpunit/phpunit --bootstrap /app/app/autoload .php /app/tests/AppBundle/StandaloneTest.php --filter testStandalone
All give:
PHP Fatal error: Uncaught PHPUnit\Runner\Exception: Class '/app/tests/AppBundle/StandaloneTest' could not be found in '/app/tests/AppBundle/StandaloneTest.php'. in /tmp/vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php:102
Stack trace:
#0 /tmp/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php(130): PHPUnit\Runner\StandardTestSuiteLoader->load('/app/tests/AppB...', '/app/tests/AppB...')
#1 /tmp/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php(73): PHPUnit\Runner\BaseTestRunner->loadSuiteClass('/app/tests/AppB...', '/app/tests/AppB...')
#2 /tmp/vendor/phpunit/phpunit/src/TextUI/Command.php(169): PHPUnit\Runner\BaseTestRunner->getTest('/app/tests/AppB...', '/app/tests/AppB...', Array)
#3 /tmp/vendor/phpunit/phpunit/src/TextUI/Command.php(148): PHPUnit\TextUI\Command->run(Array, true)
#4 /tmp/vendor/phpunit/phpunit/phpunit(53): PHPUnit\TextUI\Command::main()
#5 {main}
thrown in /tmp/vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php on line 102
I'm on Windows 10 running Docker version 18.09.2, build 6247962 in Powershell.
I'm trying to run a simple test in my project but I'm stuck on autoload problems. How do I run this image?
Simply doing:
docker run --rm -v ${PWD}:/app --rm phpunit/phpunit run
like in the readme givesCannot open file "run.php"
And I do have a phpunit.xml file.And trying one of the more advanced:
docker run --rm -v ${PWD}:/app --rm phpunit/phpunit /app/tests/AppBundle/StandaloneTest.php --filter testStandalone
ordocker run --rm -v ${PWD}:/app --rm phpunit/phpunit -c /app/phpunit.xml /app /tests/AppBundle/StandaloneTest.php --filter testStandalone
ordocker run --rm -v ${PWD}:/app --rm phpunit/phpunit --bootstrap /app/app/autoload .php /app/tests/AppBundle/StandaloneTest.php --filter testStandalone
All give:
I'm on Windows 10 running Docker version 18.09.2, build 6247962 in Powershell.