<div dir="ltr">Hi everyone,<div><br></div><div>The other day I was playing around with PHPUnit trying to do some automated tests for a custom module. However, in some cases the tests won't run because the database object or log object are not initialized.</div><div><br></div><div>I included the following at the top of my test script:</div><div><br></div><div>require_once 'vtlib/Vtiger/Module.php';<br>require_once 'include/utils/VtlibUtils.php';<br>require_once 'config.inc.php';<br>require_once 'includes/Loader.php';<br>require_once 'modules/Emails/mail.php';<br>vimport ('includes.runtime.EntryPoint');<br>$current_user = Users::getActiveAdminUser();<br></div><div><br></div><div>I have previously used those lines of code when I need to run a script using vtiger's environment and it works. However, for some reason, it doesn't in the case of PHPUnit.</div><div><br></div><div>I hope there is someone who has experience on this and would be willing to share his/her knowledge.</div><div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Saludos<div><br></div><div>RubĂ©n</div></div></div></div></div></div>