I am trying to use SimpleTest with CodeIgniter, using code supplied by maroonbytes. I am using LAMP and NetBeans 6.9.
The test.php page loads up in my browser. I have a stub test in place and it shows in the drop-down selections. When I try to run it, I get 2 PHP errors:
Message: include_once(/var/www/sparts3/main/tests/basic_test_v.php): failed to open stream: No such file or directory
Message: include_once(): Failed opening '/var/www/sparts3/main/tests/basic_test_v.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear')
The path is wrong -- basic_test_v.php is in a subfolder /tests/views.
The debugger points to this in test.php:
function add_test($file, &$test)
For some reason NetBeans does not expose the value of $file at this point. Does this mean it's empty?
I've already jimmied a line of code because it gets me past a Code 404 Page Not Found. it seemed the debugger GET was causing the validator to fail. So I added a criteria, in my ignorant way (I'm sure it should be a handled exception or something):
if ($this->uri->uri_string == '' || $this->uri->uri_string == 'XDEBUG_SESSION_START')
{ ... }
How can I solve this? BTW, this is attempted to solve my other post, which I will update; seemed best to make this a discrete question.
UPDATE 1: I've been using the Web Developer add-in (Firefox) to experiment with the POST entries. I believe these are being mishandled in the code. It still appears NetBeans is balking on showing some string variables while debugging; this is frustrating.
UPDATE 2: It seems to me that valid code processing stops at the same point NetBeans stops displaying variables. I am stepping through test.php. I am partway through a function, add_test($file, &$test). This functions opens with an if statement; that finishes well, and I can see the variables. Then a new if statement:
if (file_exists($implementation))
{
require_once ($implementation); ...
As soon as I'm on that line, 2 things happen:
- The Variables display in NetBeans goes blank except for SuperGlobals
- The code behaves as if $implementation is an empty variable
I added a statement just above these lines:
$implementation = 'http://var/www/sparts3/main/tests/views/basic_test_view.php';
This doesn't change anything. The browser output is the same whether I'm using NetBeans/Xdebug or not.
So it's starting to look like a PHP processing glitch. Do those exist? I may try uploading and trying from host service -- for diagnostic clues only, and cheerlessly, because CI without the ability to debug is of no interest to me.
UPDATE 3: I tried everything out on a WAMP PC. Same browser results (plus some "deprecated" errors, something to do with PHP 4 vs. 5). I think I can debug on that PC (if Xdebug is functioning), but there seems little point.