Browse Source

Test case compatibility skipUnless() to markTestSkipped()

Kyle Robinson Young 14 years ago
parent
commit
99793fd654

+ 6 - 2
lib/Cake/Test/Case/BasicsTest.php

@@ -621,7 +621,9 @@ class BasicsTest extends CakeTestCase {
  * @return void
  */
 	public function testFileExistsInPath() {
-		$this->skipUnless(function_exists('ini_set'), '%s ini_set function not available');
+		if (!function_exists('ini_set')) {
+			$this->markTestSkipped('%s ini_set function not available');
+		}
 
 		$_includePath = ini_get('include_path');
 
@@ -957,7 +959,9 @@ EXPECTED;
  * @return void
  */
 	public function testStripslashesDeepSybase() {
-		$this->skipUnless(ini_get('magic_quotes_sybase') === '1', 'magic_quotes_sybase is off');
+		if (!(ini_get('magic_quotes_sybase') === '1')) {
+			$this->markTestSkipped('magic_quotes_sybase is off');
+		}
 
 		$this->assertEquals(stripslashes_deep("tes\'t"), "tes\'t");
 

+ 3 - 1
lib/Cake/Test/Case/Cache/Engine/XcacheEngineTest.php

@@ -32,7 +32,9 @@ class XcacheEngineTest extends CakeTestCase {
  * @return void
  */
 	public function setUp() {
-		$this->skipUnless(function_exists('xcache_set'), 'Xcache is not installed or configured properly');
+		if (!function_exists('xcache_set')) {
+			$this->markTestSkipped('Xcache is not installed or configured properly');
+		}
 		$this->_cacheDisable = Configure::read('Cache.disable');
 		Configure::write('Cache.disable', false);
 		Cache::config('xcache', array('engine' => 'Xcache', 'prefix' => 'cake_'));

+ 3 - 1
lib/Cake/Test/Case/Network/Http/HttpSocketTest.php

@@ -642,7 +642,9 @@ class HttpSocketTest extends CakeTestCase {
 		$this->Socket->connected = true;
 
 		$f = fopen(TMP . 'download.txt', 'w');
-		$this->skipUnless($f, 'Can not write in TMP directory.');
+		if (!$f) {
+			$this->markTestSkipped('Can not write in TMP directory.');
+		}
 
 		$this->Socket->setContentResource($f);
 		$result = (string)$this->Socket->request('http://www.cakephp.org/');

+ 3 - 1
lib/Cake/Test/Case/View/Helper/CacheHelperTest.php

@@ -64,7 +64,9 @@ class CacheHelperTest extends CakeTestCase {
  * @return void
  */
 	public function skip() {
-		$this->skipUnless(is_writable(TMP . 'cache' . DS . 'views' . DS), 'TMP/views is not writable %s');
+		if (!is_writable(TMP . 'cache' . DS . 'views' . DS)) {
+			$this->markTestSkipped('TMP/views is not writable %s');
+		}
 	}
 /**
  * setUp method