1--TEST-- 2Test 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 9try { 10 $attr = $dom->createAttribute(0); 11} 12catch(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} 21catch(Exception $e) { 22 echo 'Wrong exception thrown'; 23} 24 25?> 26--EXPECT-- 27PASS 28