The \Drupal\search_api\Tests\ProcessorIntegrationTest currently has tests for all our processors (as far as I can see), except for "Role filter". (There is also a @todo comment for this.)
Should be easy to add, based on all the existing methods.

Comments

drunken monkey created an issue. See original summary.

felribeiro’s picture

Status: Active » Needs review
StatusFileSize
new1.32 KB
borisson_’s picture

This tests only tests if the processor is enabled, but not the actual behavior, not sure if want to test that as well.

drunken monkey’s picture

Status: Needs review » Needs work

Thanks a lot for the patch, good start!
As Joris says, though, this should also test filling out the configuration form with editSettingsForm(). (See, e.g., checkStopWordsIntegration().)
Also, the patch should remove the @todo about this issue from the top of the file.

cebasqueira’s picture

Assigned: Unassigned » cebasqueira
cebasqueira’s picture

Assigned: cebasqueira » Unassigned
dermario’s picture

Assigned: Unassigned » dermario

I will have a look at it the upcoming week.

dermario’s picture

Status: Needs work » Needs review
StatusFileSize
new1.85 KB

This is a manual reroll of #2 as the test class was moved to Functional tests meanwhile. I also fixed the incorrect namespace. After doing so, i was able to run these tests on my local. Lets see what the testbot says. If the test is green, i would like to test if the role filter does what it is supposed to do.

dermario’s picture

StatusFileSize
new2.18 KB
new837 bytes

Ok i did not check if the role filter actually filters users by roles, because no check* Method does that in ProcessorIntegrationTest. Maybe that should be handled in a different way?
As suggested in #4 by @drunken monkey the configuration form is filled out and one @todo was removed.

borisson_’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Novice

Looks good, thanks @dermario!

drunken monkey’s picture

StatusFileSize
new2.06 KB

Re-roll.

Testing of the actual functionality is already done in RoleFilterTest, so that's covered. In the integration test, we really just want to make sure things do not go BOOM in the UI for some reason.

drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Sorry, my bad. Got ahead of myself and had #2656052: Remove the "plugin_id"/"settings" sub-level of index plugin settings already committed locally. (Would be great if you could take a look at that, Joris!)
The patch in #9 is already great – thanks a lot!
Committed.
Thanks again, everyone!

Status: Fixed » Closed (fixed)

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