From 154b0015525642344d7a8e1931d32babec769e9d Mon Sep 17 00:00:00 2001 From: mark_story Date: Tue, 24 Jan 2012 21:12:26 -0500 Subject: [PATCH] Fix tests that fail on windows. Refs #2148 --- lib/Cake/Test/Case/Utility/DebuggerTest.php | 10 +++------- lib/Cake/Test/Case/Utility/SanitizeTest.php | 4 ++-- lib/Cake/Test/Case/Utility/StringTest.php | 5 +++-- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/lib/Cake/Test/Case/Utility/DebuggerTest.php b/lib/Cake/Test/Case/Utility/DebuggerTest.php index 569fd46dd..a287a412d 100644 --- a/lib/Cake/Test/Case/Utility/DebuggerTest.php +++ b/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; ) ) 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); } /** diff --git a/lib/Cake/Test/Case/Utility/SanitizeTest.php b/lib/Cake/Test/Case/Utility/SanitizeTest.php index 6be976bf2..6c8008443 100644 --- a/lib/Cake/Test/Case/Utility/SanitizeTest.php +++ b/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 = <<assertEquals($expected, $result); + $this->assertTextEquals($expected, $result); } /** diff --git a/lib/Cake/Test/Case/Utility/StringTest.php b/lib/Cake/Test/Case/Utility/StringTest.php index f7cdc6d25..dfc480905 100644 --- a/lib/Cake/Test/Case/Utility/StringTest.php +++ b/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 = <<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); } }