php-src/ext/dom/tests/DOMDocument_createAttribute_error.phpt
Gabriel Caruso ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00

27 lines
466 B
PHP

--TEST--
Test DOMDocument::createAttribute() for expected expection thrown when wrong parameter passed
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--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';
}
?>
--EXPECT--
PASS