Can't addFile() in SimpleTest Test Suite

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rob Wilkerson

    Can't addFile() in SimpleTest Test Suite

    Hey guys -

    I have a test suite that's working when I include a test case via its
    absolute path. For portability, I'd rather include it just using its
    name, but it's failing with a "Failed to Open" error and I can't
    figure out why. Hopefully someone more familiar with SimpleTest can
    point me in the right direction (or point out my stupidity, as the
    case may be).

    Here are the highlights of my config:

    - SimpleTest is installed in a support directory (~/projects/support/
    simpletest) so that the framework can be used for multiple apps.

    - The application is installed in ~/projects/work/myapp and its tests
    are ~/projects/work/myapp/tests

    - ~/projects/work/myapp/tests contains both all_tests.php and
    my_test_case.ph p

    - My include_path includes ~/projects/support/simpletest and "."

    - all_tests.php looks like this:

    <?php
    require_once ( 'autorun.php' );

    class AllTests extends TestSuite {
    public function AllTests() {
    $this->TestSuite ( 'All tests' );
    $this->addFile( 'my_test_case.p hp' );
    }
    }
    ?>

    The error:

    Warning: SimpleFileLoade r::include_once (my_test_case.p hp)
    [function.Simple FileLoader-include-once]: failed to open stream: No
    such file or directory in /home/myusername/projects/support/simpletest/
    test_case.php on line 391

    Warning: SimpleFileLoade r::include_once () [function.includ e]: Failed
    opening 'my_test_case.p hp' for inclusion (include_path=' .:/usr/share/
    php:/home/myusername/projects/work/shared-services/classes:/home/
    myusername/projects/support/simpletest') in /home/myusername/projects/
    support/simpletest/test_case.php on line 391

    Warning: file_get_conten ts(my_test_case .php) [function.file-get-
    contents]: failed to open stream: No such file or directory in /home/
    myusername/projects/support/simpletest/test_case.php on line 428

    Any thoughts would be much appreciated.

    Thanks.

    Rob
Working...