アサーションメソッド | Test

FunctionalテストUnitテスト で使用するアサーションメソッドの基本的なものは下記になります。

  • assertEquals ( $expected, $actual )
    $actual が $expected に等しい
  • assertNotEquals ( $expected, $actual )
    $actual が $expected に等しくない
  • assertTrue ( $condition )
    $condition が true である
  • assertFalse ( $condition )
    $condition が false である
  • assertNull ( $variable )
    $variable が null である
  • eq ( $expected, $actual )
    assertEquals のエイリアス
  • neq ( $expected, $actual )
    assertNotEquals のエイリアス

またその他多くのアサーションメソッドの使用法がこちら(PHPUnit 3.4)にあります。

関連項目