samedi 25 avril 2015

My requires doesn't work with PHPUnit

I want to test my library but when I want to require its file in test class and run it with phpunit filename.php I get error like this:

Warning: require_once(>>>path to file<<<): failed to open stream: No such
file or directory in >>>file with test<<< on line 3

Fatal error: require_once(): Failed opening required >>>path to file<<<
(include_path='.;C:\xampp\php\PEAR') in >>>file with test<<< on line 3

As you can see I use xampp.

Of course when I don't run it with phpunit but through browser - all imports works great (I always use $_SERVER['DOCUMENT_ROOT'] to get absolute path).

*without my require simple test like assertTrue(true) works without any problems.

Aucun commentaire:

Enregistrer un commentaire