Browse Source

Fix tests that fail on windows.

Refs #2148
mark_story 14 years ago
parent
commit
154b001552

+ 3 - 7
lib/Cake/Test/Case/Utility/DebuggerTest.php

@@ -329,9 +329,7 @@ object(View) {
 	float => (float) 1.333
 }
 TEXT;
-		$result = str_replace(array("\r\n", "\n"), "", $result);
-		$expected =  str_replace(array("\r\n", "\n"), "", $expected);
-		$this->assertEquals($expected, $result);
+		$this->assertTextEquals($expected, $result);
 
 		$data = array(
 			1 => 'Index one',
@@ -344,7 +342,7 @@ array(
 	(int) 5 => 'Index five'
 )
 TEXT;
-		$this->assertEquals($expected, $result);
+		$this->assertTextEquals($expected, $result);
 	}
 
 /**
@@ -404,9 +402,7 @@ TEXT;
 	)
 )</pre>
 TEXT;
-		$result = str_replace(array("\r\n", "\n"), "", $result);
-		$expected =  str_replace(array("\r\n", "\n"), "", $expected);
-		$this->assertEquals($expected, $result);
+		$this->assertTextEquals($expected, $result);
 	}
 
 /**

+ 2 - 2
lib/Cake/Test/Case/Utility/SanitizeTest.php

@@ -367,7 +367,7 @@ text
 HTML;
 		$expected = "text\n\ntext";
 		$result = Sanitize::stripScripts($string);
-		$this->assertEquals($expected, $result);
+		$this->assertTextEquals($expected, $result);
 
 		$string = <<<HTML
 text
@@ -380,7 +380,7 @@ text
 HTML;
 		$expected = "text\n\ntext";
 		$result = Sanitize::stripScripts($string);
-		$this->assertEquals($expected, $result);
+		$this->assertTextEquals($expected, $result);
 	}
 
 /**

+ 3 - 2
lib/Cake/Test/Case/Utility/StringTest.php

@@ -315,7 +315,7 @@ 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.');
 
 		$result = String::wrap($text, array('width' => 20, 'wordWrap' => false));
 		$expected = <<<TEXT
@@ -326,7 +326,7 @@ ever ends. This is
 the song that never
  ends.
 TEXT;
-		$this->assertEquals($expected, $result, 'Text not wrapped.');
+		$this->assertTextEquals($expected, $result, 'Text not wrapped.');
 	}
 
 /**
@@ -342,5 +342,6 @@ This is the song that never ends.
 	This is the song that never ends.
 	This is the song that never ends.
 TEXT;
+		$this->assertTextEquals($expected, $result);
 	}
 }