php-src/ext/dom/tests/DOMNamedNodeMap_count.phpt
Max Semenik bd9f4fa676 Migrate skip checks to --EXTENSIONS--, p2
For rationale, see https://github.com/php/php-src/pull/6787

Make extension checks lowercase, add a special case for opcache
that has internal name not matching .so filename.

Extensions migrated in part 2:
* dom
* exif
* fileinfo
* ffi
2021-04-01 12:08:24 +01:00

28 lines
582 B
PHP

--TEST--
Test count nodes in DOMNamedNodeMap
--CREDITS--
Andreas Treichel <gmblar+github@gmail.com>
--EXTENSIONS--
dom
--FILE--
<?php
$document = new DomDocument();
$root = $document->createElement('root');
$document->appendChild($root);
for($i = 0; $i < 5; $i++) {
$root->setAttribute('attribute-' . $i, 'value-' . $i);
}
for($i = 0; $i < 7; $i++) {
$item = $document->createElement('item');
$root->appendChild($item);
}
var_dump($root->attributes->length);
var_dump($root->attributes->count());
var_dump(count($root->attributes));
?>
--EXPECT--
int(5)
int(5)
int(5)