From 37ce024e41c2c84053477d9db575918b0a009f85 Mon Sep 17 00:00:00 2001 From: Ankit Pokhrel Date: Sat, 21 Nov 2015 22:44:51 +0545 Subject: [PATCH] Fix test: Don't count white spaces on string comparision --- tests/test-dynamic-featured-image-ajax.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test-dynamic-featured-image-ajax.php b/tests/test-dynamic-featured-image-ajax.php index 65d7c4c..f8738a4 100644 --- a/tests/test-dynamic-featured-image-ajax.php +++ b/tests/test-dynamic-featured-image-ajax.php @@ -31,6 +31,7 @@ public function testAjaxCallback()
'; + $expectedOutput = preg_replace( '/\s+/', '', $expectedOutput ); $_POST['id'] = $this->__post_id; try { @@ -43,8 +44,10 @@ public function testAjaxCallback() //exception message must be empty $this->assertEquals( '', $e->getMessage() ); - //should contain expected ouptput - $this->assertContains($expectedOutput, $this->_last_response); + $response = preg_replace( '/\s+/', '', $this->_last_response ); + + //should contain expected output + $this->assertContains($expectedOutput, $response); } public function tearDown()