? ? ? Pending

User tests: Successful: Unsuccessful:

avatar Hackwar
Hackwar
1 Aug 2019

This adds further tests for Table::bind(). These tests uncovered 3 issues in that method:

  1. If neither an array nor an object is given to bind, the onTableBeforeBind event throws an exception, but not the InvalidArgumentException that bind() is supposed to throw. So the check for the "validity" of the input data is pulled to the front of the method.
  2. Likewise the $ignore parameter. This can be both an array or a space separated string of field names. If you use that string variant, the events throw an error of invalid input.
  3. If a field is marked as JSON encoded, but the input is an object, this code will fail because it treats the object as an array.

I still have to find a way to test the events.

avatar Hackwar Hackwar - open - 1 Aug 2019
avatar Hackwar Hackwar - change - 1 Aug 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 1 Aug 2019
Category Libraries Unit Tests
avatar wilsonge
wilsonge - comment - 2 Aug 2019

Number 3 must be an issue in staging I guess? because that's not new code for j4.

avatar Hackwar Hackwar - change - 4 Aug 2019
Labels Added: ? ?
avatar Hackwar
Hackwar - comment - 4 Aug 2019

I've extended the tests, but it fails on the event testing. If someone has an idea...

avatar Hackwar
Hackwar - comment - 4 Aug 2019

Found the issue and fixed it. I also cleaned up a few things...

avatar wilsonge
wilsonge - comment - 5 Aug 2019

Yah my guess is getTableColumns in the db driver is bugged. Should be able to write a test there too :P

avatar joomla-cms-bot joomla-cms-bot - change - 11 Aug 2019
Category Libraries Unit Tests External Library Composer Change Libraries Unit Tests
avatar Hackwar
Hackwar - comment - 11 Aug 2019

With the other PR merged, this one would then now be ready. Can you merge this one?

avatar Hackwar
Hackwar - comment - 11 Aug 2019

Or not. Now we have the same issue as in the backend template repo. So going to wait for that to be merged before we can merge this one. Giving me more time to write more tests. Maybe.

avatar Hackwar Hackwar - change - 13 Aug 2019
Labels Added: ?
avatar Hackwar
Hackwar - comment - 13 Aug 2019

I've updated the composer stuff with just the updated database package and now the tests pass. Would be ready to merge this now.

avatar Hackwar
Hackwar - comment - 21 Aug 2019

@wilsonge since the tests are passing, could we merge this now? :-)

avatar HLeithner
HLeithner - comment - 26 Aug 2019

Thanks

avatar HLeithner HLeithner - close - 26 Aug 2019
avatar HLeithner HLeithner - merge - 26 Aug 2019
avatar HLeithner HLeithner - change - 26 Aug 2019
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-08-26 08:20:28
Closed_By HLeithner

Add a Comment

Login with GitHub to post a comment