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

package info (click to toggle)
php-horde-ldap 2.4.2-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 600 kB
  • sloc: php: 3,854; xml: 576; sh: 31; makefile: 2
file content (149 lines) | stat: -rw-r--r-- 4,841 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
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
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>