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

package info (click to toggle)
php-horde-http 2.1.7-9
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 276 kB
  • sloc: php: 990; xml: 588; sh: 4; makefile: 2
file content (119 lines) | stat: -rw-r--r-- 4,239 bytes parent folder | download
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
Description: Adapt to PHPUnit 8.x and 9.x API.
Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>

--- a/Horde_Http-2.1.7/test/Horde/Http/CurlTest.php
+++ b/Horde_Http-2.1.7/test/Horde/Http/CurlTest.php
@@ -18,7 +18,7 @@
  */
 class Horde_Http_CurlTest extends Horde_Http_TestBase
 {
-    public function setUp()
+    public function setUp(): void
     {
         if (!function_exists('curl_exec')) {
             $this->markTestSkipped('Missing PHP extension "curl"!');
--- a/Horde_Http-2.1.7/test/Horde/Http/MockTest.php
+++ b/Horde_Http-2.1.7/test/Horde/Http/MockTest.php
@@ -24,7 +24,7 @@
  * @license    http://www.horde.org/licenses/bsd
  * @link       http://www.horde.org/libraries/Horde_Http
  */
-class Horde_Http_MockTest extends PHPUnit_Framework_TestCase
+class Horde_Http_MockTest extends Horde_Test_Case
 {
     public function testNoResponses()
     {
--- a/Horde_Http-2.1.7/test/Horde/Http/Peclhttp2Test.php
+++ b/Horde_Http-2.1.7/test/Horde/Http/Peclhttp2Test.php
@@ -18,7 +18,7 @@
  */
 class Horde_Http_Peclhttp2Test extends Horde_Http_TestBase
 {
-    public function setUp()
+    public function setUp(): void
     {
         if (!class_exists('\http\Client', false)) {
             $this->markTestSkipped('Missing PHP extension "http" or wrong version!');
--- a/Horde_Http-2.1.7/test/Horde/Http/PeclhttpTest.php
+++ b/Horde_Http-2.1.7/test/Horde/Http/PeclhttpTest.php
@@ -18,7 +18,7 @@
  */
 class Horde_Http_PeclhttpTest extends Horde_Http_TestBase
 {
-    public function setUp()
+    public function setUp(): void
     {
         if (!class_exists('HttpRequest', false)) {
             $this->markTestSkipped('Missing PHP extension "http" or wrong version!');
--- a/Horde_Http-2.1.7/test/Horde/Http/TestBase.php
+++ b/Horde_Http-2.1.7/test/Horde/Http/TestBase.php
@@ -22,13 +22,13 @@
 
     protected static $_requestClass;
 
-    public static function setUpBeforeClass()
+    public static function setUpBeforeClass(): void
     {
         preg_match('/Horde_Http_(.*)Test/', get_called_class(), $match);
         self::$_requestClass = 'Horde_Http_Request_' . $match[1];
     }
 
-    public function setUp()
+    public function setUp(): void
     {
         $config = self::getConfig('HTTP_TEST_CONFIG');
         if ($config && !empty($config['http']['server'])) {
@@ -47,10 +47,10 @@
         $this->assertStringStartsWith('http', $response->uri);
         $this->assertStringStartsWith('1.', $response->httpVersion);
         $this->assertEquals(200, $response->code);
-        $this->assertInternalType('array', $response->headers);
-        $this->assertInternalType('string', $response->getBody());
+        $this->assertIsArray($response->headers);
+        $this->assertIsString($response->getBody());
         $this->assertGreaterThan(0, strlen($response->getBody()));
-        $this->assertInternalType('resource', $response->getStream());
+        $this->assertIsResource($response->getStream());
         $this->assertStringMatchesFormat(
             '%s/%s',
             $response->getHeader('Content-Type')
@@ -66,22 +66,18 @@
         );
     }
 
-    /**
-     * @expectedException Horde_Http_Exception
-     */
     public function testThrowsOnBadUri()
     {
+        $this->expectException('Horde_Http_Exception');
         $client = new Horde_Http_Client(
             array('request' => new self::$_requestClass())
         );
         $client->get('http://doesntexist/');
     }
 
-    /**
-     * @expectedException Horde_Http_Exception
-     */
     public function testThrowsOnInvalidProxyType()
     {
+        $this->expectException('Horde_Http_Exception');
         $client = new Horde_Http_Client(
             array(
                 'request' => new self::$_requestClass(
--- a/Horde_Http-2.1.7/test/Horde/Http/ClientTest.php
+++ b/Horde_Http-2.1.7/test/Horde/Http/ClientTest.php
@@ -34,11 +34,9 @@
         $this->assertEquals(10, $request->timeout);
     }
 
-    /**
-     * @expectedException Horde_Http_Exception
-     */
     public function testSetUnknownOption()
     {
+        $this->expectException('Horde_Http_Exception');
         $request = new Horde_Http_Request_Mock();
         $client = new Horde_Http_Client(
             array('request' => $request)