Skip to content

Commit

Permalink
Unit Tester: ->t() wrapper alias for assertTrue() for brevity.
Browse files Browse the repository at this point in the history
  • Loading branch information
tchalvak committed May 15, 2012
1 parent 58161f1 commit 4982fa9
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion unit_tester.php
Expand Up @@ -36,6 +36,8 @@ function __construct($label = false) {
parent::__construct($label);
}



/**
* Called from within the test methods to register
* passes and failures.
Expand All @@ -48,6 +50,18 @@ function __construct($label = false) {
function assertTrue($result, $message = '%s') {
return $this->assert(new TrueExpectation(), $result, $message);
}

/**
* Wrapper around the assertTrue method for brevity
* @param boolean $result Pass on true.
* @param string $message Message to display describing
* the test state.
* @return boolean True on pass
* @access public
*/
function t($result, $message = '%s') {
return $this->assertTrue($result, $message);
}

/**
* Will be true on false and vice versa. False
Expand Down Expand Up @@ -410,4 +424,4 @@ protected function coerceExpectation($expected) {
is_string($expected) ? str_replace('%', '%%', $expected) : $expected);
}
}
?>
?>

0 comments on commit 4982fa9

Please sign in to comment.