Permalink
Browse files

soap/AttachmentTest.php: fix reference download URL

mc_issue_api.php/mci_issue_get_attachments() generates the download URL
with '&' while the test suite compares it with '&'. In some cases
the soap api returns '&' while in most cases it returns '&'.

To fix the problem we decode the string with html_entity_decode() before
comparing it.

Fixes #15817
  • Loading branch information...
dregad committed May 7, 2013
1 parent 4465b2f commit 9b3d9f769c9e129144bf5f2d0698cd2882a21624
Showing with 4 additions and 1 deletion.
  1. +4 −1 tests/soap/AttachmentTest.php
@@ -73,7 +73,10 @@ public function testAttachmentIsAdded() {
$this->assertEquals( 1, count( $issue->attachments ), 'count($issue->attachments)' );
$this->assertEquals( $attachmentContents, base64_decode( $attachment ), '$attachmentContents' );
- $this->assertEquals( $this->mantisPath.'file_download.php?file_id='.$issue->attachments[0]->id.'&type=bug', $issue->attachments[0]->download_url);
+ $this->assertEquals(
+ $this->mantisPath.'file_download.php?file_id='.$issue->attachments[0]->id.'&type=bug',
+ html_entity_decode( $issue->attachments[0]->download_url)
+ );
$this->assertEquals( $this->userId, $issue->attachments[0]->user_id);
}

0 comments on commit 9b3d9f7

Please sign in to comment.