コード例 #1
0
 public static function assertIsTrue($is, $title = null, $value = null, $message = '')
 {
     $expectation = 'TRUE';
     echo self::_title($expectation, $title);
     self::_printResult($is, $value);
     return parent::assertTrue($is, $message);
 }
コード例 #2
0
ファイル: AppTestCase.php プロジェクト: beckye67/Icing
 /**
  * Assert that a timetstamp is within a certain tolerance of seconds
  *
  * @param string $timetstamp (parseable via strtotime)
  * @param string $match [now] (parseable via strtotime)
  * @param int $toleranceSeconds [5] number of seconds allowed as delta/diff
  * @param string $message if fails
  */
 public function assertTimestamp($timestamp, $match = 'now', $toleranceSeconds = 5, $message = null)
 {
     if (empty($timestamp)) {
         $message = 'The timestamp was empty';
         return parent::assertTrue(false, $message);
     }
     $epoch = strtotime($timestamp);
     $match = strtotime($match);
     $diff = abs($epoch - $match);
     if (empty($message)) {
         $message = sprintf('The timestamp %s was not within %s seconds of %s (%s seconds apart)', $timestamp, $toleranceSeconds, date('Y-m-d H:i:s', $match), $diff);
     }
     parent::assertTrue($diff <= $toleranceSeconds, $message);
 }
コード例 #3
0
ファイル: AppTestCase.php プロジェクト: pmoraes/templates
 public static function assertTrue($condition, $message = '')
 {
     parent::assertTrue((bool) $condition, $message);
 }