mirror of
https://codeberg.org/icewind/SearchDAV.git
synced 2026-06-03 17:44:06 +02:00
add query parser tests
This commit is contained in:
parent
3f23e989f0
commit
5f6b358839
5 changed files with 107 additions and 2 deletions
|
|
@ -26,9 +26,23 @@ use Sabre\Xml\Reader;
|
|||
use Sabre\Xml\XmlDeserializable;
|
||||
|
||||
class Literal implements XmlDeserializable {
|
||||
/** @var string|boolean|\DateTime|integer */
|
||||
/**
|
||||
* @var string|boolean|\DateTime|integer
|
||||
*
|
||||
* The value of the literal
|
||||
*/
|
||||
public $value;
|
||||
|
||||
/**
|
||||
* Literal constructor.
|
||||
*
|
||||
* @param bool|\DateTime|int|string $value
|
||||
*/
|
||||
public function __construct($value = '') {
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
|
||||
static function xmlDeserialize(Reader $reader) {
|
||||
$literal = new self();
|
||||
|
||||
|
|
|
|||
|
|
@ -58,6 +58,18 @@ class Operator implements XmlDeserializable {
|
|||
*/
|
||||
public $arguments;
|
||||
|
||||
/**
|
||||
* Operator constructor.
|
||||
*
|
||||
* @param string $type
|
||||
* @param array $arguments
|
||||
*/
|
||||
public function __construct($type = '', array $arguments = []) {
|
||||
$this->type = $type;
|
||||
$this->arguments = $arguments;
|
||||
}
|
||||
|
||||
|
||||
static function xmlDeserialize(Reader $reader) {
|
||||
$operator = new self();
|
||||
|
||||
|
|
|
|||
|
|
@ -42,6 +42,17 @@ class Order implements XmlDeserializable {
|
|||
*/
|
||||
public $order;
|
||||
|
||||
/**
|
||||
* Order constructor.
|
||||
*
|
||||
* @param string $property
|
||||
* @param string $order
|
||||
*/
|
||||
public function __construct($property = '', $order = self::ASC) {
|
||||
$this->property = $property;
|
||||
$this->order = $order;
|
||||
}
|
||||
|
||||
static function xmlDeserialize(Reader $reader) {
|
||||
$order = new self();
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,8 @@ class Scope implements XmlDeserializable {
|
|||
/**
|
||||
* @var string
|
||||
*
|
||||
* The absolute url of the search scope
|
||||
* The scope of the search, either as absolute uri or as a path relative to the
|
||||
* search arbiter.
|
||||
*/
|
||||
public $href;
|
||||
|
||||
|
|
@ -42,6 +43,15 @@ class Scope implements XmlDeserializable {
|
|||
*/
|
||||
public $depth;
|
||||
|
||||
/**
|
||||
* @param string $href
|
||||
* @param int|string $depth
|
||||
*/
|
||||
public function __construct($href = '', $depth = 1) {
|
||||
$this->href = $href;
|
||||
$this->depth = $depth;
|
||||
}
|
||||
|
||||
static function xmlDeserialize(Reader $reader) {
|
||||
$scope = new self();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue