2

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

1 回答 1

4
 $this->assertTrue{ 1 > 0 };

应该

 $this->assertTrue( 1 > 0 );
于 2013-05-08T09:08:33.197 回答