Phpunit新手-如何获取assertTrue方法

Phpunit新手-如何获取assertTrue方法,phpunit,Phpunit,如何获取assertTrue方法?我的文件phpunit_test.php是 <?php class phptest extends PHPUnit_Framework_TestCase { public function test_something() { $this->assertTrue{ 1 > 0 }; } } ?> 应该是 $this->assertTrue( 1 > 0 ); 应该是 $this->ass

如何获取assertTrue方法?我的文件phpunit_test.php是

<?php

class phptest extends PHPUnit_Framework_TestCase
{
  public function test_something()
  {
    $this->assertTrue{ 1 > 0 };
  }  
}
?>
应该是

 $this->assertTrue( 1 > 0 );
应该是

 $this->assertTrue( 1 > 0 );

为了确保您知道,您的测试不会抛出断言,因为1大于0,所以它通过测试时不会出错。断言失败的测试不返回正在检查的内容。如果条件不为true,则将assertTrue视为抛出断言错误。请确保您知道,您的测试不会抛出断言,因为1大于0,因此它通过测试时不会出错。断言失败的测试不返回正在检查的内容。将assertTrue视为在条件不为true时抛出断言错误。
 $this->assertTrue( 1 > 0 );