mirror of
https://github.com/php/php-src.git
synced 2026-04-23 16:08:35 +02:00
ed6e289c31
Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
27 lines
734 B
PHP
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
|