Success

User tests: Successful: Unsuccessful:

avatar Hackwar
Hackwar
16 Oct 2014

Routers in Joomla should be testable in the future with unittests. Right now, they heavily depend on JFactory and some not-so-nice code constructs to work. In order to introduce dependency injection, this PR hands over the application and the menu to the component routers. This means that you can inject fake application objects and menus into the router during testing. At the same time, component routers can build lookup tables once when they are instantiated and can get their input through these 2 objects.

This is backwards compatible, since additional arguments for a method/constructor are simply ignored by PHP and since we didn't have any arguments up to this point for the constructor, this has no effect so far.

In the future, the application router should get something similar in order to make the whole process testable. For the moment, the Singletons are still used.

This was made possible through the generous donation of the people mentioned in the following link via an Indiegogo campaign: http://joomlager.de/crowdfunding/5-contributors

Votes

# of Users Experiencing Issue
0/1
Average Importance Score
5.00

avatar Hackwar Hackwar - open - 16 Oct 2014
avatar Hackwar
Hackwar - comment - 16 Oct 2014

Please update the 3.4 branch with the latest changes to staging so that you can see that this is a one-line change to one file.

avatar brianteeman
brianteeman - comment - 16 Oct 2014

arent you supposed to be submitting pr to staging not 3.4-dev

avatar Hackwar
Hackwar - comment - 16 Oct 2014

Since this is something that would be introduced in 3.4 and upwards and not in 3.3.x, afaik this should go into 3.4-dev. I'm wondering if I need to re-do this with a branch based on 3.4-dev...

avatar Bakual
Bakual - comment - 16 Oct 2014

Usually PRs are fine against staging even if it ends up going to 3.4-dev. We can handle this when merging.
There are a few exceptions when there are expected conflicts between those branches. In this case I wouldn't expect any.
There is a big drawback with PRs against 3.4-dev. That is namely as soon as we release 3.4, the 3.4-dev will be deleted. This means that all PRs against this branch will be closed automatically as well.

I have now updated the 3.4-dev branch. So I guess you would have to rebase your branch so it goes fine. Or you just do it against staging :smile:

avatar brianteeman brianteeman - change - 18 Oct 2014
Status New Pending
avatar RCheesley
RCheesley - comment - 18 Oct 2014

Happy to test but not sure how from the description?

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4714.

avatar Hackwar
Hackwar - comment - 19 Oct 2014

I think I will have to re-do this PR against a clean copy of the 3.4-dev branch. Testing would only mean to set the error-reporting to maximum, check the errors that might show up, apply the change and then see that no new errors/notices showed up.

avatar Hackwar Hackwar - close - 19 Oct 2014
avatar Hackwar Hackwar - close - 19 Oct 2014
avatar Hackwar
Hackwar - comment - 19 Oct 2014

Closing this one in favour of #4847

avatar Hackwar Hackwar - change - 19 Oct 2014
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2014-10-19 11:33:37
avatar Hackwar
Hackwar - comment - 19 Oct 2014

Damnit, messed that one up, too. The new PR is #4848

avatar Hackwar Hackwar - head_ref_deleted - 10 Dec 2014

Add a Comment

Login with GitHub to post a comment