Closed pavellishin closed 5 years ago
@pavellishin I wouldn't be bothered by mocking Solarium for this. You could abstract the parsing logic to a dedicated method if you wanted to write some simple unit tests for it.
@danielbachhuber that's not a bad idea. I think I'd still want to add a test to ensure that SolrPower_Sync::post
returning false invokes the error handler, but yanking that out would make it more easily extensible if there's more useful error messaging we can yank out of a response.
@pavellishin On second thought, I think this PR looks fine as-is. Are you happy with it?
@danielbachhuber yeah - I think your suggestion about pulling code out is good, but I could spend hours making little fixes forever :)
The
<title>
tags typically don't have any useful diagnostic information, but the<h1>
tags do - so parse those out first!