Phpunit新手 - 如何获得assertTrue方法

时间:2013-05-08 09:06:27

标签: phpunit

如何获得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

1 个答案:

答案 0 :(得分:3)

 $this->assertTrue{ 1 > 0 };

应该是

 $this->assertTrue( 1 > 0 );