Skip to content

Commit

Permalink
Fix test: Don't count white spaces on string comparision
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitpokhrel committed Nov 21, 2015
1 parent f5e7308 commit 37ce024
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/test-dynamic-featured-image-ajax.php
Expand Up @@ -31,6 +31,7 @@ public function testAjaxCallback()
</div>
<div class="dfiClearFloat"></div>
<input type="hidden" name="dfiFeatured[]" value="" class="dfiImageHolder" />';
$expectedOutput = preg_replace( '/\s+/', '', $expectedOutput );

$_POST['id'] = $this->__post_id;
try {
Expand All @@ -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()
Expand Down

0 comments on commit 37ce024

Please sign in to comment.