From d27381f3a2c620d78a7feab9b88455991bd6fef1 Mon Sep 17 00:00:00 2001 From: mark_story Date: Wed, 9 Jun 2010 17:07:17 -0400 Subject: [PATCH] Adding skipUnless compatibility method. --- cake/tests/lib/cake_test_case.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cake/tests/lib/cake_test_case.php b/cake/tests/lib/cake_test_case.php index effd242c7..d37aa00e6 100644 --- a/cake/tests/lib/cake_test_case.php +++ b/cake/tests/lib/cake_test_case.php @@ -509,4 +509,18 @@ class CakeTestCase extends PHPUnit_Framework_TestCase { $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; + } }