make tests work on systems without php5_ldap

This commit is contained in:
Arthur Schiwon 2014-03-21 10:08:17 +01:00
parent 3d2ab76347
commit 6f605ecd67
1 changed files with 12 additions and 0 deletions

View File

@ -30,6 +30,18 @@ use \OCA\user_ldap\lib\Wizard;
// use \OCA\user_ldap\lib\ILDAPWrapper;
class Test_Wizard extends \PHPUnit_Framework_TestCase {
public function setUp() {
//we need to make sure the consts are defined, otherwise tests will fail
//on systems without php5_ldap
$ldapConsts = array('LDAP_OPT_PROTOCOL_VERSION',
'LDAP_OPT_REFERRALS', 'LDAP_OPT_NETWORK_TIMEOUT');
foreach($ldapConsts as $const) {
if(!defined($const)) {
define($const, 42);
}
}
}
private function getWizardAndMocks() {
static $conMethods;