Comments

jonathan1055 created an issue. See original summary.

jonathan1055’s picture

Status: Active » Needs review
StatusFileSize
new15.9 KB

Patch #2 has the expanded tests. Some of these will fail, indicating where work is currently required.

Status: Needs review » Needs work
jonathan1055’s picture

Status: Needs work » Needs review
StatusFileSize
new15.78 KB
new1.67 KB

Failures exactly as expected.

Patch #4 has the failing but required cases commented out, and the non-required List Count test with the button press removed. These are anotated with @todo with the issue number where they can be un-commented.

jonathan1055’s picture

Good. All green. This will provide a much more solid base for Actions and Conditions changing/fixing/testing. Hopefully this is RTBC?

When committed, I will re-roll the patches on #2723259: Allow single-valued data selector input to be passed as an array for 'multiple' context fields and #3159876: Set assignment restrictor for two list and data conditions to demonstrate how those patches fix these tests. I will also re-roll that latest patch on #2471481: Integrate Typed Data Widgets which uses these tests to check for the correct widget.

tr’s picture

Looks good.

'1.2.3' ? I'm surprised the ban.ip_manager accepts that ... I changed it to use one of the test IP addresses (192.0.2.1) specified in https://tools.ietf.org/html/rfc5737

I also changes a few comments, but other than that this is great. I don't think I explained the $selector parameter right - can you correct that? Here's an interdiff and a new patch for the testbot to make sure I didn't mess up anything.

jonathan1055’s picture

StatusFileSize
new17.31 KB
new5.94 KB

Thanks for expanding the comments. Here's an explanation of my further changes:

  1. Yes, I have altered the description of the 'selectors' parameter. It specifies which fields need to have the button pressed to change to 'data selection' before the value is filled in, because those values are data selection values. Some of the forms do not need the press as the restrictor is already set to 'selection' so I could not make any inferences by looking at the field value supplied, therefore it was easiest to have a separate argument.
  2. I have added a couple more test cases to check both 'direct input' and 'data selection' when the choice is availbale, but I have not checked that every single double case is covered (I can do that later if required)
  3. Uncommented the List Count test now that #3159876: Set assignment restrictor for two list and data conditions is done
  4. Fixed a couple of places where a necessary empty 'widgets' parameter was missing before the 'selector' parameter. This is not tested in this issue, but would have added confusion in #2471481: Integrate Typed Data Widgets where the modified test does check this. (which will need a re-roll)

  • TR committed 68841b9 on 8.x-3.x authored by jonathan1055
    Issue #3160067 by jonathan1055: Refactor and expand ActionsFormTest and...
tr’s picture

Status: Needs review » Fixed

Looks good to me - thanks! Committed.

jonathan1055’s picture

Status: Fixed » Needs review
StatusFileSize
new13.49 KB

Thanks for the commit. I've looked at test data for other rules issues, and I'd remembered that I had used a $data array to hold the test data, instead of returning the values directly. This makes it much easier when developing/testing/debugging because it allows easy testing of just one case, or the testing of all cases except a few. The test data is the same, I have just added a key to the array, and expained this in the comment block.

I hope you can commit this, then I will work on the failing tests in other issues. Thanks.

jonathan1055’s picture

StatusFileSize
new13.5 KB
new1.27 KB

Spotted a couple of typos. Ignore #10, use #11. Thanks.

jonathan1055’s picture

Assigned: Unassigned » jonathan1055
Status: Needs review » Needs work

not ready for commit yet

jonathan1055’s picture

Status: Needs work » Needs review
StatusFileSize
new14.77 KB
new2.37 KB

To help with testing/debugging I have added an assertion that we do not see our most common error on saving "InvalidArgumentException: Cannot set a list with a non-array value". This helps to show what the fault is, because the phpunit failure will now identify this, instead of just showning "Error Message". This is still the fallback if that exception is not found. I also added more fields to a few of the list tests.

This is ready to commit now. I won't make any more tweaks.

jonathan1055’s picture

Status: Needs review » Reviewed & tested by the community

This is RTBC from within this issue. But there will be further changes required as discovered in #2664280-61: Select lists in action & condition configuration forms

@TR would you like me to merge in the small corrections from that issue, so that we have accurate tests now? The random values I added will probably cause problems elsewhere, so I think that would be a good idea to get them fixed here too, but wanted to check with you first.

  • TR committed 2502796 on 8.x-3.x authored by jonathan1055
    Issue #3160067 by jonathan1055, TR: Refactor and expand ActionsFormTest...
tr’s picture

Status: Reviewed & tested by the community » Fixed

We can fix any side-effects later, as they arise. Committed.

jonathan1055’s picture

That's fine. Thanks for the commit.

jonathan1055’s picture

Assigned: jonathan1055 » Unassigned

Unassigning

Status: Fixed » Closed (fixed)

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