我一直在尝试使用CodeIgniter让PHPUnit在PHPStorm中运行。 但是,我一直遇到以下错误消息:
Process finished with exit code 255
当我检查事件日志时,它会说明以下内容:
Empty test suite
我认为这是因为PHPStorm无法找到任何测试,但如何?我似乎无法解决这个问题。
这是我的composer.json:
"require-dev": {
"phpunit/phpunit": "4.3.5"
}
这是我的phpunit.xml
<phpunit bootstrap="bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
verbose="true">
<testsuites>
<testsuite name="tests">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>
这是我的PostTest.php:
class PostTest extends PHPUnit_Framework_TestCase
{
private $CI;
public function setUp()
{
$this->CI = &get_instance();
}
public function test()
{
$this->CI->load->model('test_model');
$posts = $this->CI->post->getAll();
$this->assertEquals(5, count($posts));
}
}
以下是我的设置:
我错过了什么吗?或者我没有正确配置?这是我第一次使用PHPUnit,所以我无法看到问题。做了很多谷歌搜索,但它似乎也没有帮助。
任何帮助解决这个问题都将非常感激。