User tests: Successful: Unsuccessful:
JBrowser
does not correctly detect version data for Firefox browsers, this is now addedJBrowser
itself has no test coverage, this adds several test cases based on user agents used to test Joomla\Application\Web\WebClient
to cover JBrowser::match()
For Firefox browsers, their data (especially the version) should now be detected correctly. All added test cases should pass.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries Unit Tests |
@mbabker I've pinged you and @wilsonge for comments in #17051 (comment), which is already RTC. Apart from the "missing" test, why the new PR`?
I started only by writing the unit tests. When I copied over the Mozilla user agents from the web client class' test case, I found those were failing to detect the correct version and added a fix for that too. Can't say I remembered that PR being open, either way it doesn't matter what order things get merged in but the added unit test cases are required.
The problem with Firefox not being detected correctly was not only because of a missing else / if, but the regular expression for "mozilla" browsers being: preg_match('|Mozilla/([0-9.]+)|', $this->agent, $version)
which is the case for almost any UA, since they start with Mozilla/X.X.
I've also looked into some alternative Mozilla ~ Firefox based browsers which all(?) have their own UA and would now be detected as "mozilla". Therefore my question #17051.
For this to work in the future, we either have to "remove" the Mozilla check, sort of what I did. or put it at the very end of that list, right?
I have no idea honestly, browser detection isn't something I do normally. I just did what looked to be a valid fix for the issue I ran into while importing tests. I do know without a change in JBrowser
we are reporting incorrect data (something the web client class handles better right now) in that the browser version number is wrong. So clearly we need to do something, I'll leave the specifics of that to people more interested or knowledged in the area, we just need to get tests for the JBrowser
class merged in at some point because right now the lines that are covered are because JHtml
uses it.
Category | Libraries Unit Tests | ⇒ | Unit Tests |
Title |
|
This is updated now to only add the unit test cases, the browser detection can be sorted in the other PR.
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-07-26 13:23:12 |
Closed_By | ⇒ | wilsonge |
Merged on review
List for UA's to consider testing for
Here are links to get common user agents to test with