Previously this relied on getting all known classes/functions/etc when it was loaded, and then again after the PHP module being tested was loaded. This approach no longer works now we've stopped loading modules using dl(), so use ReflectionExtension instead to get information about a specific extension. This is likely also faster than wading through lists including everything predefined by PHP.
21 lines
643 B
PHP
21 lines
643 B
PHP
<?php
|
|
|
|
require "tests.php";
|
|
|
|
// Check functions.
|
|
check::functions(array('new_intArray','delete_intArray','intArray_getitem','intArray_setitem','new_ABArray','delete_ABArray','ABArray_getitem','ABArray_setitem','sum_Array'));
|
|
|
|
// Check classes.
|
|
// NB An "li_carrays_cpp" class is created as a mock namespace.
|
|
check::classes(array('li_carrays_cpp','doubleArray','AB','XY','XYArray','shortArray'));
|
|
|
|
// Check global variables.
|
|
check::globals(array('globalXYArray','globalABArray'));
|
|
|
|
$d = new doubleArray(10);
|
|
|
|
$d->setitem(0, 7);
|
|
$d->setitem(5, $d->getitem(0) + 3);
|
|
check::equal($d->getitem(0) + $d->getitem(5), 17., "7+10==17");
|
|
|
|
check::done();
|