I am having a problem with my PHP project (using the Kohana 3.2 framework) in PHPStorm 4.0.3. When setting up PHPUnit with the Class or Method scope, it is not able to detect the class from the specified unit testing file if the test class extends from Unittest_Database_Testcase
.
For example, I could not test the below class because the Choose Test Class dialog box displays "Nothing to show".
/**
* Class cannot be chosen.
*/
class A_Test extends Unittest_Database_Testcase {
public function test_something() { /* ... hence this method test cannot be chosen */ }
}
However, if the file extends from Unittest_Testcase
, the class (and subsequently the method) can be detected by PHPStorm and I was able to run the test.
class A_Test extends Unittest_Testcase {
public function test_something() {}
}
I suspect the reason is that PHPStorm is yet to support running database testing individually. Is there a way to get around this?
Note: I have no problems with running the entire test suite, however, I am concerned that the number of tests are growing. It takes roughly half a second to run a single database test (due to the queries involved) hence it will be very time-consuming to run the entire test suite every time I need to verify a newly-written test is working properly.
Unittest_Database_Testcase
, does it take you to class definition? If it does -- can you go further (to parent class of this class and so on)? I've seen the message in the past, for kind of similar situation, and an advice was to make sure that PhpStorm knows about PHPUnit classes (e.g. PHPUnit files added to the project as External Library). – LazyOneAbstract_Class
in the bootstrap file. Probably because it was not included automatically when PHPUnit was pointed to the test file. Thanks! – Arthur Rimbun