Active
Project:
Search API
Version:
8.x-1.x-dev
Component:
Tests
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
31 Dec 2018 at 11:54 UTC
Updated:
21 Feb 2019 at 09:38 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
legolasboWorking on this
Comment #3
legolasboAttached patch adds coverage for the SearchApiTerm argument plugin.
Comment #4
borisson_I think testing this with a kernel test is sufficient, I don't think we should add an integration test for this as well.
Comment #5
legolasboI noticed there were some coding standards violations in my patch. This patch fixes that. Leaving the issue at RTBC since the change is so minor.
Comment #6
borisson_I think this should be in the other direction, ie:
The test vocabulary
@var ...
Comment #7
legolasboYou're right!
Comment #8
drunken monkeyThanks a lot for your work, looks pretty good already!
Just two small complaints:
I think this should just be called
SearchApiTermArgumentTestand live in the (existing)Drupal\tests\search_api\Kernel\Viewsnamespace. Adding three levels of namespace with just a single class doesn’t seem sensible.If we get enough test classes for single plugins, we can still move them to a sub-namespace later.
I know it’s a static method, but assertions are still called dynamically (i.e., via
$this->assert_()) nearly exclusively. For consistency, I’d therefore also prefer this here. (Same for all other assertions.)I disagree, with this issue I actually had an integration test in mind. We now have three different taxonomy-related Views plugins, it would have seemed sensible adding a single integration test for all of them, like we have one for most other plugins in
ViewsTest::testView().Getting coverage through Kernel tests is of course also great, but since in this case we override just a single method, it’s clear that this has no chance of uncovering all problems we might run into in the future. This depends a lot on Views internals, our own traits, etc., and I think we make sure the overall functionality remains working, not just the one method we actually override in the plugin classes (two, now, with
SearchApiAllTerms).So, while I’ll surely also commit this Kernel test, I wouldn’t consider this issue fixed until we have an integration test for at least part of this functionality. It shouldn’t be too difficult, just needs a test setup that also includes taxonomy terms.
Comment #9
legolasboFeedback addressed.
Comment #10
drunken monkeyAlright, thanks!
Then just a few nit-picks on my part. If those are fine with you, I’ll commit this (and set back to “Active“ for the integration test – if I remember).
Comment #11
legolasboNits are fine by me :)
Comment #12
drunken monkeyAlright, committed.
Thanks again!
Setting back to “Active” for the integration test.