-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the return type of some stream context related functions true (#…
…12720) Co-authored-by: Niels Dossche <[email protected]>
- Loading branch information
1 parent
c15db22
commit ed6e289
Showing
4 changed files
with
58 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
ext/standard/tests/streams/stream_context_create_error.phpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--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 |