[Vtigercrm-developers] Vtiger and PHPUnit (automated testing)

Rubén A. Estrada Orozco rulotec1 at gmail.com
Fri Nov 29 17:12:39 GMT 2019


Hi everyone,

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.

I included the following at the top of my test script:

require_once 'vtlib/Vtiger/Module.php';
require_once 'include/utils/VtlibUtils.php';
require_once 'config.inc.php';
require_once 'includes/Loader.php';
require_once 'modules/Emails/mail.php';
vimport ('includes.runtime.EntryPoint');
$current_user = Users::getActiveAdminUser();

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.

I hope there is someone who has experience on this and would be willing to
share his/her knowledge.

Saludos

Rubén
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20191129/532bf875/attachment.html>


More information about the vtigercrm-developers mailing list