? ? Pending

User tests: Successful: Unsuccessful:

avatar yvesh
yvesh
10 Apr 2017

Summary of Changes

Fixes the unit tests in the 4.0-dev branch and an issue in the WebApplication class

Testing Instructions

Check if travis is green, test that everything is still working and do a code review

Expected result

RuntimeException is thrown

Actual result

Fatal error because runtime exception is not thrown

Documentation Changes Required

None

avatar yvesh yvesh - open - 10 Apr 2017
avatar yvesh yvesh - change - 10 Apr 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 10 Apr 2017
Category Libraries Unit Tests
avatar yvesh yvesh - change - 11 Apr 2017
Labels Added: ? ?
avatar mbabker
mbabker - comment - 11 Apr 2017

Why are we testing that it is a subclass? I don't remember why I removed it in #12531 but it really seems fully unnecessary. There is also no other factory in our API which is doing this type of subclass or interface enforcement.

avatar yvesh
yvesh - comment - 11 Apr 2017

@mbabker that were the results of Georges merge conflicts - in 3.8 / 3.9 we do it too with a fallback on WebApplication (which does not feel right for me, but this is another topic):

https://github.com/joomla/joomla-cms/blob/3.9-dev/libraries/src/Joomla/CMS/Application/WebApplication.php#L207

avatar wilsonge
wilsonge - comment - 11 Apr 2017

Unless you have an interface that you can rely on I don't understand why we wouldn't do subclass checks. Otherwise we have no clue what methods or properties actually do exist.

avatar mbabker
mbabker - comment - 11 Apr 2017

It's an arbitrary restriction. You assume if a factory method can build the object that's being returned, it meets at least whatever is in the doc block. We don't do these types of checks in any other factory we have. Why here?

avatar wilsonge wilsonge - change - 11 Apr 2017
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-04-11 16:40:20
Closed_By wilsonge
avatar wilsonge wilsonge - close - 11 Apr 2017
avatar wilsonge wilsonge - merge - 11 Apr 2017

Add a Comment

Login with GitHub to post a comment