The regex pattern to upper-case things containing an `i` had incorrect
escaping (`\\(`...`\\)` instead of `(`...`)`) so `import` didn't get
renamed.
This wasn't detected because there were no `_runme` files for this
testcase, so add rename_camel_runme.php which uses reflection to check
the wrapped PHP classes, functions and constants are all named as
expected.
Also expand coverage of converting to underscore case and add coverage
for converting to lower-camel-case.
Related to #1041.
These functions are added in a number of testcases but for all
languages not just Python. It's tedious having to update the
PHP expected function lists for them, so let's just filter them
out.
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.
With modern PHP it only works with the CLI version of PHP, so it's
better to direct users to load the extension via "extension=" in
php.ini.
Suggested by ferdynator in #1529.
Previously we called set_error_handler() in tests.php to do this, but
that only sets it for the test-suite. Now we set it in on the PHP
command line, which works for both.
Stop filtering /^new_/ - we no longer generate these for classes, so
only the li_carrays and li_carrays_cpp testcases generate new_* flat
functions, and it's helpful to check those are generated.
Stop filtering /_(alter|get)_newobject$/' - we no longer generate
these, as they weren't used or documented.
This was trying to return a reference, but that doesn't actually work
for all the things it's used for, and none of the uses require the
return value to be a reference.