Felix Hall
2010-07-14 08:44:24 UTC
Hi all,
I'm writing a test suite for a legacy system, in which some function
names are not unique.
When I run the suite, containing test cases for both versions of the
function, I get the following error:
RuntimeException: Fatal error: Cannot redeclare my_function()
(previously declared in /path/to/code/web/functions/a_file.php:183) in
/path/to/code/web/functions/another_file.php on line 77
No surprises there, but I thought that the --process-isolation or
@runInSeparateProcess would solve this, but apparently it doesn't. I'm
currently "solving" the problem by renaming the function not under test
to something else, making sure there's always just one function declared
with the name.
Sadly I'm not allowed to refactor the code, otherwise I'd solve it that
way ;)
I wonder if there's another way of doing this, other than renaming the
functions all the time?
Additionally, I get another error when I run the whole suite
process-isolated:
RuntimeException: ALERT - canary mismatch on efree() - heap overflow
detected (attacker 'REMOTE_ADDR not set', file 'unknown')
I've figured out that this has something to do with the Suhosin-patch
defending me against overflows and remote code execution, but I wonder
why this appears when I run the suite process-isolated and not
single-threaded?
Thankful for any help!
Regards
Felix Hall
I'm writing a test suite for a legacy system, in which some function
names are not unique.
When I run the suite, containing test cases for both versions of the
function, I get the following error:
RuntimeException: Fatal error: Cannot redeclare my_function()
(previously declared in /path/to/code/web/functions/a_file.php:183) in
/path/to/code/web/functions/another_file.php on line 77
No surprises there, but I thought that the --process-isolation or
@runInSeparateProcess would solve this, but apparently it doesn't. I'm
currently "solving" the problem by renaming the function not under test
to something else, making sure there's always just one function declared
with the name.
Sadly I'm not allowed to refactor the code, otherwise I'd solve it that
way ;)
I wonder if there's another way of doing this, other than renaming the
functions all the time?
Additionally, I get another error when I run the whole suite
process-isolated:
RuntimeException: ALERT - canary mismatch on efree() - heap overflow
detected (attacker 'REMOTE_ADDR not set', file 'unknown')
I've figured out that this has something to do with the Suhosin-patch
defending me against overflows and remote code execution, but I wonder
why this appears when I run the suite process-isolated and not
single-threaded?
Thankful for any help!
Regards
Felix Hall