View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0015817 | mantisbt | api soap | public | 2013-05-07 00:40 | 2014-02-07 18:24 |
Reporter | vboctor | Assigned To | dregad | ||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | fixed | ||
Product Version | 1.2.15 | ||||
Target Version | 1.2.16 | Fixed in Version | 1.2.16 | ||
Summary | 0015817: SOAP API unit test failures | ||||
Description | Got the following errors when running the unit tests. | ||||
Tags | No tags attached. | ||||
See discussion thread [1] I can consistently reproduce the issue with dates (in VersionTest.php), using both php5_soap and nusoap, and I believe it's clearly a case of not taking the timezone into consideration (due to comparing a string instead of a datetime object). The case of AttachmentTest is a bit weird though. I tested with different setups and PHP versions (but always with same Mantis code) and in most cases, the attachment's download_url as returned by mc_issue_get() has an encoded '&', but in one case [2] it returned '&' (regardless of which soap was used), and I have no idea why. So IMO a good way to fix this would be to use html_entity_decode() on the download_url returned by soap api. [1] http://thread.gmane.org/gmane.comp.bug-tracking.mantis.devel/4412 |
|
Test this: https://github.com/dregad/mantisbt/tree/fix-15817 |
|
Reminder sent to: rombert rombert, could you kindly have a look at my patch and let me know if it's OK for you ? |
|
All three commits look good to me. BTW, what did you use to format the code? |
|
Thx for feedback.
What do you mean? |
|
Did you reformat the code manually? https://github.com/dregad/mantisbt/commit/4517dd1a6a54a1294ca71235aa81aef26cae925d introduces whitespace changes and I'm curious if you did them manually or with an IDE. |
|
My text editor (geany) is configured to automatically remove trailing whitespace, and to use tabs for indents as per our coding guidelines. Using the tab key indents/outdents a text block, and this function replaces spaces by tabs if needed. There's also a function to replace spaces by tabs and vice-versa. I also have git configured to highlight whitespace errors (trailing-space, space-before-tab, indent-with-non-tab) so I easily spot issues when I diff changes; I have also been playing with a pre-commit hook to validate such things. So in short, it's a mix of manual and automated. |
|
MantisBT: master 4465b2f1 2013-05-06 01:07 Damien Regad Committer: dregad Details Diff |
soap/VersionTest.php: take timezone into consideration Prior to this, dates were compared as string, resulting in '2015-10-29T12:59:14+00:00' and '2015-10-29T05:59:14-07:00' to be considered as different dates. Fixes 0015817 |
Affected Issues 0015817 |
|
mod - tests/soap/VersionTest.php | Diff File | ||
MantisBT: master-1.2.x 220fcc43 2013-05-06 01:07 Damien Regad Committer: dregad Details Diff |
soap/VersionTest.php: take timezone into consideration Prior to this, dates were compared as string, resulting in '2015-10-29T12:59:14+00:00' and '2015-10-29T05:59:14-07:00' to be considered as different dates. Fixes 0015817 |
Affected Issues 0015817 |
|
mod - tests/soap/VersionTest.php | Diff File | ||
MantisBT: master 9b3d9f76 2013-05-07 06:26 Damien Regad Committer: dregad Details Diff |
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 0015817 |
Affected Issues 0015817 |
|
mod - tests/soap/AttachmentTest.php | Diff File | ||
MantisBT: master-1.2.x 59ec39d5 2013-05-07 06:26 Damien Regad Committer: dregad Details Diff |
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 0015817 |
Affected Issues 0015817 |
|
mod - tests/soap/AttachmentTest.php | Diff File | ||
MantisBT: master c5c64f48 2013-10-14 03:37 Details Diff |
Tests: Move dateToUTC() to SoapBase class This helper function can be used everywhere we compare dates, not just in VersionTest class. Issues 0015817, 0016485 |
Affected Issues 0015817, 0016485 |
|
mod - tests/soap/SoapBase.php | Diff File | ||
mod - tests/soap/VersionTest.php | Diff File | ||
MantisBT: master-1.2.x 714ea0ec 2013-10-14 04:02 Details Diff |
Tests: Move dateToUTC() to SoapBase class This helper function can be used everywhere we compare dates, not just in VersionTest class. Issues 0015817, 0016485 |
Affected Issues 0015817, 0016485 |
|
mod - tests/soap/SoapBase.php | Diff File | ||
mod - tests/soap/VersionTest.php | Diff File |