From 6f605ecd671e7e6d5e9734dc74c3b9480613c090 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Fri, 21 Mar 2014 10:08:17 +0100 Subject: [PATCH] make tests work on systems without php5_ldap --- apps/user_ldap/tests/wizard.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/apps/user_ldap/tests/wizard.php b/apps/user_ldap/tests/wizard.php index f3178332ae..2b5cabc705 100644 --- a/apps/user_ldap/tests/wizard.php +++ b/apps/user_ldap/tests/wizard.php @@ -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;