Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 962639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:32:23+00:00 2026-05-16T01:32:23+00:00

I am trying to use SimpleTest with CodeIgniter, using code supplied by maroonbytes .

  • 0

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:

  1. The Variables display in NetBeans goes blank
    except for SuperGlobals
  2. 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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T01:32:24+00:00Added an answer on May 16, 2026 at 1:32 am

    Did you renamed basic_test_v.php to basic_test_view.php? the code expects your files to be named and stored right.

    UPDATE 1 (yes im bored)

    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.

    The “right” solution to this issue is:
    set $config['uri_protocol'] = "AUTO"; to $config['uri_protocol'] = "PATH_INFO";
    and $config['enable_query_strings'] = FALSE; to $config['enable_query_strings'] = TRUE;
    in the config.php (read the comment above those settings, they very helpful)

    After a deeper look at test.php i can tell you that your test files should be named like this:

    %name%_%type%_test.php (where %type% is singular)

    to make it more clear here an example:

    we’ve got a controller welcome placed in the file welcome.php
    the test for this controller should be named welcome_controller_test.php and stored under tests/controllers/

    the test.php script tries to load the test file and the tested file automatically.
    But in my opinion it needs to be corrected.

    I’ve changed function get_loader_id and add_test like follows

    function get_loader_id($file, $type) {
       $loader_id = str_replace("_{$type}_test.php", "", basename($file));
       return $loader_id;
    }
    function add_test($file, &$test) {
       $implementation = '';
       if (preg_match('/_controller/', $file)) {
          $controller = get_loader_id($file, 'controller');
          $implementation = APPLICATION . 'controllers/' . $controller . '.php';
       } elseif (preg_match('/_model/', $file)) {
          $model = get_loader_id($file, 'model');
          $implementation = APPLICATION . 'models/' . $model . '_model.php';
       } elseif (preg_match('/_view/', $file)) {
          $view = get_loader_id($file, 'view');
          $implementation = APPLICATION . 'views/' . $view . '.php';
       } elseif (preg_match('/_helper/', $file)) {
          $helper = get_loader_id($file, 'helper');
          $implementation = APPLICATION . 'helpers/' . $helper . '.php';
       } elseif (preg_match('/_library/', $file)) {
          $library = get_loader_id($file, 'library');
          $implementation = APPLICATION . 'libraries/' . $library . '.php';
       }
       if (file_exists($implementation)) {
          require_once ($implementation);
       }
       $test->addFile($file);
    }
    

    if you’re following the filename conventions all should run just fine
    (i’ve tested it on an macbook with zend server ce, xdebug, simpletest and netbeans 6.9)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using simpletest, the php scriptable browser and trying to test submit a
I am trying to use the native PHP function to send a simple test
I'm trying to use the UI-Thread, so I've written a simple test activity. But
i'm trying use facebook API to upload photo in my fan page. I downloaded
I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
I'm trying to use simpletest to compare two numeric strings, one from an array
I am trying to do a simple test in Python using ' unittest ',
I'm trying to use Hudson as a continuous integration system to manage a php
I'm trying to use the simplest possible scenario using a date picker in different
I've been trying to learn how to use simpletest, and I found the simpletest

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.