From 501a237053dd5946e9008e747a4ccfb0cb1bf8ed Mon Sep 17 00:00:00 2001 From: Juan Basso Date: Sun, 9 May 2010 19:42:55 -0300 Subject: [PATCH] Fixing some Shell tests for Windows. --- cake/tests/cases/console/libs/shell.test.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/cake/tests/cases/console/libs/shell.test.php b/cake/tests/cases/console/libs/shell.test.php index 418c31afaa2..a0456be1251 100644 --- a/cake/tests/cases/console/libs/shell.test.php +++ b/cake/tests/cases/console/libs/shell.test.php @@ -292,7 +292,9 @@ function testShortPath() { * @access public */ function testCreateFile() { - $this->skipIf(DIRECTORY_SEPARATOR === '\\', '%s Not supported on Windows'); + if ($this->skipIf(DIRECTORY_SEPARATOR === '\\', '%s Not supported on Windows')) { + return; + } $path = TMP . 'shell_test'; $file = $path . DS . 'file1.php'; @@ -342,7 +344,9 @@ function testCreateFile() { * @access public */ function testCreateFileWindows() { - $this->skipUnless(DIRECTORY_SEPARATOR === '\\', '%s Supported on Windows only'); + if ($this->skipUnless(DIRECTORY_SEPARATOR === '\\', '%s Supported on Windows only')) { + return; + } $path = TMP . 'shell_test'; $file = $path . DS . 'file1.php'; @@ -351,13 +355,13 @@ function testCreateFileWindows() { $this->Shell->interactive = false; - $contents = ""; + $contents = ""; $result = $this->Shell->createFile($file, $contents); $this->assertTrue($result); $this->assertTrue(file_exists($file)); $this->assertEqual(file_get_contents($file), $contents); - $contents = ""; + $contents = ""; $result = $this->Shell->createFile($file, $contents); $this->assertTrue($result); $this->assertTrue(file_exists($file)); @@ -368,7 +372,7 @@ function testCreateFileWindows() { $this->Shell->Dispatch->setReturnValueAt(0, 'getInput', 'n'); $this->Shell->Dispatch->expectAt(1, 'stdout', array('File exists, overwrite?')); - $contents = ""; + $contents = ""; $result = $this->Shell->createFile($file, $contents); $this->assertFalse($result); $this->assertTrue(file_exists($file));