mirror of
https://codeberg.org/icewind/SearchDAV.git
synced 2026-06-03 09:34:08 +02:00
"where" is optional
This commit is contained in:
parent
e8cf5e7644
commit
aeb7610589
3 changed files with 15 additions and 11 deletions
|
|
@ -348,6 +348,7 @@ class SearchPluginTest extends \PHPUnit_Framework_TestCase {
|
|||
->method('getArbiterPath')
|
||||
->willReturn('foo');
|
||||
|
||||
$lengthProp = new SearchPropertyDefinition('{DAV:}getcontentlength', true, true, true, SearchPropertyDefinition::DATATYPE_NONNEGATIVE_INTEGER);
|
||||
$plugin = new SearchPlugin($this->searchBackend);
|
||||
$server = new Server();
|
||||
$plugin->initialize($server);
|
||||
|
|
@ -363,12 +364,20 @@ class SearchPluginTest extends \PHPUnit_Framework_TestCase {
|
|||
->method('isValidScope')
|
||||
->willReturn(true);
|
||||
|
||||
$this->searchBackend->expects($this->never())
|
||||
->method('search');
|
||||
$this->searchBackend->expects($this->any())
|
||||
->method('getPropertyDefinitionsForScope')
|
||||
->willReturn([$lengthProp]);
|
||||
|
||||
$this->searchBackend->expects($this->once())
|
||||
->method('search')
|
||||
->willReturnCallback(function(Query $query) {
|
||||
$this->assertNull($query->where);
|
||||
return [];
|
||||
});
|
||||
|
||||
$plugin->searchHandler($request, $response);
|
||||
|
||||
$this->assertEquals(400, $response->getStatus());
|
||||
$this->assertEquals(207, $response->getStatus());
|
||||
}
|
||||
|
||||
public function testSearchQueryNoSelect() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue