如何获得assertTrue方法?我的文件phpunit_test.php是
<?php
class phptest extends PHPUnit_Framework_TestCase
{
public function test_something()
{
$this->assertTrue{ 1 > 0 };
}
}
?>
但phpunit phpunit_test.php返回
There was 1 error:
1) phptest::test_something
Undefined property: phptest::$assertTrue
答案 0 :(得分:3)
$this->assertTrue{ 1 > 0 };
应该是
$this->assertTrue( 1 > 0 );