Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed several fails in the tests concerning windows. Especially in Al…

…lConsole
  • Loading branch information...
commit da3b424838c62579a0948c3d10a0633c53f7e8b9 1 parent 21ba5bf
@dereuromark dereuromark authored
View
2  lib/Cake/Test/Case/Console/ConsoleOptionParserTest.php
@@ -496,7 +496,7 @@ public function testHelpSubcommandHelp() {
--connection Db connection.
TEXT;
- $this->assertEquals($expected, $result, 'Help is not correct.');
+ $this->assertTextEquals($expected, $result, 'Help is not correct.');
}
/**
View
12 lib/Cake/Test/Case/Console/HelpFormatterTest.php
@@ -63,7 +63,7 @@ public function testWidthFormatting() {
<comment>(optional)</comment>
TEXT;
- $this->assertEquals($expected, $result, 'Generated help is too wide');
+ $this->assertTextEquals($expected, $result, 'Generated help is too wide');
}
/**
@@ -98,7 +98,7 @@ public function testHelpWithChoices() {
other_longer Another argument. <comment>(optional)</comment>
TEXT;
- $this->assertEquals($expected, $result, 'Help does not match');
+ $this->assertTextEquals($expected, $result, 'Help does not match');
}
/**
@@ -133,7 +133,7 @@ public function testHelpDescriptionAndEpilog() {
epilog text
TEXT;
- $this->assertEquals($expected, $result, 'Help is wrong.');
+ $this->assertTextEquals($expected, $result, 'Help is wrong.');
}
/**
@@ -164,7 +164,7 @@ public function testHelpSubcommand() {
--test A test option.
TEXT;
- $this->assertEquals($expected, $result, 'Help is not correct.');
+ $this->assertTextEquals($expected, $result, 'Help is not correct.');
}
/**
@@ -193,7 +193,7 @@ public function testHelpWithOptions() {
default)</comment>
TEXT;
- $this->assertEquals($expected, $result, 'Help does not match');
+ $this->assertTextEquals($expected, $result, 'Help does not match');
}
/**
@@ -224,7 +224,7 @@ public function testHelpWithOptionsAndArguments() {
other_longer Another argument. <comment>(optional)</comment>
TEXT;
- $this->assertEquals($expected, $result, 'Help does not match');
+ $this->assertTextEquals($expected, $result, 'Help does not match');
}
/**
View
14 lib/Cake/Test/Case/Console/ShellTest.php
@@ -544,7 +544,7 @@ public function testCreateFileNonInteractive() {
$result = $this->Shell->createFile($file, $contents);
$this->assertTrue($result);
$this->assertTrue(file_exists($file));
- $this->assertEquals(file_get_contents($file), $contents);
+ $this->assertTextEquals(file_get_contents($file), $contents);
}
/**
@@ -596,10 +596,14 @@ public function testCreateFileInteractive() {
* @return void
*/
public function testCreateFileNoPermissions() {
+ $this->skipIf(DIRECTORY_SEPARATOR === '\\', 'Cant perform operations using permissions on windows.');
+
$path = TMP . 'shell_test';
$file = $path . DS . 'no_perms';
-
- mkdir($path);
+
+ if (!is_dir($path)) {
+ mkdir($path);
+ }
chmod($path, 0444);
$this->Shell->createFile($file, 'testing');
@@ -759,7 +763,7 @@ public function testWrapText() {
This is the song that never ends.
This is the song that never ends.
TEXT;
- $this->assertEquals($expected, $result, 'Text not wrapped.');
+ $this->assertTextEquals($expected, $result, 'Text not wrapped.');
$result = $this->Shell->wrapText($text, array('indent' => ' ', 'width' => 33));
$expected = <<<TEXT
@@ -767,7 +771,7 @@ public function testWrapText() {
This is the song that never ends.
This is the song that never ends.
TEXT;
- $this->assertEquals($expected, $result, 'Text not wrapped.');
+ $this->assertTextEquals($expected, $result, 'Text not wrapped.');
}
/**
View
2  lib/Cake/Test/Case/View/Helper/SessionHelperTest.php
@@ -168,7 +168,7 @@ public function testFlashElementInAttrs() {
'params' => array('title' => 'Notice!', 'name' => 'Alert!')
));
$expected = "<div id=\"notificationLayout\">\n\t<h1>Alert!</h1>\n\t<h3>Notice!</h3>\n\t<p>This is a calling</p>\n</div>";
- $this->assertEquals($expected, $result);
+ $this->assertTextEquals($expected, $result);
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.