mirror of
https://github.com/silverstripe/silverstripe-fulltextsearch
synced 2024-10-22 14:05:29 +02:00
Merge pull request #105 from helpfulrobot/convert-to-psr-2
Converted to PSR-2
This commit is contained in:
commit
db4d73a5b1
@ -292,7 +292,7 @@ abstract class SearchIndex extends ViewableData
|
|||||||
if (preg_match('/^(\w+)\(/', $type, $match)) {
|
if (preg_match('/^(\w+)\(/', $type, $match)) {
|
||||||
$type = $match[1];
|
$type = $match[1];
|
||||||
}
|
}
|
||||||
list($type, $args) = Object::parse_class_spec($type);
|
list($type, $args) = Object::parse_class_spec($type);
|
||||||
if (is_subclass_of($type, 'StringField')) {
|
if (is_subclass_of($type, 'StringField')) {
|
||||||
$this->addFulltextField($field);
|
$this->addFulltextField($field);
|
||||||
}
|
}
|
||||||
|
@ -120,9 +120,9 @@ class SolrIndexTest extends SapphireTest
|
|||||||
->search(
|
->search(
|
||||||
'+term',
|
'+term',
|
||||||
\Hamcrest_Matchers::anything(),
|
\Hamcrest_Matchers::anything(),
|
||||||
\Hamcrest_Matchers::anything(),
|
\Hamcrest_Matchers::anything(),
|
||||||
$matcher,
|
$matcher,
|
||||||
\Hamcrest_Matchers::anything()
|
\Hamcrest_Matchers::anything()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,11 +131,11 @@ class SolrIndexTest extends SapphireTest
|
|||||||
$serviceMock = $this->getServiceMock();
|
$serviceMock = $this->getServiceMock();
|
||||||
Phockito::when($serviceMock)->search(
|
Phockito::when($serviceMock)->search(
|
||||||
\Hamcrest_Matchers::anything(),
|
\Hamcrest_Matchers::anything(),
|
||||||
\Hamcrest_Matchers::anything(),
|
\Hamcrest_Matchers::anything(),
|
||||||
\Hamcrest_Matchers::anything(),
|
\Hamcrest_Matchers::anything(),
|
||||||
\Hamcrest_Matchers::anything(),
|
\Hamcrest_Matchers::anything(),
|
||||||
\Hamcrest_Matchers::anything()
|
\Hamcrest_Matchers::anything()
|
||||||
)->return($this->getFakeRawSolrResponse());
|
)->return($this->getFakeRawSolrResponse());
|
||||||
|
|
||||||
$index = new SolrIndexTest_FakeIndex();
|
$index = new SolrIndexTest_FakeIndex();
|
||||||
$index->setService($serviceMock);
|
$index->setService($serviceMock);
|
||||||
@ -151,10 +151,10 @@ class SolrIndexTest extends SapphireTest
|
|||||||
Phockito::verify(
|
Phockito::verify(
|
||||||
$serviceMock)->search(
|
$serviceMock)->search(
|
||||||
'+(Field1:term^1.5 OR HasOneObject_Field1:term^3)',
|
'+(Field1:term^1.5 OR HasOneObject_Field1:term^3)',
|
||||||
\Hamcrest_Matchers::anything(),
|
\Hamcrest_Matchers::anything(),
|
||||||
\Hamcrest_Matchers::anything(),
|
\Hamcrest_Matchers::anything(),
|
||||||
\Hamcrest_Matchers::not(\Hamcrest_Matchers::hasKeyInArray('hl.q')),
|
\Hamcrest_Matchers::not(\Hamcrest_Matchers::hasKeyInArray('hl.q')),
|
||||||
\Hamcrest_Matchers::anything()
|
\Hamcrest_Matchers::anything()
|
||||||
);
|
);
|
||||||
|
|
||||||
// Search with highlighting
|
// Search with highlighting
|
||||||
@ -168,10 +168,10 @@ class SolrIndexTest extends SapphireTest
|
|||||||
Phockito::verify(
|
Phockito::verify(
|
||||||
$serviceMock)->search(
|
$serviceMock)->search(
|
||||||
'+(Field1:term^1.5 OR HasOneObject_Field1:term^3)',
|
'+(Field1:term^1.5 OR HasOneObject_Field1:term^3)',
|
||||||
\Hamcrest_Matchers::anything(),
|
\Hamcrest_Matchers::anything(),
|
||||||
\Hamcrest_Matchers::anything(),
|
\Hamcrest_Matchers::anything(),
|
||||||
\Hamcrest_Matchers::hasKeyInArray('hl.q'),
|
\Hamcrest_Matchers::hasKeyInArray('hl.q'),
|
||||||
\Hamcrest_Matchers::anything()
|
\Hamcrest_Matchers::anything()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user