Skip only those tests that really rely on Net_LDAP2
authorGunnar Wrobel <p@rdus.de>
Fri, 30 Oct 2009 23:19:10 +0000 (00:19 +0100)
committerGunnar Wrobel <p@rdus.de>
Fri, 30 Oct 2009 23:19:10 +0000 (00:19 +0100)
13 files changed:
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/ConfigurationTest.php
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/Conn/ConfigurationTest.php
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/Conn/LdapTest.php
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/ConstructorTest.php
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/InjectorTest.php
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Factory/KolabTest.php
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Ldap/FilteredTest.php
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Ldap/StandardTest.php
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/LdapTest.php
framework/Kolab_Server/test/Horde/Kolab/Server/Class/Server/Structure/LdapTest.php
framework/Kolab_Server/test/Horde/Kolab/Server/Connection/MockTest.php
framework/Kolab_Server/test/Horde/Kolab/Server/LdapTestCase.php
framework/Kolab_Server/test/Horde/Kolab/Server/Query/LdapTest.php

index 8e7a601..0365053 100644 (file)
@@ -35,6 +35,7 @@ extends Horde_Kolab_Server_LdapTestCase
 {
     public function testMethodGetserverHasResultLoggedServerIfALoggerWasProvidedInTheConfiguration()
     {
+        $this->skipIfNoLdap();
         $factory = new Horde_Kolab_Server_Factory_Configuration(
             array('logger' => 'set', 'basedn' => '')
         );
@@ -43,6 +44,7 @@ extends Horde_Kolab_Server_LdapTestCase
 
     public function testMethodGetserverHasResultMappedServerIfAMappedWasProvidedInTheConfiguration()
     {
+        $this->skipIfNoLdap();
         $factory = new Horde_Kolab_Server_Factory_Configuration(
             array('map' => array(), 'basedn' => '')
         );
@@ -51,6 +53,7 @@ extends Horde_Kolab_Server_LdapTestCase
 
     public function testMethodGetserverHasResultCleanerServerIfACleanedWasProvidedInTheConfiguration()
     {
+        $this->skipIfNoLdap();
         $factory = new Horde_Kolab_Server_Factory_Configuration(
             array('cleanup' => true, 'basedn' => '')
         );
@@ -77,6 +80,7 @@ extends Horde_Kolab_Server_LdapTestCase
 
     public function testMethodGetserverHasResultServer()
     {
+        $this->skipIfNoLdap();
         $factory = new Horde_Kolab_Server_Factory_Configuration(
             array('basedn' => '')
         );
@@ -99,6 +103,7 @@ extends Horde_Kolab_Server_LdapTestCase
 
     public function testMethodGetconnectionHasResultServerconnection()
     {
+        $this->skipIfNoLdap();
         $factory = new Horde_Kolab_Server_Factory_Configuration(
             array('basedn' => '')
         );
@@ -110,6 +115,7 @@ extends Horde_Kolab_Server_LdapTestCase
 
     public function testMethodGetcompositeHasResultServercomposite()
     {
+        $this->skipIfNoLdap();
         $factory = new Horde_Kolab_Server_Factory_Configuration(
             array('basedn' => '')
         );
index e081dbc..746c673 100644 (file)
@@ -71,6 +71,7 @@ extends Horde_Kolab_Server_LdapTestCase
 
     public function testMethodGetconnectionHasResultLdapConnectionIfConfiguredThatWay()
     {
+        $this->skipIfNoLdap();
         $factory = new Horde_Kolab_Server_Factory_Conn_Configuration(
             array('basedn' => 'a')
         );
index b00c137..880b816 100644 (file)
@@ -103,6 +103,7 @@ extends Horde_Kolab_Server_LdapTestCase
 
     public function testMethodGetconnectionHasResultConnectionSimpleldap()
     {
+        $this->skipIfNoLdap();
         $factory = new Horde_Kolab_Server_Factory_Conn_Ldap();
         $factory->setConfiguration(array('basedn' => 'test'));
         $this->assertType(
@@ -113,6 +114,7 @@ extends Horde_Kolab_Server_LdapTestCase
 
     public function testMethodGetconnectionHasResultConnectionSplittedldapIfTheHostMasterIsSet()
     {
+        $this->skipIfNoLdap();
         $factory = new Horde_Kolab_Server_Factory_Conn_Ldap();
         $factory->setConfiguration(array('basedn' => 'test', 'host_master' => 'dummy'));
         $this->assertType(
index ed0ca15..6b719e9 100644 (file)
@@ -53,6 +53,7 @@ extends Horde_Kolab_Server_LdapTestCase
 
     public function testMethodGetserverReturnsServer()
     {
+        $this->skipIfNoLdap();
         $this->factory->expects($this->once())
             ->method('getConnection')
             ->will(
@@ -99,6 +100,7 @@ extends Horde_Kolab_Server_LdapTestCase
 
     public function testMethodGetcompositeReturnsComposite()
     {
+        $this->skipIfNoLdap();
         $this->factory->expects($this->once())
             ->method('getConnection')
             ->will(
index 3e52234..85787a0 100644 (file)
@@ -65,6 +65,7 @@ extends Horde_Kolab_Server_LdapTestCase
 
     public function testMethodGetserverHasResultServerldapstandard()
     {
+        $this->skipIfNoLdap();
         $factory = $this->_getFactory(array('basedn' => 'test'));
         $this->assertType(
             'Horde_Kolab_Server_Ldap_Standard',
@@ -88,6 +89,7 @@ extends Horde_Kolab_Server_LdapTestCase
 
     public function testMethodGetserverHasResultServerldapFilteredIfAFilterWasSet()
     {
+        $this->skipIfNoLdap();
         $factory = $this->_getFactory(array('filter' => 'test', 'basedn' => 'test'));
         $this->assertType(
             'Horde_Kolab_Server_Ldap_Filtered',
@@ -148,6 +150,7 @@ extends Horde_Kolab_Server_LdapTestCase
 
     public function testMethodGetcompositeHasResultComposite()
     {
+        $this->skipIfNoLdap();
         $factory = $this->_getFactory(array('basedn' => 'test'));
         $this->assertType(
             'Horde_Kolab_Server_Composite',
index 64e4c29..e0bb3eb 100644 (file)
@@ -35,7 +35,6 @@ extends Horde_Kolab_Server_LdapTestCase
 {
     public function setUp()
     {
-        parent::setUp();
         $this->conn_factory = $this->getMock('Horde_Kolab_Server_Factory_Conn');
         $this->connection = $this->getMock('Horde_Kolab_Server_Connection');
     }
@@ -126,6 +125,7 @@ extends Horde_Kolab_Server_LdapTestCase
 
     public function testMethodGetserverHasResultServerldapstandard()
     {
+        $this->skipIfNoLdap();
         $this->conn_factory->expects($this->once())
             ->method('getConnection')
             ->will($this->returnValue($this->connection));
@@ -140,6 +140,7 @@ extends Horde_Kolab_Server_LdapTestCase
 
     public function testMethodGetserverHasResultServerldapfilteredIfTheFilterOptionIsSet()
     {
+        $this->skipIfNoLdap();
         $this->conn_factory->expects($this->once())
             ->method('getConnection')
             ->will($this->returnValue($this->connection));
@@ -167,6 +168,7 @@ extends Horde_Kolab_Server_LdapTestCase
 
     public function testMethodGetcompositeHasResultComposite()
     {
+        $this->skipIfNoLdap();
         $this->conn_factory->expects($this->once())
             ->method('getConnection')
             ->will($this->returnValue($this->connection));
index e23aabd..e91dc2a 100644 (file)
@@ -34,7 +34,7 @@ class Horde_Kolab_Server_Class_Server_Ldap_FilteredTest extends Horde_Kolab_Serv
 {
     public function setUp()
     {
-        parent::setUp();
+        $this->skipIfNoLdap();
 
         $this->ldap_read  = $this->getMock('Net_LDAP2');
         $this->ldap_write = $this->getMock('Net_LDAP2');
index be5bf7c..3a704b7 100644 (file)
@@ -34,7 +34,7 @@ class Horde_Kolab_Server_Class_Server_Ldap_StandardTest extends Horde_Kolab_Serv
 {
     public function setUp()
     {
-        parent::setUp();
+        $this->skipIfNoLdap();
 
         $this->ldap_read  = $this->getMock('Net_LDAP2');
         $this->ldap_write = $this->getMock('Net_LDAP2');
index 1bdfb16..6316fe0 100644 (file)
@@ -34,7 +34,7 @@ class Horde_Kolab_Server_Class_Server_LdapTest extends Horde_Kolab_Server_LdapTe
 {
     public function setUp()
     {
-        parent::setUp();
+        $this->skipIfNoLdap();
 
         $this->ldap_read  = $this->getMock('Net_LDAP2');
         $this->ldap_write = $this->getMock('Net_LDAP2');
index 96725b5..3db7972 100644 (file)
@@ -14,7 +14,7 @@
 /**
  * Require our basic test case definition
  */
-require_once dirname(__FILE__) . '/../../../Autoload.php';
+require_once dirname(__FILE__) . '/../../../LdapTestCase.php';
 
 /**
  * Test the LDAP backend.
@@ -30,7 +30,7 @@ require_once dirname(__FILE__) . '/../../../Autoload.php';
  * @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()
     {
@@ -46,6 +46,7 @@ class Horde_Kolab_Server_Class_Server_Structure_LdapTest extends PHPUnit_Framewo
 
     public function testMethodFindHasResultServerResultTheSearchResult()
     {
+        $this->skipIfNoLdap();
         $result = $this->getMock('Horde_Kolab_Server_Result');
         $this->composite->server->expects($this->exactly(1))
             ->method('find')
@@ -60,6 +61,7 @@ class Horde_Kolab_Server_Class_Server_Structure_LdapTest extends PHPUnit_Framewo
 
     public function testMethodFindBelowHasResultServerResultTheSearchResult()
     {
+        $this->skipIfNoLdap();
         $result = $this->getMock('Horde_Kolab_Server_Result');
         $this->composite->server->expects($this->exactly(1))
             ->method('findBelow')
index 64cd092..23a4206 100644 (file)
@@ -33,7 +33,6 @@ require_once dirname(__FILE__) . '/../LdapTestCase.php';
 class Horde_Kolab_Server_Connection_MockTest
 extends Horde_Kolab_Server_LdapTestCase
 {
-
     /**
      * Test parsing of LDAP filters.
      *
@@ -41,6 +40,8 @@ extends Horde_Kolab_Server_LdapTestCase
      */
     public function testFilterParse()
     {
+        $this->skipIfNoLdap();
+
         $conn = new Horde_Kolab_Server_Connection_Mock(array());
 
         $a = $conn->parse('(a=b)');
@@ -90,6 +91,8 @@ extends Horde_Kolab_Server_LdapTestCase
      */
     public function testSearch()
     {
+        $this->skipIfNoLdap();
+
         $conn = new Horde_Kolab_Server_Connection_Mock(
             array(
                 'data' =>
index fb83bc0..9cd106a 100644 (file)
@@ -32,7 +32,7 @@ require_once dirname(__FILE__) . '/TestCase.php';
  */
 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!');
index b6e941b..b8733af 100644 (file)
@@ -34,7 +34,7 @@ class Horde_Kolab_Server_Query_LdapTest extends Horde_Kolab_Server_LdapTestCase
 {
     public function setUp()
     {
-        parent::setUp();
+        $this->skipIfNoLdap();
         $this->structure = $this->getMock('Horde_Kolab_Server_Structure');
     }