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

Index: php-horde-injector/Horde_Injector-2.0.5/test/Horde/Injector/Binder/ImplementationTest.php
===================================================================
--- php-horde-injector.orig/Horde_Injector-2.0.5/test/Horde/Injector/Binder/ImplementationTest.php
+++ php-horde-injector/Horde_Injector-2.0.5/test/Horde/Injector/Binder/ImplementationTest.php
@@ -1,7 +1,7 @@
 <?php
 class Horde_Injector_Binder_ImplementationTest extends Horde_Test_Case
 {
-    public function setUp()
+    public function setUp(): void
     {
         $this->df = new Horde_Injector_DependencyFinder();
     }
@@ -49,11 +49,9 @@ class Horde_Injector_Binder_Implementati
         );
     }
 
-    /**
-     * @expectedException Horde_Injector_Exception
-     */
     public function testShouldThrowExceptionWhenTryingToCreateInstanceOfClassWithUntypedDependencies()
     {
+        $this->expectException('Horde_Injector_Exception');
         $implBinder = new Horde_Injector_Binder_Implementation(
             'Horde_Injector_Binder_ImplementationTest__UntypedDependency',
             $this->df
@@ -74,11 +72,9 @@ class Horde_Injector_Binder_Implementati
         $this->assertEquals('DEPENDENCY', $createdInstance->dep);
     }
 
-    /**
-     * @expectedException Horde_Injector_Exception
-     */
     public function testShouldThrowExceptionIfRequestedClassIsNotDefined()
     {
+        $this->expectException('Horde_Injector_Exception');
         $implBinder = new Horde_Injector_Binder_Implementation(
             'CLASS_DOES_NOT_EXIST',
             $this->df
@@ -87,11 +83,9 @@ class Horde_Injector_Binder_Implementati
         $implBinder->create($this->_getInjectorNeverCallMock());
     }
 
-    /**
-     * @expectedException Horde_Injector_Exception
-     */
     public function testShouldThrowExceptionIfImplementationIsAnInterface()
     {
+        $this->expectException('Horde_Injector_Exception');
         $implBinder = new Horde_Injector_Binder_Implementation(
             'Horde_Injector_Binder_ImplementationTest__Interface',
             $this->df
@@ -100,11 +94,9 @@ class Horde_Injector_Binder_Implementati
         $implBinder->create($this->_getInjectorNeverCallMock());
     }
 
-    /**
-     * @expectedException Horde_Injector_Exception
-     */
     public function testShouldThrowExceptionIfImplementationIsAnAbstractClass()
     {
+        $this->expectException('Horde_Injector_Exception');
         $implBinder = new Horde_Injector_Binder_Implementation(
             'Horde_Injector_Binder_ImplementationTest__AbstractClass',
             $this->df
Index: php-horde-injector/Horde_Injector-2.0.5/test/Horde/Injector/InjectorTest.php
===================================================================
--- php-horde-injector.orig/Horde_Injector-2.0.5/test/Horde/Injector/InjectorTest.php
+++ php-horde-injector/Horde_Injector-2.0.5/test/Horde/Injector/InjectorTest.php
@@ -1,9 +1,11 @@
 <?php
-class Horde_Injector_InjectorTest extends PHPUnit_Framework_TestCase
+class Horde_Injector_InjectorTest extends Horde_Test_Case
 {
     public function testShouldGetDefaultImplementationBinder()
     {
-        $topLevel = $this->getMock('Horde_Injector_TopLevel', array('getBinder'));
+        $topLevel = $this->getMockBuilder('Horde_Injector_TopLevel')
+                         ->setMethods(array('getBinder'))
+                         ->getMock();
         $topLevel->expects($this->once())
             ->method('getBinder')
             ->with($this->equalTo('UNBOUND_INTERFACE'))
@@ -42,20 +44,16 @@ class Horde_Injector_InjectorTest extend
             $injector->getBinder('BOUND_INTERFACE'));
     }
 
-    /**
-     * @expectedException BadMethodCallException
-     */
     public function testShouldThrowExceptionIfInterfaceNameIsNotPassedToMagicFactoryMethodForBinderAddition()
     {
+        $this->expectException('BadMethodCallException');
         $injector = new Horde_Injector($this->_getTopLevelNeverCalledMock());
         $injector->bindMock();
     }
 
-    /**
-     * @expectedException BadMethodCallException
-     */
     public function testShouldThrowExceptionIfMethodNameIsInvalid()
     {
+        $this->expectException('BadMethodCallException');
         $injector = new Horde_Injector($this->_getTopLevelNeverCalledMock());
         $injector->invalid();
     }
@@ -159,7 +157,9 @@ class Horde_Injector_InjectorTest extend
      */
     public function testChildInjectorsDoNotAskParentForInstanceIfBindingIsSet()
     {
-        $mockTopLevel = $this->getMock('Horde_Injector_TopLevel', array('getInstance'));
+        $mockTopLevel = $this->getMockBuilder('Horde_Injector_TopLevel')
+                             ->setMethods(array('getInstance'))
+                             ->getMock();
         $mockTopLevel->expects($this->never())->method('getInstance');
         $injector = new Horde_Injector($mockTopLevel);
 
@@ -169,8 +169,9 @@ class Horde_Injector_InjectorTest extend
 
     public function testChildInjectorAsksParentForInstance()
     {
-        $topLevelMock = $this->getMock('Horde_Injector_TopLevel', array('getInstance'));
-
+        $topLevelMock = $this->getMockBuilder('Horde_Injector_TopLevel')
+                             ->setMethods(array('getInstance'))
+                             ->getMock();
         $topLevelMock->expects($this->once())
             ->method('getInstance')
             ->with('StdClass');
@@ -225,7 +226,10 @@ class Horde_Injector_InjectorTest extend
 
     public function testShouldAllowChildInjectorsAccessToParentInjectorBindings()
     {
-        $mockInjector = $this->getMock('Horde_Injector_TopLevel', array('getBinder'));
+        $mockInjector = $this->getMockBuilder('Horde_Injector_TopLevel')
+                             ->setMethods(array('getBinder'))
+                             ->getMock();
+
         $mockInjector->expects($this->any()) // this gets called once in addBinder
             ->method('getBinder')
             ->with('BOUND_INTERFACE')
@@ -240,7 +244,9 @@ class Horde_Injector_InjectorTest extend
 
     private function _getTopLevelNeverCalledMock()
     {
-        $topLevel = $this->getMock('Horde_Injector_TopLevel', array('getBinder', 'getInstance'));
+        $topLevel = $this->getMockBuilder('Horde_Injector_TopLevel')
+                         ->setMethods(array('getBinder', 'getInstance'))
+                         ->getMock();
         $topLevel->expects($this->never())->method('getBinder');
         return $topLevel;
     }
