1

I've developed a simple test class usign PHPUnit on my PhpStorm IDE.

  • PHP version: 5.4.25
  • PHPUnit version 4.2.1
  • MAMP 3.0.2
  • PHPStorm 7.1

This is the configuration of my IDE:

enter image description here

enter image description here

And this is my Test class:

namespace test\controllers;


class AuthTest extends \PHPUnit_Framework_TestCase {

    protected function setUp() {
        parent::setUp(); // TODO: Change the autogenerated stub
        echo "start";
    }

    protected function tearDown()
    {
        parent::tearDown(); // TODO: Change the autogenerated stub
        echo "end";
    }


    public function testProva() {
        $tot = 5;

        $this->assertEquals($tot, 5);
    }
}

EDIT:

This is the configuration of my test run:

enter image description here

When I Run the class (class name: AuthTest, file name: AuthTest.php) I obtain the following error: Process finished with exit code 255 But when I run the same class by command line phpunit path/test/folder/ it works fine.

What is wrong?

2
  • 1
    "PHPUnit version 5.2.1" -- Welcome in 21014 time traveller. 4.2 is the latest version of PHPUnit ATM. In any case: the info you have provided is not enough: 1) What PhpStorm version do you use? 2) What command PhpStorm uses to execute PHPUnit tests (show screenshot -- make sure that it shows FULL command -- use line warapping option for that); 3) File name where this test case is located (just file name). Commented Aug 20, 2014 at 8:55
  • @LazyOne I've updated my question, I hope I've given you all necessary information. Where can I find what command PhpStorm uses to execute PHPUnit test? I added a screenshot with my test run configuration, is what you needed? Commented Aug 20, 2014 at 9:36

1 Answer 1

2

PhpStorm v7.x does not support PhpUnit 4.x (only 3.6 ..or maybe 3.7 MAX).

PhpStorm uses special helper/wrapper script for integration purposes (so that IDE receives test progress/results in understandable format (much-much easier that parsing PHPUnit native output, which does not provide much details needed for IDE)). This wrapper in PhpStorm v7.x does not support PHPUnit v4.x.

For PhpUnit 4.x support you should try v8 EAP build (or wait for v8 official release -- 1-2 months from now, approximately).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.