Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: GO3LIN on May 14, 2015, 10:32:54 AM

Title: Unit testing with PHPUnit
Post by: GO3LIN on May 14, 2015, 10:32:54 AM
Hello,

I am trying to add unit testing capabilites to my plugins, I have installed PHPUnit + VisualPHPUnit but when I ran tests it gives me this error:
Fatal error: Class 'rcube_plugin' not found in /rc1.0/plugins/acl/acl.php on line 27

Have I skipped some PHPUnit configuration to define the roundcube environment and include the appropriate files ?

EDIT :
I found a solution for this problem, however it's probably not the best one but it works. In the setUp method of each of the PHPUnit_Framework_TestCase test class I included the file /program/lib/Roundcube/bootstrap.php

Gratefully,