How I can run phpunit test cases

How I can run Phpunit test cases. Can anyone help me please.

I have done
composer require --dev phpunit/phpunit
composer require --dev phpunit/phpunit-selenium

hi @Rashi ,

If you happen to be using the easy development OpenEMR docker environment, then can follow these instructions:
openemr/CONTRIBUTING.md at master · openemr/openemr · GitHub

If not, then can leverage here for an example:

Note in that script, there are example for the other unit tests, such as api, e2e, fixtures.

Hi @brady.miller

Thanks for your reply. I’m not using Docker but I ran this command as shown in image it gives me error


✘ Acl check core

│ Admin user should be in database for unit tests to execute
│ Failed asserting that a boolean is not empty.

│ /var/www/html/opn-bk/tests/Tests/Unit/Common/Acl/AclMainTest.php:44

Do i need to configure test db ? how?

Hi @Rashi ,
That test will require an administrator user with the username ‘admin’ :
openemr/AclMainTest.php at master · openemr/openemr · GitHub