Subissue of #1787218: Convert testing variables to state system..
Change the variable xmlrpc_test_xmlrpc_alter to the state system.

Files: 
CommentFileSizeAuthor
#9 1848066-xmlprc_to_state-drupal8-9.patch1.9 KBACF
PASSED: [[SimpleTest]]: [MySQL] 48,739 pass(es).
[ View ]
#7 1848066-xmlprc_to_state-drupal8-7.patch18.91 KBACF
FAILED: [[SimpleTest]]: [MySQL] 48,574 pass(es), 0 fail(s), and 2 exception(s).
[ View ]
#4 1848066-xmlprc_to_state-drupal8-4.patch1.89 KBGaelan
FAILED: [[SimpleTest]]: [MySQL] 48,723 pass(es), 1 fail(s), and 0 exception(s).
[ View ]
#1 1848066-xmlprc_to_state-drupal8-1.patch1.88 KBACF
Test request sent.
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new1.88 KB
Test request sent.
[ View ]

Patch attached.

Status:Needs review» Needs work

+++ b/core/modules/xmlrpc/tests/modules/xmlrpc_test/xmlrpc_test.moduleundefined
@@ -68,7 +68,7 @@ function xmlrpc_test_xmlrpc() {
-  if (variable_get('xmlrpc_test_xmlrpc_alter', FALSE)) {
+  if (state()->get('xmlrpc_test.xmlrpc_alter')) {

This needs a default value.

Otherwise looks fine.

I'm sorry I'm stupid. The state() system does not use default values like the variable system does. This needs to be converted to something like

$xmlrpc_alter = state()->get('xmlrpc_test.xmlrpc_alter') ?: FALSE;
if ($xmlrpc_alter) {

I'd rather not put the ternary in the if but that's just me.

I also wouldn't mind seeing the name changed to 'xmlrpc_test.alter' because the second xmlrpc seems redundant.

StatusFileSize
new1.89 KB
FAILED: [[SimpleTest]]: [MySQL] 48,723 pass(es), 1 fail(s), and 0 exception(s).
[ View ]

Fixes concerns in #3.

Status:Needs work» Needs review

I am forgetful.

Status:Needs review» Needs work

The last submitted patch, 1848066-xmlprc_to_state-drupal8-4.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new18.91 KB
FAILED: [[SimpleTest]]: [MySQL] 48,574 pass(es), 0 fail(s), and 2 exception(s).
[ View ]

Attached a patch with the changes requested.

I'm not sure why the state()->get needs a default value, as it was in the if statement and it will fail the conditional statement either with false or null?

Status:Needs review» Needs work

The last submitted patch, 1848066-xmlprc_to_state-drupal8-7.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new1.9 KB
PASSED: [[SimpleTest]]: [MySQL] 48,739 pass(es).
[ View ]

Stupid mistake on the last patch.

Status:Needs review» Reviewed & tested by the community

Ok good to go!

Category:feature» task
Status:Reviewed & tested by the community» Fixed

Committed and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.