Annotation of embedaddon/php/ext/dom/tests/DOMDocument_createAttribute_error.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test DOMDocument::createAttribute() for expected expection thrown when wrong parameter passed
3: --SKIPIF--
4: <?php require_once('skipif.inc'); ?>
5: --FILE--
6: <?php
7: $dom = new DOMDocument();
8:
9: try {
10: $attr = $dom->createAttribute(0);
11: }
12: catch(DOMException $e) {
13: $code = $e->getCode();
14: if(DOM_INVALID_CHARACTER_ERR === $code) {
15: echo "PASS";
16: }
17: else {
18: echo 'Wrong exception code';
19: }
20: }
21: catch(Exception $e) {
22: echo 'Wrong exception thrown';
23: }
24:
25: ?>
26: --EXPECTF--
27: PASS
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>