Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
#2574969: Add a Views-like UI for adding fields added the preIndexSave()
method for processors.
However, even though we have otherwise great test coverage for our processors, this method seems to be completely untested.
We should make sure it works correctly for all processors that use it (and maybe the processor plugin base, which provides the ensureField()
and findField()
helper methods).
Comment | File | Size | Author |
---|---|---|---|
#9 | 2734897-9--test_preIndexSave.patch | 1.99 KB | drunken monkey |
|
Comments
Comment #2
drunken monkeyComment #3
niko- CreditAttribution: niko- at Adyax commentedComment #4
niko- CreditAttribution: niko- at Adyax commentedComment #6
niko- CreditAttribution: niko- at Adyax commentedComment #7
borisson_LGTM at first glance. Haven't looked in detail.
Comment #8
drunken monkeyThanks a lot for the patch!
However, I see that in the meantime tests were added for field renaming, which tests the functionality used in the highlight processor and the field processor base class. So only the content access processor remains (though I guess we can say that that is being tested implicitly by
ContentAccessTest
, which doesn't manually add those necessary fields for indexing).Adding a test for that to the processor integration test is easy enough, so let's just do that. I also refactored your code a bit, since I don't think it's necessary to test that the fields aren't there before the processor is added.
Comment #9
drunken monkeyRe-roll made necessary by #2753815: Port Simpletest web tests to BrowserTestBase tests.
Comment #10
drunken monkeyComment #11
borisson_Looks good to me!
Comment #13
drunken monkeyGreat, thanks for reviewing!
Committed.
Thanks again, niko-!