#203 Problem with SimpleFileLoader and global variables

v1.0 (example)
open
nobody
5
2011-05-06
2011-05-06
Alexander Aberer
No

We use SimpleTest for testing our software components which are mostly based on the Prado PHP framework (http://www.pradoframework.com). This is why some of our tests depend that the Prado framework is included and a global Prado application is started.
Does test files that depend on the Prado application include some code in the header which initializes the framework if required. This however causes a problem with SimpleFileLoader::load() where the test files are included: The contents of $existing_globals is empty after the framework is initialized (Prado is a bit demanding... ;)).
We fixed this problem by patching SimpleFileLoader::load() in the file test_case.php. Our solution was it to define $existing_globals as a member variable. As I see it the change is only minor and it did not break anything else for us.

Discussion

  • Patched file

     
    Attachments