mirror of
https://github.com/php/php-src.git
synced 2024-10-20 16:02:44 +00:00
26 lines
419 B
PHP
26 lines
419 B
PHP
--TEST--
|
|
Test DOMDocument::createAttribute() for expected expection thrown when wrong parameter passed
|
|
--FILE--
|
|
<?php
|
|
$dom = new DOMDocument();
|
|
|
|
try {
|
|
$attr = $dom->createAttribute(0);
|
|
}
|
|
catch(DOMException $e) {
|
|
$code = $e->getCode();
|
|
if(DOM_INVALID_CHARACTER_ERR === $code) {
|
|
echo "PASS";
|
|
}
|
|
else {
|
|
echo 'Wrong exception code';
|
|
}
|
|
}
|
|
catch(Exception $e) {
|
|
echo 'Wrong exception thrown';
|
|
}
|
|
|
|
?>
|
|
--EXPECTF--
|
|
PASS
|