Skip to content

Commit 01aa4cb

Browse files
committed
Fix tests
1 parent 9004305 commit 01aa4cb

File tree

224 files changed

+838
-769
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

224 files changed

+838
-769
lines changed

Zend/tests/bug21478.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Bug #21478 (Zend/zend_alloc.c :: shutdown_memory_manager produces segfault)
33
--FILE--
44
<?php
55
class debugfilter extends php_user_filter {
6-
function filter($in, $out, &$consumed, $closing) {
6+
function filter($in, $out, &$consumed, $closing): int {
77
while ($bucket = stream_bucket_make_writeable($in)) {
88
$bucket->data = strtoupper($bucket->data);
99
stream_bucket_append($out, $bucket);

Zend/tests/bug78406.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if (!class_exists(SampleFilter::class)) {
1010
{
1111
private $data = '';
1212

13-
public function filter($in, $out, &$consumed, $closing)
13+
public function filter($in, $out, &$consumed, $closing): int
1414
{
1515
while ($bucket = stream_bucket_make_writeable($in))
1616
{

Zend/tests/foreach_004.phpt

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,26 @@ class IT extends ArrayIterator {
1616
}
1717
}
1818

19-
function rewind() {$this->trap(__FUNCTION__); return parent::rewind();}
20-
function valid() {$this->trap(__FUNCTION__); return parent::valid();}
21-
function key() {$this->trap(__FUNCTION__); return parent::key();}
22-
function next() {$this->trap(__FUNCTION__); return parent::next();}
19+
function rewind(): void
20+
{
21+
$this->trap(__FUNCTION__);
22+
parent::rewind();
23+
}
24+
25+
function valid(): bool {
26+
$this->trap(__FUNCTION__);
27+
return parent::valid();
28+
}
29+
30+
function key(): mixed {
31+
$this->trap(__FUNCTION__);
32+
return parent::key();
33+
}
34+
35+
function next(): void {
36+
$this->trap(__FUNCTION__);
37+
parent::next();
38+
}
2339
}
2440

2541
foreach(['rewind', 'valid', 'key', 'next'] as $trap) {

Zend/tests/ns_054.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
namespace test\ns1;
66

77
class Foo implements \SplObserver {
8-
function update(\SplSubject $x) {
8+
function update(\SplSubject $x): void {
99
echo "ok\n";
1010
}
1111
}
1212

1313
class Bar implements \SplSubject {
14-
function attach(\SplObserver $x) {
14+
function attach(\SplObserver $x): void {
1515
echo "ok\n";
1616
}
17-
function notify() {
17+
function notify(): void {
1818
}
19-
function detach(\SplObserver $x) {
19+
function detach(\SplObserver $x): void {
2020
}
2121
}
2222
$foo = new Foo();

Zend/tests/ns_056.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ namespace test\ns1;
66
use \SplObserver;
77

88
class Foo implements SplObserver {
9-
function update(\SplSubject $x) {
9+
function update(\SplSubject $x): void {
1010
echo "ok\n";
1111
}
1212
}
1313

1414
class Bar implements \SplSubject {
15-
function attach(SplObserver $x) {
15+
function attach(SplObserver $x): void {
1616
echo "ok\n";
1717
}
18-
function notify() {
18+
function notify(): void {
1919
}
20-
function detach(SplObserver $x) {
20+
function detach(SplObserver $x): void {
2121
}
2222
}
2323
$foo = new Foo();

Zend/tests/type_declarations/variance/internal_parent/incompatible_return_type.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ class MyDateTimeZone extends DateTimeZone
1313
var_dump(MyDateTimeZone::listIdentifiers());
1414
?>
1515
--EXPECTF--
16-
Strict Standards: Declaration of MyDateTimeZone::listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null): string should be compatible with DateTimeZone::listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null): array in %s on line %d
16+
Deprecated: Declaration of MyDateTimeZone::listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null): string should be compatible with DateTimeZone::listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null): array in %s on line %d
1717
string(0) ""

Zend/tests/type_declarations/variance/internal_parent/missing_return_type.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ class MyDateTimeZone extends DateTimeZone
1010
}
1111
?>
1212
--EXPECTF--
13-
Strict Standards: Declaration of MyDateTimeZone::listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null) should be compatible with DateTimeZone::listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null): array in %s on line %d
13+
Deprecated: Declaration of MyDateTimeZone::listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null) should be compatible with DateTimeZone::listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null): array in %s on line %d

Zend/tests/type_declarations/variance/optional_return_type/incompatible_return_type.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ $bar = new Bar();
2323
var_dump($bar->x());
2424
?>
2525
--EXPECTF--
26-
Strict Standards: Declaration of Bar::x(): array should be compatible with Foo::x(): string|false in %s on line %d
26+
Deprecated: Declaration of Bar::x(): array should be compatible with Foo::x(): string|false in %s on line %d
2727
array(0) {
2828
}

Zend/tests/type_declarations/variance/optional_return_type/incompatible_return_type2.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ $bar = new Bar();
2323
var_dump($bar->x());
2424
?>
2525
--EXPECTF--
26-
Strict Standards: Declaration of Bar::x() should be compatible with Foo::x(): string|false in %s on line %d
26+
Deprecated: Declaration of Bar::x() should be compatible with Foo::x(): string|false in %s on line %d
2727
array(0) {
2828
}

Zend/tests/type_declarations/variance/optional_return_type/incompatible_return_type3.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ class Baz extends Bar
2929

3030
?>
3131
--EXPECTF--
32-
Strict Standards: Declaration of Bar::x(): array should be compatible with Foo::x(): string|false in %s on line %d
32+
Deprecated: Declaration of Bar::x(): array should be compatible with Foo::x(): string|false in %s on line %d
3333

3434
Fatal error: Declaration of Baz::x() must be compatible with Bar::x(): array in %s on line %d

0 commit comments

Comments
 (0)