1--TEST--
2Test error cases when creating a socket
3--CREDITS--
4Russell Flynn <russ@redpill-linpro.com>
5#PHPTestFest2009 Norway 2009-06-09 \o/
6--INI--
7error_reporting=E_ALL
8display_errors=1
9--SKIPIF--
10<?php
11  if (!extension_loaded('sockets')) {
12  echo 'skip sockets extension not available.';
13}
14?>
15--FILE--
16<?php
17  // Test with no arguments
18  $server = socket_create();
19
20  // Test with less arguments than required
21  $server = socket_create(SOCK_STREAM, getprotobyname('tcp'));
22
23  // Test with non integer parameters
24  $server = socket_create(array(), 1, 1);
25
26?>
27--EXPECTF--
28Warning: socket_create() expects exactly 3 parameters, 0 given in %s on line %d
29
30Warning: socket_create() expects exactly 3 parameters, 2 given in %s on line %d
31
32Warning: socket_create() expects parameter 1 to be integer, array given in %s on line %d
33
34