Description: Adapt to PHPUnit 8.x and 9.x API.
Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>

--- a/Horde_Ldap-2.4.2/test/Horde/Ldap/EntryTest.php
+++ b/Horde_Ldap-2.4.2/test/Horde/Ldap/EntryTest.php
@@ -8,7 +8,7 @@
  * @license    http://www.gnu.org/licenses/lgpl-3.0.html LGPL-3.0
  */
 
-class Horde_Ldap_EntryTest extends PHPUnit_Framework_TestCase
+class Horde_Ldap_EntryTest extends Horde_Test_Case
 {
     public function testCreateFreshSuccess()
     {
--- a/Horde_Ldap-2.4.2/test/Horde/Ldap/FilterTest.php
+++ b/Horde_Ldap-2.4.2/test/Horde/Ldap/FilterTest.php
@@ -8,7 +8,7 @@
  * @license    http://www.gnu.org/licenses/lgpl-3.0.html LGPL-3.0
  */
 
-class Horde_Ldap_FilterTest extends PHPUnit_Framework_TestCase
+class Horde_Ldap_FilterTest extends Horde_Test_Case
 {
     /**
      * Test correct parsing of filter strings through parse().
--- a/Horde_Ldap-2.4.2/test/Horde/Ldap/LdapTest.php
+++ b/Horde_Ldap-2.4.2/test/Horde/Ldap/LdapTest.php
@@ -12,7 +12,7 @@
  */
 class Horde_Ldap_LdapTest extends Horde_Ldap_TestBase
 {
-    public static function tearDownAfterClass()
+    public static function tearDownAfterClass(): void
     {
         if (!self::$ldapcfg) {
             return;
@@ -46,6 +46,8 @@
      */
     public function testConnectAndPrivilegedBind()
     {
+        $this->expectNotToPerformAssertions();
+
         // This connect is supposed to fail.
         $lcfg = array(
             'hostspec' => 'nonexistant.ldap.horde.org',
@@ -91,6 +93,8 @@
      */
     public function testConnectAndAnonymousBind()
     {
+        $this->expectNotToPerformAssertions();
+
         if (!self::$ldapcfg['capability']['anonymous']) {
             $this->markTestSkipped('Server does not support anonymous bind');
         }
@@ -104,11 +108,11 @@
     /**
      * Tests if the server can connect and bind, but not rebind with empty
      * password.
-     *
-     * @expectedException Horde_Ldap_Exception
      */
     public function testConnectAndEmptyRebind()
     {
+        $this->expectException('Horde_Ldap_Exception');
+
         // Simple working connect and privileged bind.
         $ldap = new Horde_Ldap(self::$ldapcfg['server']);
         $ldap->bind(self::$ldapcfg['server']['binddn'], '');
@@ -119,6 +123,8 @@
      */
     public function testStartTLS()
     {
+        $this->expectNotToPerformAssertions();
+
         if (!self::$ldapcfg['capability']['tls']) {
             $this->markTestSkipped('Server does not support TLS');
         }
--- a/Horde_Ldap-2.4.2/test/Horde/Ldap/LdifTest.php
+++ b/Horde_Ldap-2.4.2/test/Horde/Ldap/LdifTest.php
@@ -7,7 +7,7 @@
  * @author     Jan Schneider <jan@horde.org>
  * @license    http://www.gnu.org/licenses/lgpl-3.0.html LGPL-3.0
  */
-class Horde_Ldap_LdifTest extends PHPUnit_Framework_TestCase
+class Horde_Ldap_LdifTest extends Horde_Test_Case
 {
     /**
      * Default configuration for tests.
@@ -84,7 +84,7 @@
     /**
      * Opens an outfile and ensures correct permissions.
      */
-    public function setUp()
+    public function setUp(): void
     {
         // Initialize test entries.
         $this->_testentries = array();
@@ -108,7 +108,7 @@
     /**
      * Removes the outfile.
      */
-    public function tearDown()
+    public function tearDown(): void
     {
         @unlink($this->_outfile);
     }
@@ -433,14 +433,14 @@
 
         // Test for line number reporting
         $ldif = new Horde_Ldap_Ldif(__DIR__ . '/fixtures/malformed_syntax.ldif', 'r', $this->_defaultConfig);
-        $this->setExpectedException('Horde_Ldap_Exception',
+        $this->expectException('Horde_Ldap_Exception',
                                     'Invalid syntax at input line 7');
         do {
             $entry = $ldif->readEntry();
         } while (!$ldif->eof());
 
         // Error giving error msg and line number:
-        $this->setExpectedException('Horde_Ldap_Exception');
+        $this->expectException('Horde_Ldap_Exception');
         $ldif = new Horde_Ldap_Ldif(__DIR__ . '/some_not_existing/path/for/net_ldap_ldif', 'r', $this->_defaultConfig);
     }
 
--- a/Horde_Ldap-2.4.2/test/Horde/Ldap/SearchTest.php
+++ b/Horde_Ldap-2.4.2/test/Horde/Ldap/SearchTest.php
@@ -12,7 +12,7 @@
  */
 class Horde_Ldap_SearchTest extends Horde_Ldap_TestBase
 {
-    public static function tearDownAfterClass()
+    public static function tearDownAfterClass(): void
     {
         if (!self::$ldapcfg) {
             return;
--- a/Horde_Ldap-2.4.2/test/Horde/Ldap/TestBase.php
+++ b/Horde_Ldap-2.4.2/test/Horde/Ldap/TestBase.php
@@ -12,7 +12,7 @@
 {
     protected static $ldapcfg;
 
-    public function setUp()
+    public function setUp(): void
     {
         // Check extension.
         try {
--- /dev/null
+++ b/Horde_Ldap-2.4.2/test/Horde/Ldap/phpunit.xml
@@ -0,0 +1 @@
+<phpunit bootstrap="bootstrap.php"></phpunit>
