Permalink
Browse files

Fix failing tests

  • Loading branch information...
ADmad committed Oct 1, 2012
1 parent 8efc641 commit ce9ad1f2edf64b3c2cfd920543b519a21cefbf56
Showing with 7 additions and 4 deletions.
  1. +7 −4 lib/Cake/Test/Case/Utility/FolderTest.php
@@ -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();
@@ -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);

2 comments on commit ce9ad1f

@dereuromark

This comment has been minimized.

Show comment
Hide comment
@dereuromark

dereuromark Oct 1, 2012

Member

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.

Member

dereuromark replied Oct 1, 2012

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

This comment has been minimized.

Show comment
Hide comment
@dereuromark

dereuromark Oct 1, 2012

Member

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

Member

dereuromark replied Oct 1, 2012

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

Please sign in to comment.