Starting with a new machine, and a new buildkit instance! Buildkit/bin's contents added to PATH successfully.

When I run cv php:boot --level classloader on the command line, I get:

require_once  '/var/www/project/sites/all/modules/civicrm' . "/CRM/Core/ClassLoader.php";\CRM_Core_ClassLoader::singleton()->register();

But when phpunit tests are through the command line (with any of phpunit5, phpunit6, or phpunit7), the cv command line fails, returning "".

In the test directory's phpunit bootstrap file, replacing $result with what's output above works until the next time cv is called in the process, whereupon it also breaks.

I have set the execute permission on ~/buildkit/bin/cv to be globally executable. But it's the same user running it that cloned the buildkit repo.

Any ideas?


I found the answer: I was using a backup: the CiviCRM unit test framework uses files and services not found without doing a git clone (or buildkit equivalent). The folders you need from a git clone are Tests and Tools.

Leaving this here in case it assists someone who encounters the same problem.


I've found that I have to replace

eval(cv('php:boot --level=classloader', 'phpcode'));


eval(`cv php:boot --level=classloader`);

I had to make one other change too but it's windows-specific.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.