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

package info (click to toggle)
php-horde-notification 2.0.4-9
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 288 kB
  • sloc: php: 839; xml: 385; sh: 3; makefile: 2
file content (130 lines) | stat: -rw-r--r-- 6,739 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
Description: Adapt to PHPUnit 8.x and 9.x API.
Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>

Index: php-horde-notification/Horde_Notification-2.0.4/test/Horde/Notification/Class/Notification/Handler/Decorator/AlarmTest.php
===================================================================
--- php-horde-notification.orig/Horde_Notification-2.0.4/test/Horde/Notification/Class/Notification/Handler/Decorator/AlarmTest.php
+++ php-horde-notification/Horde_Notification-2.0.4/test/Horde/Notification/Class/Notification/Handler/Decorator/AlarmTest.php
@@ -27,7 +27,7 @@
 class Horde_Notification_Class_Notification_Handler_Decorator_AlarmTest
 extends Horde_Test_Case
 {
-    public function setUp()
+    public function setUp(): void
     {
         $this->markTestIncomplete('Currently broken');
         if (!class_exists('Horde_Alarm')) {
Index: php-horde-notification/Horde_Notification-2.0.4/test/Horde/Notification/Class/Notification/Handler/Decorator/LogTest.php
===================================================================
--- php-horde-notification.orig/Horde_Notification-2.0.4/test/Horde/Notification/Class/Notification/Handler/Decorator/LogTest.php
+++ php-horde-notification/Horde_Notification-2.0.4/test/Horde/Notification/Class/Notification/Handler/Decorator/LogTest.php
@@ -27,13 +27,13 @@
 class Horde_Notification_Class_Notification_Handler_Decorator_LogTest
 extends Horde_Test_Case
 {
-    public function setUp()
+    public function setUp(): void
     {
         if (!class_exists('Horde_Log_Logger')) {
             $this->markTestSkipped('The Horde_Log package is not installed!');
         }
 
-        $this->logger = $this->getMock('Horde_Log_Logger');
+        $this->logger = $this->getMockBuilder('Horde_Log_Logger')->getMock();
         $this->log = new Horde_Notification_Handler_Decorator_Log(
             $this->logger
         );
Index: php-horde-notification/Horde_Notification-2.0.4/test/Horde/Notification/Class/Notification/HandlerTest.php
===================================================================
--- php-horde-notification.orig/Horde_Notification-2.0.4/test/Horde/Notification/Class/Notification/HandlerTest.php
+++ php-horde-notification/Horde_Notification-2.0.4/test/Horde/Notification/Class/Notification/HandlerTest.php
@@ -26,13 +26,13 @@
 
 class Horde_Notification_Class_Notification_HandlerTest extends Horde_Test_Case
 {
-    public function setUp()
+    public function setUp(): void
     {
         $this->storage = new Horde_Notification_Storage_Session('test');
         $this->handler = new Horde_Notification_Handler($this->storage);
     }
 
-    public function tearDown()
+    public function tearDown(): void
     {
         unset($_SESSION);
     }
@@ -108,7 +108,7 @@ class Horde_Notification_Class_Notificat
 
     public function testMethodClearHasPostconditionThatTheStorageOfTheSpecifiedListenerWasCleared()
     {
-        $storage = $this->getMock('Horde_Notification_Storage_Interface');
+        $storage = $this->getMockBuilder('Horde_Notification_Storage_Interface')->getMock();
         $storage->expects($this->once())
             ->method('clear')
             ->with('dummy');
@@ -119,7 +119,7 @@ class Horde_Notification_Class_Notificat
 
     public function testMethodClearHasPostconditionThatAllUnattachedEventsHaveBeenClearedFromStorageIfNoListenerWasSpecified()
     {
-        $storage = $this->getMock('Horde_Notification_Storage_Interface');
+        $storage = $this->getMockBuilder('Horde_Notification_Storage_Interface')->getMock();
         $storage->expects($this->once())
             ->method('clear')
             ->with('_unattached');
@@ -141,7 +141,7 @@ class Horde_Notification_Class_Notificat
 
     public function testMethodAdddecoratorHasPostconditionThatTheGivenDecoratorWasAddedToTheHandlerAndReceivesPushCalls()
     {
-        $decorator = $this->getMock('Horde_Notification_Handler_Decorator_Base');
+        $decorator = $this->getMockBuilder('Horde_Notification_Handler_Decorator_Base')->getMock();
         $decorator->expects($this->once())
             ->method('push')
             ->with($this->isInstanceOf('Horde_Notification_Event'));
@@ -153,7 +153,7 @@ class Horde_Notification_Class_Notificat
 
     public function testMethodAdddecoratorHasPostconditionThatTheGivenDecoratorWasAddedToTheHandlerAndReceivesNotifyCalls()
     {
-        $decorator = $this->getMock('Horde_Notification_Handler_Decorator_Base');
+        $decorator = $this->getMockBuilder('Horde_Notification_Handler_Decorator_Base')->getMock();
         $decorator->expects($this->once())
             ->method('notify');
         $this->handler->attach('audio');
Index: php-horde-notification/Horde_Notification-2.0.4/test/Horde/Notification/Class/Notification/ListenerTest.php
===================================================================
--- php-horde-notification.orig/Horde_Notification-2.0.4/test/Horde/Notification/Class/Notification/ListenerTest.php
+++ php-horde-notification/Horde_Notification-2.0.4/test/Horde/Notification/Class/Notification/ListenerTest.php
@@ -25,7 +25,7 @@
  */
 class Horde_Notification_Class_Notification_ListenerTest extends Horde_Test_Case
 {
-    public function setUp()
+    public function setUp(): void
     {
         if (!class_exists('PEAR_Error')) {
             $this->markTestSkipped('The PEAR_Error class is not available!');
Index: php-horde-notification/Horde_Notification-2.0.4/test/Horde/Notification/Class/NotificationTest.php
===================================================================
--- php-horde-notification.orig/Horde_Notification-2.0.4/test/Horde/Notification/Class/NotificationTest.php
+++ php-horde-notification/Horde_Notification-2.0.4/test/Horde/Notification/Class/NotificationTest.php
@@ -26,7 +26,7 @@
 
 class Horde_Notification_Class_NotificationTest extends Horde_Test_Case
 {
-    public function tearDown()
+    public function tearDown(): void
     {
         unset($_SESSION);
     }
Index: php-horde-notification/Horde_Notification-2.0.4/test/Horde/Notification/Class/Notification/Listener/StatusTest.php
===================================================================
--- php-horde-notification.orig/Horde_Notification-2.0.4/test/Horde/Notification/Class/Notification/Listener/StatusTest.php
+++ php-horde-notification/Horde_Notification-2.0.4/test/Horde/Notification/Class/Notification/Listener/StatusTest.php
@@ -39,6 +39,7 @@ class Horde_Notification_Class_Notificat
 
     public function testMethodNotifyHasNoOutputIfTheMessageStackIsEmpty()
     {
+        $this->expectNotToPerformAssertions();
         $listener = new Horde_Notification_Listener_Status();
         $messages = array();
         $listener->notify($messages);