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

« back to all changes in this revision

Viewing changes to ext/xml/tests/xml_set_end_namespace_decl_handler_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_set_end_namespace_decl_handler() 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_set_end_namespace_decl_handler(resource parser, string hdl)
 
12
 * Description: Set up character data handler 
 
13
 * Source code: ext/xml/xml.c
 
14
 * Alias to functions: 
 
15
 */
 
16
 
 
17
echo "*** Testing xml_set_end_namespace_decl_handler() : error conditions ***\n";
 
18
 
 
19
 
 
20
//Test xml_set_end_namespace_decl_handler with one more than the expected number of arguments
 
21
echo "\n-- Testing xml_set_end_namespace_decl_handler() function with more than expected no. of arguments --\n";
 
22
 
 
23
$hdl = 'string_val';
 
24
$extra_arg = 10;
 
25
var_dump( xml_set_end_namespace_decl_handler(null, $hdl, $extra_arg) );
 
26
 
 
27
// Testing xml_set_end_namespace_decl_handler with one less than the expected number of arguments
 
28
echo "\n-- Testing xml_set_end_namespace_decl_handler() function with less than expected no. of arguments --\n";
 
29
 
 
30
var_dump( xml_set_end_namespace_decl_handler(null) );
 
31
 
 
32
echo "Done";
 
33
?>
 
34
--EXPECTF--
 
35
*** Testing xml_set_end_namespace_decl_handler() : error conditions ***
 
36
 
 
37
-- Testing xml_set_end_namespace_decl_handler() function with more than expected no. of arguments --
 
38
 
 
39
Warning: xml_set_end_namespace_decl_handler() expects exactly 2 parameters, 3 given in %s on line %d
 
40
NULL
 
41
 
 
42
-- Testing xml_set_end_namespace_decl_handler() function with less than expected no. of arguments --
 
43
 
 
44
Warning: xml_set_end_namespace_decl_handler() expects exactly 2 parameters, 1 given in %s on line %d
 
45
NULL
 
46
Done
 
47