User tests: Successful: Unsuccessful:
This PR adds a class_exists() sanity check to JHttpFactory::getAvailableDriver()
before trying to blindly call a class that may not be present in the filesystem in order to prevent a PHP Fatal Error.
Labels |
Added:
?
|
@wilsonge how did you test it?
This comment was created with the J!Tracker Application at http://issues.joomla.org/.
Personally, I think the unit tests are enough, but I'm biased
In your code, you can add this call: JHttpFactory::getHttp(new \Joomla\Registry\Registry, array('fopen'));
That will try to create a JHttpTransportFopen
object, which doesn't exist.
@test ok ;)
This comment was created with the J!Tracker Application at http://issues.joomla.org/.
@wilsonge why you do not submit your test results?
This comment was created with the J!Tracker Application at http://issues.joomla.org/.
Before applying the diff, I tested by changing /plugins/twofactorauth/yubikey/yubikey.php#293 to $http = JHttpFactory::getHttp(new \Joomla\Registry\Registry, array('fopen'));
which resulted in Fatal error: Class 'JHttpTransportFopen' not found
when trying to log in the frontend with a Yubikey.
After applying the diff, the frontend login does not succeed (as expected as the code is wrong) and the page reloads and displays the error page with a message of 'No transport driver available.'
This seems like a successful test to me.
@betweenbrain you also do not use submit test feature? Shame on you :toungue:
This comment was created with the J!Tracker Application at http://issues.joomla.org/.
@b2z Sorry! I'm just used to clicking the "view it on Github" link. I'll try harder next time.
This comment was created with the J!Tracker Application at http://issues.joomla.org/.
Category | ⇒ | Libraries Unit Tests |
Status | Pending | ⇒ | Ready to Commit |
RTC
This comment was created with the J!Tracker Application at http://issues.joomla.org/.
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-10-02 00:45:47 |
Labels |
Removed:
?
|
@test works as expected