~ubuntu-branches/ubuntu/quantal/php5/quantal

« back to all changes in this revision

Viewing changes to ext/xml/tests/xml_parser_set_option_error.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Sean Finney
  • Date: 2009-07-01 09:12:10 UTC
  • mto: (0.9.1) (1.1.17 upstream)
  • mto: This revision was merged to the branch mainline in revision 58.
  • Revision ID: james.westby@ubuntu.com-20090701091210-go0h6506p62on17r
Tags: upstream-5.3.0
ImportĀ upstreamĀ versionĀ 5.3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
Test xml_parser_set_option() function : error conditions 
 
3
--SKIPIF--
 
4
<?php 
 
5
if (!extension_loaded("xml")) {
 
6
        print "skip - XML extension not loaded"; 
 
7
}        
 
8
?>
 
9
--FILE--
 
10
<?php
 
11
/* Prototype  : proto int xml_parser_set_option(resource parser, int option, mixed value)
 
12
 * Description: Set options in an XML parser 
 
13
 * Source code: ext/xml/xml.c
 
14
 * Alias to functions: 
 
15
 */
 
16
 
 
17
echo "*** Testing xml_parser_set_option() : error conditions ***\n";
 
18
 
 
19
 
 
20
//Test xml_parser_set_option with one more than the expected number of arguments
 
21
echo "\n-- Testing xml_parser_set_option() function with more than expected no. of arguments --\n";
 
22
 
 
23
$option = 10;
 
24
$value = 1;
 
25
$extra_arg = 10;
 
26
var_dump( xml_parser_set_option(null, $option, $value, $extra_arg) );
 
27
 
 
28
// Testing xml_parser_set_option with one less than the expected number of arguments
 
29
echo "\n-- Testing xml_parser_set_option() function with less than expected no. of arguments --\n";
 
30
 
 
31
$option = 10;
 
32
var_dump( xml_parser_set_option(null, $option) );
 
33
 
 
34
echo "Done";
 
35
?>
 
36
--EXPECTF--
 
37
*** Testing xml_parser_set_option() : error conditions ***
 
38
 
 
39
-- Testing xml_parser_set_option() function with more than expected no. of arguments --
 
40
 
 
41
Warning: xml_parser_set_option() expects exactly 3 parameters, 4 given in %s on line %d
 
42
NULL
 
43
 
 
44
-- Testing xml_parser_set_option() function with less than expected no. of arguments --
 
45
 
 
46
Warning: xml_parser_set_option() expects exactly 3 parameters, 2 given in %s on line %d
 
47
NULL
 
48
Done
 
49