In the extension's `tests/phpunit/bootstrap.php`, it forced the container to
*never* use caching. I suspect this was because of two problems:
1. APIv4 does a directory scan for services, but it didn't inform
the container that this directory was important.
2. APIv4 registers additional services for a test environment, but the
caching system didn't allow different caches for live-vs-test env's.
);
foreach ($locations as $location) {
$path = \CRM_Utils_File::addTrailingSlash(dirname($location)) . str_replace('\\', DIRECTORY_SEPARATOR, $namespace);
+ $container->addResource(new \Symfony\Component\Config\Resource\DirectoryResource($path, ';\.php$;'));
foreach (glob("$path*.php") as $file) {
$matches = [];
preg_match('/(\w*).php/', $file, $matches);
\CRM_Utils_Array::value('HTTP_HOST', $_SERVER, ''),
// e.g. port-based vhosts
\CRM_Utils_Array::value('SERVER_PORT', $_SERVER, ''),
+ // e.g. unit testing
+ defined('CIVICRM_TEST') ? 1 : 0,
// Depending on deployment arch, these signals *could* be redundant, but who cares?
]));
}