Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Unit Tester: ->t() wrapper alias for assertTrue() for brevity.

  • Loading branch information...
commit 4982fa92781c5fc05b5ff9bbc5fbe116dfa442f4 1 parent 58161f1
Roy R. tchalvak authored
Showing with 15 additions and 1 deletion.
  1. +15 −1 unit_tester.php
16 unit_tester.php
View
@@ -36,6 +36,8 @@ function __construct($label = false) {
parent::__construct($label);
}
+
+
/**
* Called from within the test methods to register
* passes and failures.
@@ -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
@@ -410,4 +424,4 @@ protected function coerceExpectation($expected) {
is_string($expected) ? str_replace('%', '%%', $expected) : $expected);
}
}
-?>
+?>
Please sign in to comment.
Something went wrong with that request. Please try again.