Skip to content
This repository
Browse code

Fix failing tests

  • Loading branch information...
commit ce9ad1f2edf64b3c2cfd920543b519a21cefbf56 1 parent 8efc641
ADmad authored October 01, 2012
11  lib/Cake/Test/Case/Utility/FolderTest.php
@@ -778,7 +778,9 @@ public function testReset() {
778 778
 		mkdir($folder);
779 779
 		$file = $folder . DS . 'file';
780 780
 		touch($file);
781  
-		$handle = fopen($file, 'a');
  781
+
  782
+		chmod($folder, 0555);
  783
+		chmod($file, 0444);
782 784
 
783 785
 		$Folder = new Folder($folder);
784 786
 		$return = $Folder->delete();
@@ -787,7 +789,7 @@ public function testReset() {
787 789
 		$messages = $Folder->messages();
788 790
 		$errors = $Folder->errors();
789 791
 		$expected = array(
790  
-			$folder . DS . 'file NOT removed',
  792
+			$file . ' NOT removed',
791 793
 			$folder . ' NOT removed',
792 794
 		);
793 795
 		sort($expected);
@@ -795,7 +797,8 @@ public function testReset() {
795 797
 		$this->assertEmpty($messages);
796 798
 		$this->assertEquals($expected, $errors);
797 799
 
798  
-		fclose($handle);
  800
+		chmod($file, 0644);
  801
+		chmod($folder, 0755);
799 802
 
800 803
 		$return = $Folder->delete();
801 804
 		$this->assertTrue($return);
@@ -803,7 +806,7 @@ public function testReset() {
803 806
 		$messages = $Folder->messages();
804 807
 		$errors = $Folder->errors();
805 808
 		$expected = array(
806  
-			$folder . DS . 'file removed',
  809
+			$file . ' removed',
807 810
 			$folder . ' removed',
808 811
 		);
809 812
 		sort($expected);

2 notes on commit ce9ad1f

Mark
Collaborator

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.

Mark
Collaborator

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

Please sign in to comment.
Something went wrong with that request. Please try again.