Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for JLanguageMultilang #6443

Closed
wants to merge 3 commits into from

Conversation

wilsonge
Copy link
Contributor

There is a small change to allow the application object to be injected in to allow unit tests this can be tested easily by just navigating around Joomla.

Finally as per the doc block I've typecast the result to be a boolean as it was returning the string 0 on false and 1 on true for the enabled state of the plugin (as these are the values stored in the database). Currently you get true and false in the frontend and 0 and 1 in the backend.

Testing

All the routing in the frontend depends on this class so navigate around and ensure that with plugin enabled and disabled everything works as expected.

In the backend ensure that the modal views when you are selecting a single item in the menu show everything properly

// Get application object if not injected.
if (!$app)
{
$app = JFactory::getApplication();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one will not be tested if you always hand over a $app in the tests. Thus not 100% coverage. 😉

@Hackwar
Copy link
Member

Hackwar commented Mar 17, 2015

Looks good. This test brings up 2 issues for me: JLanguageMultilang couples a multi-lang implementation to our language filter plugin and it shows that our language implementation is pretty hacked together... This class is pretty much just bloat. A proper implementation would read that from some general storage and a proper languagefilter implementation would set that flag regardless of the app that is currently running.

@wilsonge
Copy link
Contributor Author

Replaced by #6479 which removes the application injection

@wilsonge wilsonge closed this Mar 17, 2015
@wilsonge wilsonge deleted the multilangtest branch March 17, 2015 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants