PHPUnit from Composer: Require doesn't works

Hi Community

Since hours i'm searching for a solution for this problem, but I have no clue what's wrong.
I've added PHPUnit from the composer. Normal tests without any external classes are working perfectly fine.
As soon i include a needed class, the hole test doesn't work anymore.

Here the example:



class GetAddressesSingletonTest extends PHPUnit_Framework_TestCase {
    protected $billingNr  = null;
    protected $customerNr = null;

    protected function setUp(){
        $this->billingNr = "";
        $this->customerNr = "";

    public function testSomething(){

This test case works fine.
If I uncomment the require_once statement, I get an exite code 255.

The folder structure is like this:


Hint: If I put the exactly same require_once in to test.php (NOT a PHPUnit test!) it also works fine..

No Idea guys... Hope somebody has an idea..


Not it's gettint weird... When I call the test from the Terminal IT WORKS?? :)


1 comment
Comment actions Permalink

Hi there,

Try full absolute path instead of relative -- quite possible PHP fails to load that file for some reason (when running from IDE .. since it uses a wrapper script for integration purposes). Something among these lines:

require_once dirname(__DIR__) . '/classes/class.GetAddressesSingleton.php';

In any case: you can put breakpoint on that line and debug it -- you may be able to see what is going on there (and do not forget to check PHP's error log)


Please sign in to leave a comment.