Skip to content

Commit

Permalink
Adding skipUnless compatibility method.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jun 9, 2010
1 parent 17054db commit d27381f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cake/tests/lib/cake_test_case.php
Original file line number Diff line number Diff line change
Expand Up @@ -509,4 +509,18 @@ protected function assertWithinMargin($value, $expected, $margin, $message = '')
$lower = $value - $margin;
$this->assertTrue((($expected <= $upper) && ($expected >= $lower)), $message);
}

/**
* Compatibility function for skipping.
*
* @param boolean $condition Condition to trigger skipping
* @param string $message Message for skip
* @return boolean
*/
protected function skipUnless($condition, $message = '') {
if (!$condition) {
$this->markTestSkipped($message);
}
return $condition;
}
}

0 comments on commit d27381f

Please sign in to comment.