{
public function testMethodGetserverHasResultLoggedServerIfALoggerWasProvidedInTheConfiguration()
{
+ $this->skipIfNoLdap();
$factory = new Horde_Kolab_Server_Factory_Configuration(
array('logger' => 'set', 'basedn' => '')
);
public function testMethodGetserverHasResultMappedServerIfAMappedWasProvidedInTheConfiguration()
{
+ $this->skipIfNoLdap();
$factory = new Horde_Kolab_Server_Factory_Configuration(
array('map' => array(), 'basedn' => '')
);
public function testMethodGetserverHasResultCleanerServerIfACleanedWasProvidedInTheConfiguration()
{
+ $this->skipIfNoLdap();
$factory = new Horde_Kolab_Server_Factory_Configuration(
array('cleanup' => true, 'basedn' => '')
);
public function testMethodGetserverHasResultServer()
{
+ $this->skipIfNoLdap();
$factory = new Horde_Kolab_Server_Factory_Configuration(
array('basedn' => '')
);
public function testMethodGetconnectionHasResultServerconnection()
{
+ $this->skipIfNoLdap();
$factory = new Horde_Kolab_Server_Factory_Configuration(
array('basedn' => '')
);
public function testMethodGetcompositeHasResultServercomposite()
{
+ $this->skipIfNoLdap();
$factory = new Horde_Kolab_Server_Factory_Configuration(
array('basedn' => '')
);
public function testMethodGetconnectionHasResultLdapConnectionIfConfiguredThatWay()
{
+ $this->skipIfNoLdap();
$factory = new Horde_Kolab_Server_Factory_Conn_Configuration(
array('basedn' => 'a')
);
public function testMethodGetconnectionHasResultConnectionSimpleldap()
{
+ $this->skipIfNoLdap();
$factory = new Horde_Kolab_Server_Factory_Conn_Ldap();
$factory->setConfiguration(array('basedn' => 'test'));
$this->assertType(
public function testMethodGetconnectionHasResultConnectionSplittedldapIfTheHostMasterIsSet()
{
+ $this->skipIfNoLdap();
$factory = new Horde_Kolab_Server_Factory_Conn_Ldap();
$factory->setConfiguration(array('basedn' => 'test', 'host_master' => 'dummy'));
$this->assertType(
public function testMethodGetserverReturnsServer()
{
+ $this->skipIfNoLdap();
$this->factory->expects($this->once())
->method('getConnection')
->will(
public function testMethodGetcompositeReturnsComposite()
{
+ $this->skipIfNoLdap();
$this->factory->expects($this->once())
->method('getConnection')
->will(
public function testMethodGetserverHasResultServerldapstandard()
{
+ $this->skipIfNoLdap();
$factory = $this->_getFactory(array('basedn' => 'test'));
$this->assertType(
'Horde_Kolab_Server_Ldap_Standard',
public function testMethodGetserverHasResultServerldapFilteredIfAFilterWasSet()
{
+ $this->skipIfNoLdap();
$factory = $this->_getFactory(array('filter' => 'test', 'basedn' => 'test'));
$this->assertType(
'Horde_Kolab_Server_Ldap_Filtered',
public function testMethodGetcompositeHasResultComposite()
{
+ $this->skipIfNoLdap();
$factory = $this->_getFactory(array('basedn' => 'test'));
$this->assertType(
'Horde_Kolab_Server_Composite',
{
public function setUp()
{
- parent::setUp();
$this->conn_factory = $this->getMock('Horde_Kolab_Server_Factory_Conn');
$this->connection = $this->getMock('Horde_Kolab_Server_Connection');
}
public function testMethodGetserverHasResultServerldapstandard()
{
+ $this->skipIfNoLdap();
$this->conn_factory->expects($this->once())
->method('getConnection')
->will($this->returnValue($this->connection));
public function testMethodGetserverHasResultServerldapfilteredIfTheFilterOptionIsSet()
{
+ $this->skipIfNoLdap();
$this->conn_factory->expects($this->once())
->method('getConnection')
->will($this->returnValue($this->connection));
public function testMethodGetcompositeHasResultComposite()
{
+ $this->skipIfNoLdap();
$this->conn_factory->expects($this->once())
->method('getConnection')
->will($this->returnValue($this->connection));
{
public function setUp()
{
- parent::setUp();
+ $this->skipIfNoLdap();
$this->ldap_read = $this->getMock('Net_LDAP2');
$this->ldap_write = $this->getMock('Net_LDAP2');
{
public function setUp()
{
- parent::setUp();
+ $this->skipIfNoLdap();
$this->ldap_read = $this->getMock('Net_LDAP2');
$this->ldap_write = $this->getMock('Net_LDAP2');
{
public function setUp()
{
- parent::setUp();
+ $this->skipIfNoLdap();
$this->ldap_read = $this->getMock('Net_LDAP2');
$this->ldap_write = $this->getMock('Net_LDAP2');
/**
* Require our basic test case definition
*/
-require_once dirname(__FILE__) . '/../../../Autoload.php';
+require_once dirname(__FILE__) . '/../../../LdapTestCase.php';
/**
* Test the LDAP backend.
* @license http://www.fsf.org/copyleft/lgpl.html LGPL
* @link http://pear.horde.org/index.php?package=Kolab_Server
*/
-class Horde_Kolab_Server_Class_Server_Structure_LdapTest extends PHPUnit_Framework_TestCase
+class Horde_Kolab_Server_Class_Server_Structure_LdapTest extends Horde_Kolab_Server_LdapTestCase
{
public function setUp()
{
public function testMethodFindHasResultServerResultTheSearchResult()
{
+ $this->skipIfNoLdap();
$result = $this->getMock('Horde_Kolab_Server_Result');
$this->composite->server->expects($this->exactly(1))
->method('find')
public function testMethodFindBelowHasResultServerResultTheSearchResult()
{
+ $this->skipIfNoLdap();
$result = $this->getMock('Horde_Kolab_Server_Result');
$this->composite->server->expects($this->exactly(1))
->method('findBelow')
class Horde_Kolab_Server_Connection_MockTest
extends Horde_Kolab_Server_LdapTestCase
{
-
/**
* Test parsing of LDAP filters.
*
*/
public function testFilterParse()
{
+ $this->skipIfNoLdap();
+
$conn = new Horde_Kolab_Server_Connection_Mock(array());
$a = $conn->parse('(a=b)');
*/
public function testSearch()
{
+ $this->skipIfNoLdap();
+
$conn = new Horde_Kolab_Server_Connection_Mock(
array(
'data' =>
*/
class Horde_Kolab_Server_LdapTestCase extends Horde_Kolab_Server_TestCase
{
- public function setUp()
+ public function skipIfNoLdap()
{
if (!extension_loaded('ldap') && !@dl('ldap.' . PHP_SHLIB_SUFFIX)) {
$this->markTestSuiteSkipped('Ldap extension is missing!');
{
public function setUp()
{
- parent::setUp();
+ $this->skipIfNoLdap();
$this->structure = $this->getMock('Horde_Kolab_Server_Structure');
}