Skip to content

Commit d926c36

Browse files
committed
main: refactor userstream method calling
1 parent 6600d0e commit d926c36

File tree

4 files changed

+412
-409
lines changed

4 files changed

+412
-409
lines changed

Zend/tests/bug41421.phpt

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,19 @@ class wrapper {
99
return true;
1010
}
1111
function stream_eof() {
12-
throw new exception();
12+
throw new Exception('cannot eof');
1313
}
1414
}
1515

1616
stream_wrapper_register("wrap", "wrapper");
1717
$fp = fopen("wrap://...", "r");
18-
feof($fp);
1918

20-
echo "Done\n";
21-
?>
22-
--EXPECTF--
23-
Warning: feof(): wrapper::stream_eof is not implemented! Assuming EOF in %s on line %d
19+
try {
20+
feof($fp);
21+
} catch (Throwable $e) {
22+
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
23+
}
2424

25-
Fatal error: Uncaught Exception in %s:%d
26-
Stack trace:
27-
#0 [internal function]: wrapper->stream_eof()
28-
#1 %s(%d): feof(Resource id #%d)
29-
#2 {main}
30-
thrown in %s on line %d
25+
?>
26+
--EXPECT--
27+
Exception: cannot eof

ext/standard/tests/file/userstreams_005.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,5 @@ ftruncate(): Argument #2 ($size) must be greater than or equal to 0
6565
------ stream_truncate bad return: -------
6666
truncation with new_size=0
6767

68-
Warning: ftruncate(): test_wrapper_bad::stream_truncate did not return a boolean! in %s on line %d
68+
Warning: ftruncate(): test_wrapper_bad::stream_truncate value must be of type bool, string given in %s on line %d
6969
bool(false)

ext/zip/tests/bug53603.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ $a = $zip->extractTo('teststream://test');
2828
var_dump($a);
2929
?>
3030
--EXPECTF--
31-
Warning: ZipArchive::extractTo(teststream://test/foo): Failed to open stream: "TestStream::stream_open" call failed in %s on line %d
31+
Warning: ZipArchive::extractTo(teststream://test/foo): Failed to open stream: "TestStream::stream_open" is not implemented in %s on line %d
3232
bool(false)

0 commit comments

Comments
 (0)