Skip to content

Commit

Permalink
Fixed several fails in the tests concerning windows. Especially in Al…
Browse files Browse the repository at this point in the history
…lConsole
  • Loading branch information
euromark committed Apr 20, 2012
1 parent 21ba5bf commit da3b424
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Console/ConsoleOptionParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
}

/**
Expand Down
12 changes: 6 additions & 6 deletions lib/Cake/Test/Case/Console/HelpFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

/**
Expand Down Expand Up @@ -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');
}

/**
Expand Down Expand Up @@ -133,7 +133,7 @@ public function testHelpDescriptionAndEpilog() {
epilog text
TEXT;
$this->assertEquals($expected, $result, 'Help is wrong.');
$this->assertTextEquals($expected, $result, 'Help is wrong.');
}

/**
Expand Down Expand Up @@ -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.');
}

/**
Expand Down Expand Up @@ -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');
}

/**
Expand Down Expand Up @@ -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');
}

/**
Expand Down
14 changes: 9 additions & 5 deletions lib/Cake/Test/Case/Console/ShellTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -759,15 +763,15 @@ 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
This is the song that never ends.
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.');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/View/Helper/SessionHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit da3b424

Please sign in to comment.