Closed (fixed)
Project:
Apache Solr Search
Version:
6.x-3.x-dev
Component:
Code
Priority:
Minor
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
1 Aug 2012 at 14:55 UTC
Updated:
2 Oct 2012 at 01:31 UTC
Jump to comment: Most recent file
Comments
Comment #1
ianthomas_ukComment #2
ianthomas_ukComment #3
alanmackenzie commented+1 very sensible.
A couple of minor points:
We can remove the entire if statement checking if is_array() isn't true now.
This parameter should have a description to be 100% coding standards compliant. e.g.
Comment #4
ianthomas_ukThis patch addresses Alan's points
Comment #5
nick_vhGreat work, let's see if the test succeeds and we can start committing some of the patches you guys made :-)
Comment #6
ianthomas_ukIs this ready to commit?
Comment #7
pwolanin commentedDrupalApacheSolrService needs to be an interface not the concrete class - I'm confused as to why this doesn't break the tests using the Dummysolr class.
Comment #8
pwolanin commentedseems we don' have an interface at the moment, so we need to either define one, or not type hit DrupalApacheSolrService
Comment #9
ianthomas_ukHere is a version with an interface (just a straight copy of the class, including docs and copyright, with function bodies removed - let me know if I should do anything else).
Comment #11
ianthomas_ukComment #13
ianthomas_ukComment #15
ianthomas_ukOK, that failed because the Dummy_Solr class doesn't implement the new interface.
I'm not too familiar with unit tests, so I'm not sure what the correct fix should be, but extending the real class makes sense to me.
Comment #17
pwolanin commentedBetter would be to make the dummy (mock) class implement the interface independently. That would be a good basis for more unit testing in any case.
Comment #18
nick_vhComment #19
nick_vhComment #21
nick_vh#18: 1708150-18.patch queued for re-testing.
Comment #22
nick_vhComment #23
ianthomas_ukThanks for finishing that off for me, I wasn't sure what to do with the failures of #15 as the test suite wasn't very specific about the error. Is there a way to get a better error message (setting up tests locally?), or did you just work out the problem from the code?
You've still got DummySolr extending DrupalApacheSolrService - is that intentional? It seems redundant to implement an interface that the parent class implements, but also seems a lot of work to need to re-implement all the methods.
Comment #24
pwolanin commentedUgh, that's wrong we should not do that - it should just implement the interface, even if the functions are no-op for now.
Comment #25
pwolanin commentedHere's a new patch that move some helper functions out of the interface - either to private, or just let them be helpers that aren't part of the interface.
Comment #26
pwolanin commentedcommitted to 7.x
Comment #27
pwolanin commentedcombined 6.x-3.x patch.
Comment #28
pwolanin commentedpatch splitting out part to #1786450: apachesolr.interface.inc is not always loaded
That has to be applied at the same time
Comment #29
pwolanin commentedcommitted