? ? Error

User tests: Successful: Unsuccessful:

avatar chalet16
chalet16
27 Feb 2014

In Zend PHP, order in the result output of usort() function is undefined, if two items has the same key value. Therefore, this means that JArrayHelper::sortObjects can return two items with the same key in any order as it uses usort() in its implementation. However, testSortObjects() assumes that usort() is always consistent, which is not guaranteed and at least not in the case of HHVM.

This patch will make testSortObjects() works in both Zend and HHVM PHP implementations.

avatar chalet16 chalet16 - open - 27 Feb 2014
avatar chalet16 chalet16 - change - 27 Feb 2014
Labels Added: ?
avatar chalet16 chalet16 - change - 27 Feb 2014
Labels Added: ?
avatar brianteeman brianteeman - change - 27 Feb 2014
Labels Added: ?
avatar wilsonge
wilsonge - comment - 28 Feb 2014

Whilst travis didn't complete. The 5.4 test did complete and shows several tests are now not passing because of this change. Could you please update this so the tests pass? Thanks :)

avatar chalet16
chalet16 - comment - 4 Mar 2014

I have tried running this test on both PHP and HHVM and it seems to work fine for me.

avatar mbabker
mbabker - comment - 4 Mar 2014

I'm getting errors too on my local PHP 5.4.10 setup, but they're all Array to string conversion messages (the same issue the Travis build has on the PHP 5.4 run), which isn't necessarily the code having issues at this point but rather how the tests are handling that. I retriggered the Travis job to try and get a proper PHP 5.3 test, but right now I'm still seeing the output from the first run which is useless in trying to see why that environment is failing but @chalet16 isn't having issues.

avatar brianteeman brianteeman - change - 4 Mar 2014
Status New Pending
avatar brianteeman brianteeman - change - 2 Sep 2014
Category Unit Tests
avatar javigomez javigomez - assigned - 16 Oct 14
avatar nicksavov nicksavov - change - 16 Oct 2014
Labels
avatar nicksavov nicksavov - change - 16 Oct 2014
Labels
avatar nicksavov nicksavov - change - 16 Oct 2014
Labels Added: ?
avatar javigomez javigomez - unassigned - 17 Oct 14
avatar wilsonge wilsonge - reference | c9e127f - 28 Dec 14
avatar brianteeman brianteeman - change - 1 Jan 2015
Labels
avatar brianteeman brianteeman - change - 1 Jan 2015
Labels Removed: ?
avatar roland-d
roland-d - comment - 4 May 2015

@chalet16 Could you please do another commit on this PR so it will trigger the new travis runs? Thanks.

avatar wilsonge
wilsonge - comment - 31 May 2015

We merged 0504b70 from @mbabker which should have fixed this in a way that keeps our PHP implementations happy! Thankyou for submitting this code though - it's really appreciated

avatar wilsonge wilsonge - change - 31 May 2015
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2015-05-31 09:54:49
Closed_By wilsonge
avatar wilsonge wilsonge - close - 31 May 2015

Add a Comment

Login with GitHub to post a comment