运行 php-activerecord 的 phpunit 失败
我正在尝试测试 php-activerecord,它有一些测试。运行时:
phpunit sometestname
没有任何反应。我检查了代码,
include 'helpers/config.php';
require_once dirname(__FILE__) . '/../lib/Inflector.php';
class InflectorTest extends SnakeCase_PHPUnit_Framework_TestCase
{
public function set_up()
{
$this->inflector = ActiveRecord\Inflector::instance();
}
public function testOne()
{
$this->assertTrue(2+2==4);
}
有什么想法吗?
I am trying to test php-activerecord, it has some tests. When run:
phpunit sometestname
nothing happened. I checked the code,
include 'helpers/config.php';
require_once dirname(__FILE__) . '/../lib/Inflector.php';
class InflectorTest extends SnakeCase_PHPUnit_Framework_TestCase
{
public function set_up()
{
$this->inflector = ActiveRecord\Inflector::instance();
}
public function testOne()
{
$this->assertTrue(2+2==4);
}
Any idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的 PHPUnit 版本有点过时。让我们确保您是最新的。请这样做
,然后
这应该会导致
如果有任何错误,请尝试使用
PHPActiveRecord 测试助手的 DocBlock 说,
但其中有两个针对 Log 依赖项的抑制包含
,这可能是您在 CLI 上没有得到任何结果的原因所有,所以请确保您也这样做
那应该可行。
编辑: PHPActiveRecord 网站提供的 1.0 版本没有上述 DocBlock,并使用
require_once
作为日志依赖项。这在当前的主版本中已更改,因此您可能需要尝试每晚或从 GitHub 查看主分支:Your PHPUnit version is a bit outdated. Let's make sure you are current. Please do
and then
this should result in
If there is any errors try upgrade your PEAR version to the current version with
The DocBlock for the test helper of PHPActiveRecord says
but there is two suppressed includes in it for the Log dependency
which could be the reason why you are not getting any result on CLI at all, so make sure you also do
That should work then.
EDIT: the 1.0 Version that is available from the PHPActiveRecord Website does not have the above DocBlock and uses
require_once
for the Log dependency. This is changed in the current master version, so you might want to try the nightly or check out the master branch from GitHub: