Question

I am trying to get the code coverage in NetBeans working, but I am stuck on error that the PHPUnit gives me:

"/usr/bin/php" "/usr/bin/phpunit" "--colors" "--log-junit" "/tmp/nb-phpunit-log.xml" "--bootstrap" "/home/btekielski/Dokumenty/Projects/PlanQ/src/tests/bootstrap.php" "--coverage-clover" "/tmp/nb-phpunit-coverage.xml" "/usr/local/netbeans-7.4/php/phpunit/NetBeansSuite.php" "--run=/home/btekielski/Dokumenty/Projects/PlanQ/src/tests"
PHPUnit 3.7.28 by Sebastian Bergmann.

PHP Fatal error:  Uncaught exception 'PHPUnit_Framework_Error_Warning' with message 'include_once(Symfony/Component/Yaml/Yaml.class.php): failed to open stream: No such file or directory' in /home/user/Projects/src/tests/bootstrap.php:65
Stack trace:

I have a custom auto loader function in bootstrap which looks like following:

function loadClass($class) {
    if (empty($class) || $class == 'parent') {
        return;
    }
    $throw = false;

    if (strpos($class, 'PHPExcel') !== false) {
        return;
    }

    $file = str_replace('\\', DIRECTORY_SEPARATOR, $class) . CLASS_FILE_EXTENSION;
    include_once($file);

    if (!class_exists($class, false) && !interface_exists($class, false)) {
        if ($throw) {
            trigger_error(
                    "Class file '" . $file . "' do not provide class '" .
                    $class . "'", E_USER_ERROR
            );
        }

        return;
    }
}

I'd appreciate any hints...

Was it helpful?

Solution

The include_once() you called has a relative path to Symphony, indicating it is below the current directory. Is this the case, or are you in the wrong directory for this relative path to work?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top