1
0
mirror of https://github.com/php/php-src.git synced 2026-04-23 16:08:35 +02:00
Files
archived-php-src/ext/standard/tests/streams/stream_context_create_error.phpt

27 lines
734 B
PHP

--TEST--
Test the error cases of stream_context_create()
--FILE--
<?php
try {
stream_context_create(['ssl' => "abc"]);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
}
try {
stream_context_create(['ssl' => ['verify_peer'=> false]], ["options" => ['ssl' => "abc"]]);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
}
try {
stream_context_create(['ssl' => ['verify_peer'=> false]], ["options" => false]);
} catch (TypeError $exception) {
echo $exception->getMessage() . "\n";
}
?>
--EXPECT--
Options should have the form ["wrappername"]["optionname"] = $value
Options should have the form ["wrappername"]["optionname"] = $value
Invalid stream/context parameter