-
Notifications
You must be signed in to change notification settings - Fork 37
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
Show XMLRPC error when it's broken #943
Show XMLRPC error when it's broken #943
Conversation
Looks good @planarvoid - how about we add a new discovery test for this case though? Looks like a site with |
@aforcier I've added the test |
@planarvoid you need to add a placeholder value for |
@aforcier thanks! I was meaning to ask you |
@Test | ||
public void testXMLRPCForbiddenDiscoveryOnSelfHostedSiteWithMovedPhpFile() throws InterruptedException { | ||
mUrl = BuildConfig.TEST_WPORG_URL_DELETED_XMLRPC_PHP; | ||
mUsername = BuildConfig.TEST_WPORG_USERNAME_SH_FORBIDDEN; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't need to define mUsername
and mPassword
here, they're not used (and they're also currently values for a different test site).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right of course, I see now that I've deleted them in the following test by mistake 😢
@@ -434,11 +434,24 @@ public void testXMLRPCForbiddenDiscovery() throws InterruptedException { | |||
assertTrue(mCountDownLatch.await(TestUtils.DEFAULT_TIMEOUT_MS, TimeUnit.MILLISECONDS)); | |||
} | |||
|
|||
@Test | |||
public void testXMLRPCForbiddenDiscoveryOnSelfHostedSiteWithMovedPhpFile() throws InterruptedException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would maybe call this test testXMLRPCDeletedXmlrpcFileDiscovery
or something like that - 'forbidden' tends to refer to the xmlrpc.php file existing, but being blocked, usually via .htaccess
rules.
! |
Issue: wordpress-mobile/WordPress-Android#8459
This PR is adding one additional case when we're returning the
MISSING_XMLRPC_METHOD
. When we were able to scrape it from the the site, we already know the the site is wporg. In that case we shouldn't show theNO_SITE_ERROR
because it is not true.