xref: /PHP-8.3/ext/standard/tests/filters/001.phpt (revision 25f1c405)
1--TEST--
2stream_filter_register() and invalid arguments
3--FILE--
4<?php
5try {
6    stream_filter_register("", "");
7} catch (ValueError $exception) {
8    echo $exception->getMessage() . "\n";
9}
10
11try {
12    stream_filter_register("test", "");
13} catch (ValueError $exception) {
14    echo $exception->getMessage() . "\n";
15}
16
17try {
18    stream_filter_register("", "test");
19} catch (ValueError $exception) {
20    echo $exception->getMessage() . "\n";
21}
22
23var_dump(stream_filter_register("------", "nonexistentclass"));
24
25echo "Done\n";
26?>
27--EXPECT--
28stream_filter_register(): Argument #1 ($filter_name) must be a non-empty string
29stream_filter_register(): Argument #2 ($class) must be a non-empty string
30stream_filter_register(): Argument #1 ($filter_name) must be a non-empty string
31bool(true)
32Done
33