Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Oct 1, 2012
1 parent 8efc641 commit ce9ad1f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/Cake/Test/Case/Utility/FolderTest.php
Expand Up @@ -778,7 +778,9 @@ public function testReset() {
mkdir($folder);
$file = $folder . DS . 'file';
touch($file);
$handle = fopen($file, 'a');

chmod($folder, 0555);
chmod($file, 0444);

$Folder = new Folder($folder);
$return = $Folder->delete();
Expand All @@ -787,23 +789,24 @@ public function testReset() {
$messages = $Folder->messages();
$errors = $Folder->errors();
$expected = array(
$folder . DS . 'file NOT removed',
$file . ' NOT removed',
$folder . ' NOT removed',
);
sort($expected);
sort($errors);
$this->assertEmpty($messages);
$this->assertEquals($expected, $errors);

fclose($handle);
chmod($file, 0644);
chmod($folder, 0755);

$return = $Folder->delete();
$this->assertTrue($return);

$messages = $Folder->messages();
$errors = $Folder->errors();
$expected = array(
$folder . DS . 'file removed',
$file . ' removed',
$folder . ' removed',
);
sort($expected);
Expand Down

2 comments on commit ce9ad1f

@dereuromark
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but that would only work on nix then (not on windows I assume - since folder permissions dont work there).

you probably need a skipIf in this case then.

@dereuromark
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow, folder permissions work on windows8. there the tests still pass after your change.

Please sign in to comment.