Rework tests.php

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.
This commit is contained in:
Olly Betts 2021-05-04 15:26:45 +12:00
commit 0d028d8942
8 changed files with 36 additions and 85 deletions

View file

@ -3,14 +3,14 @@
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::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'));
check::globals(array('globalXYArray','globalABArray'));
$d = new doubleArray(10);