1--TEST--
2stream_context_set_option() function - basic test for stream_context_set_option()
3--CREDITS--
4Jean-Marc Fontaine <jean-marc.fontaine@alterway.fr>
5# Alter Way Contribution Day 2011
6--FILE--
7<?php
8$context = stream_context_create();
9
10// Single option
11var_dump(stream_context_set_option($context, 'http', 'method', 'POST'));
12
13// Array of options
14$options = array(
15    'http' => array(
16        'protocol_version' => 1.1,
17        'user_agent'       => 'PHPT Agent',
18    ),
19);
20var_dump(stream_context_set_option($context, $options));
21
22var_dump(stream_context_get_options($context));
23?>
24--EXPECT--
25bool(true)
26bool(true)
27array(1) {
28  ["http"]=>
29  array(3) {
30    ["method"]=>
31    string(4) "POST"
32    ["protocol_version"]=>
33    float(1.1)
34    ["user_agent"]=>
35    string(10) "PHPT Agent"
36  }
37}
38