-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathphpunit_php81.patch
166 lines (164 loc) · 5.17 KB
/
phpunit_php81.patch
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
diff --git a/src/Framework/Constraint.php b/src/Framework/Constraint.php
index e2db66f..c2e1406 100644
--- a/src/Framework/Constraint.php
+++ b/src/Framework/Constraint.php
@@ -81,6 +81,7 @@ protected function matches($other)
*
* @since Method available since Release 3.4.0
*/
+ #[\ReturnTypeWillChange]
public function count()
{
return 1;
diff --git a/src/Framework/TestCase.php b/src/Framework/TestCase.php
index b4c7d3a..ffdf000 100644
--- a/src/Framework/TestCase.php
+++ b/src/Framework/TestCase.php
@@ -304,6 +304,7 @@ public function toString()
*
* @return int
*/
+ #[\ReturnTypeWillChange]
public function count()
{
return 1;
diff --git a/src/Framework/TestResult.php b/src/Framework/TestResult.php
index 8da7c35..ac94c98 100644
--- a/src/Framework/TestResult.php
+++ b/src/Framework/TestResult.php
@@ -738,6 +738,7 @@ public function run(PHPUnit_Framework_Test $test)
*
* @return int
*/
+ #[\ReturnTypeWillChange]
public function count()
{
return $this->runTests;
diff --git a/src/Framework/TestSuite.php b/src/Framework/TestSuite.php
index 2a01e2c..d151e1e 100644
--- a/src/Framework/TestSuite.php
+++ b/src/Framework/TestSuite.php
@@ -392,6 +392,7 @@ public function addTestFiles($filenames)
*
* @return int
*/
+ #[\ReturnTypeWillChange]
public function count($preferCache = false)
{
if ($preferCache && $this->cachedNumTests != null) {
@@ -968,6 +969,7 @@ public function setBackupStaticAttributes($backupStaticAttributes)
*
* @since Method available since Release 3.1.0
*/
+ #[\ReturnTypeWillChange]
public function getIterator()
{
$iterator = new PHPUnit_Util_TestSuiteIterator($this);
diff --git a/src/Runner/Filter/Group.php b/src/Runner/Filter/Group.php
index 9257b3b..2bfc710 100644
--- a/src/Runner/Filter/Group.php
+++ b/src/Runner/Filter/Group.php
@@ -44,6 +44,7 @@ function ($test) {
/**
* @return bool
*/
+ #[\ReturnTypeWillChange]
public function accept()
{
$test = $this->getInnerIterator()->current();
diff --git a/src/Util/TestSuiteIterator.php b/src/Util/TestSuiteIterator.php
index edf7b95..331c241 100644
--- a/src/Util/TestSuiteIterator.php
+++ b/src/Util/TestSuiteIterator.php
@@ -36,6 +36,7 @@ public function __construct(PHPUnit_Framework_TestSuite $testSuite)
/**
* Rewinds the Iterator to the first element.
*/
+ #[\ReturnTypeWillChange]
public function rewind()
{
$this->position = 0;
@@ -46,6 +47,7 @@ public function rewind()
*
* @return bool
*/
+ #[\ReturnTypeWillChange]
public function valid()
{
return $this->position < count($this->tests);
@@ -56,6 +58,7 @@ public function valid()
*
* @return int
*/
+ #[\ReturnTypeWillChange]
public function key()
{
return $this->position;
@@ -66,6 +69,7 @@ public function key()
*
* @return PHPUnit_Framework_Test
*/
+ #[\ReturnTypeWillChange]
public function current()
{
return $this->valid() ? $this->tests[$this->position] : null;
@@ -74,6 +78,7 @@ public function current()
/**
* Moves forward to next element.
*/
+ #[\ReturnTypeWillChange]
public function next()
{
$this->position++;
@@ -84,6 +89,7 @@ public function next()
*
* @return PHPUnit_Util_TestSuiteIterator
*/
+ #[\ReturnTypeWillChange]
public function getChildren()
{
return new self(
@@ -96,6 +102,7 @@ public function getChildren()
*
* @return bool
*/
+ #[\ReturnTypeWillChange]
public function hasChildren()
{
return $this->tests[$this->position] instanceof PHPUnit_Framework_TestSuite;
diff --git a/src/Util/Getopt.php b/src/Util/Getopt.php
index 96931a3..32f227a 100644
--- a/src/Util/Getopt.php
+++ b/src/Util/Getopt.php
@@ -150,7 +150,7 @@ protected static function parseLongOption($arg, $long_options, &$opts, &$args)
if (substr($long_opt, -1) == '=') {
if (substr($long_opt, -2) != '==') {
- if (!strlen($opt_arg)) {
+ if (!strlen(isset($opt_arg) ? $opt_arg : '')) {
$opt_arg = current($args);
next($args);
if ($opt_arg === false) {
diff --git a/src/Util/Printer.php b/src/Util/Printer.php
index a22f862..aaa919f 100644
--- a/src/Util/Printer.php
+++ b/src/Util/Printer.php
@@ -121,7 +121,7 @@ public function incrementalFlush()
public function write($buffer)
{
if ($this->out) {
- fwrite($this->out, $buffer);
+ fwrite($this->out, isset($buffer) ? $buffer : '');
if ($this->autoFlush) {
$this->incrementalFlush();
diff --git a/src/Runner/Filter/Test.php b/src/Runner/Filter/Test.php
index bae4a5c..fb3f8c9 100644
--- a/src/Runner/Filter/Test.php
+++ b/src/Runner/Filter/Test.php
@@ -88,6 +88,7 @@ protected function setFilter($filter)
/**
* @return bool
*/
+ #[\ReturnTypeWillChange]
public function accept()
{
$test = $this->getInnerIterator()->current();