Skip to content

Commit

Permalink
Test case compatibility skipUnless() to markTestSkipped()
Browse files Browse the repository at this point in the history
  • Loading branch information
shama authored and markstory committed Nov 17, 2011
1 parent c97dca1 commit 99793fd
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
8 changes: 6 additions & 2 deletions lib/Cake/Test/Case/BasicsTest.php
Expand Up @@ -621,7 +621,9 @@ public function testLogError() {
* @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');

Expand Down Expand Up @@ -957,7 +959,9 @@ public function testStripslashesDeep() {
* @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");

Expand Down
4 changes: 3 additions & 1 deletion lib/Cake/Test/Case/Cache/Engine/XcacheEngineTest.php
Expand Up @@ -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_'));
Expand Down
4 changes: 3 additions & 1 deletion lib/Cake/Test/Case/Network/Http/HttpSocketTest.php
Expand Up @@ -642,7 +642,9 @@ public function testRequestWithResource() {
$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/');
Expand Down
4 changes: 3 additions & 1 deletion lib/Cake/Test/Case/View/Helper/CacheHelperTest.php
Expand Up @@ -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
Expand Down

0 comments on commit 99793fd

Please sign in to comment.