mirror of
https://codeberg.org/icewind/SearchDAV.git
synced 2026-06-03 17:44:06 +02:00
fix travis
This commit is contained in:
parent
695bb7c694
commit
d609774b97
6 changed files with 11 additions and 39 deletions
|
|
@ -4,8 +4,12 @@ php:
|
||||||
- '7.0'
|
- '7.0'
|
||||||
- '7.1'
|
- '7.1'
|
||||||
|
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- $HOME/.composer/cache/files
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- composer install --dev --no-interaction
|
- composer install --no-interaction
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- cd tests
|
- cd tests
|
||||||
|
|
|
||||||
|
|
@ -34,11 +34,11 @@ class DummyBackend implements ISearchBackend {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isValidScope($href, $depth) {
|
public function isValidScope($href, $depth, $path) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPropertyDefinitionsForScope($href) {
|
public function getPropertyDefinitionsForScope($href, $path) {
|
||||||
return [
|
return [
|
||||||
new SearchPropertyDefinition('{DAV:}getcontentlength', true, true, true, SearchPropertyDefinition::DATATYPE_NONNEGATIVE_INTEGER),
|
new SearchPropertyDefinition('{DAV:}getcontentlength', true, true, true, SearchPropertyDefinition::DATATYPE_NONNEGATIVE_INTEGER),
|
||||||
new SearchPropertyDefinition('{DAV:}getcontenttype', true, true, true),
|
new SearchPropertyDefinition('{DAV:}getcontenttype', true, true, true),
|
||||||
|
|
@ -47,7 +47,7 @@ class DummyBackend implements ISearchBackend {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function search(INode $searchNode, BasicSearch $query) {
|
public function search(BasicSearch $query) {
|
||||||
return [
|
return [
|
||||||
new SearchResult(new SimpleFile('foo.txt', 'foobar', 'text/plain'), '/bar/foo.txt')
|
new SearchResult(new SimpleFile('foo.txt', 'foobar', 'text/plain'), '/bar/foo.txt')
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -77,15 +77,6 @@ class QueryParserTest extends \PHPUnit_Framework_TestCase {
|
||||||
$this->assertEquals([], $search->orderBy);
|
$this->assertEquals([], $search->orderBy);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @expectedException \Sabre\XML\ParseException
|
|
||||||
*/
|
|
||||||
public function testParseNoWhere() {
|
|
||||||
$query = file_get_contents(__DIR__ . '/nowhere.xml');
|
|
||||||
$parser = new QueryParser();
|
|
||||||
$parser->parse($query, null, $rootElementName);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException \Sabre\XML\ParseException
|
* @expectedException \Sabre\XML\ParseException
|
||||||
*/
|
*/
|
||||||
|
|
@ -94,13 +85,4 @@ class QueryParserTest extends \PHPUnit_Framework_TestCase {
|
||||||
$parser = new QueryParser();
|
$parser = new QueryParser();
|
||||||
$parser->parse($query, null, $rootElementName);
|
$parser->parse($query, null, $rootElementName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @expectedException \Sabre\XML\ParseException
|
|
||||||
*/
|
|
||||||
public function testParseNoSelect() {
|
|
||||||
$query = file_get_contents(__DIR__ . '/noselect.xml');
|
|
||||||
$parser = new QueryParser();
|
|
||||||
$parser->parse($query, null, $rootElementName);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
3
tests/bootstrap.php
Normal file
3
tests/bootstrap.php
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
require '../vendor/autoload.php';
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
require_once '../vendor/autoload.php';
|
|
||||||
|
|
||||||
$parser = new \SearchDAV\DAV\QueryParser();
|
|
||||||
|
|
||||||
$body = file_get_contents('./basicquery.xml');
|
|
||||||
|
|
||||||
var_dump($parser->parse($body)['{DAV:}basicsearch']);
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
require_once __DIR__ . '/../vendor/autoload.php';
|
|
||||||
|
|
||||||
$server = new \Sabre\DAV\Server();
|
|
||||||
$server->addPlugin(new \SearchDAV\DAV\SearchPlugin(new \SearchDAV\Test\DummyBackend()));
|
|
||||||
|
|
||||||
$server->exec();
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue