File: 1010_phpunit-8.x%2B9.x.patch

package info (click to toggle)
php-horde-service-gravatar 1.0.1-10
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 168 kB
  • sloc: php: 235; xml: 146; sh: 4; makefile: 2
file content (68 lines) | stat: -rw-r--r-- 2,755 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Description: Adapt to PHPUnit 8.x and 9.x API.
Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>

Index: php-horde-service-gravatar/Horde_Service_Gravatar-1.0.1/test/Horde/Service/Gravatar/GravatarTest.php
===================================================================
--- php-horde-service-gravatar.orig/Horde_Service_Gravatar-1.0.1/test/Horde/Service/Gravatar/GravatarTest.php
+++ php-horde-service-gravatar/Horde_Service_Gravatar-1.0.1/test/Horde/Service/Gravatar/GravatarTest.php
@@ -21,12 +21,12 @@
  * @package   Service_Gravatar
  */
 class Horde_Service_Gravatar_GravatarTest
-extends PHPUnit_Framework_TestCase
+extends Horde_Test_Case
 {
     public function testReturn()
     {
         $g = new Horde_Service_Gravatar();
-        $this->assertInternalType('string', $g->getId('test'));
+        $this->assertIsString($g->getId('test'));
     }
 
     public function testAddress()
@@ -74,11 +74,10 @@ extends PHPUnit_Framework_TestCase
         );
     }
 
-    /**
-     * @expectedException InvalidArgumentException
-     */
     public function testInvalidMail()
     {
+        $this->expectException('InvalidArgumentException');
+
         $g = new Horde_Service_Gravatar();
         $g->getId(0.0);
     }
@@ -138,12 +137,16 @@ extends PHPUnit_Framework_TestCase
 
     private function _getMockedGravatar($response_string)
     {
-        $response = $this->getMock('Horde_Http_Response', array('getBody'));
+        $response = $this->getMockBuilder('Horde_Http_Response')
+                         ->setMethods(array('getBody'))
+                         ->getMock();
         $response->expects($this->once())
             ->method('getBody')
             ->will($this->returnValue($response_string));
 
-        $mock = $this->getMock('Horde_Http_Client', array('get'));
+        $mock = $this->getMockBuilder('Horde_Http_Client')
+                     ->setMethods(array('get'))
+                     ->getMock();
         $mock->expects($this->once())
             ->method('get')
             ->will($this->returnValue($response));
Index: php-horde-service-gravatar/Horde_Service_Gravatar-1.0.1/test/Horde/Service/Gravatar/ServerTest.php
===================================================================
--- php-horde-service-gravatar.orig/Horde_Service_Gravatar-1.0.1/test/Horde/Service/Gravatar/ServerTest.php
+++ php-horde-service-gravatar/Horde_Service_Gravatar-1.0.1/test/Horde/Service/Gravatar/ServerTest.php
@@ -24,7 +24,7 @@ class Horde_Service_Gravatar_ServerTest
 {
     private $_server;
 
-    public function setUp()
+    public function setUp(): void
     {
         $config = self::getConfig('SERVICE_GRAVATAR_TEST_CONFIG');
         if ($config && !empty($config['service']['gravatar']['server'])) {