-
Notifications
You must be signed in to change notification settings - Fork 0
/
testdata.php
75 lines (67 loc) · 1.64 KB
/
testdata.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
return [
'eq and numbers' => [
'rql' => 'eq(id,1)',
'valid' => true,
],
'eq and strings' => [
'rql' => 'eq(id,a)',
'valid' => true,
],
'in and numbers' => [
'rql' => 'in(id,[1,2,3])',
'valid' => false,
],
'in and strings' => [
'rql' => 'in(id,[a,b,c])',
'valid' => true,
],
'eq and strings with special chars' => [
'rql' => 'eq(id,a-1),eq(id,b+2),eq(id,c:3)',
'valid' => false,
],
'in and strings with special chars' => [
'rql' => 'in(id,[a-1,b+2,c:3])',
'valid' => false,
],
'missing limit' => [
'rql' => 'eq(id,1),sort(+a,-b),limit(1,2)',
'valid' => false,
],
'missing sort' => [
'rql' => 'eq(id,1),limit(1,2),sort(+a,-b)',
'valid' => false,
],
'missing query' => [
'rql' => 'sort(+a,-b),eq(id,1)',
'valid' => false,
],
'correct limit' => [
'rql' => 'limit(1)',
'valid' => true,
],
'correct limit and offset' => [
'rql' => 'limit(1,2)',
'valid' => true,
],
'more limit arguments' => [
'rql' => 'limit(1,2,3)',
'valid' => false,
],
'string as fields in limit' => [
'rql' => 'limit(a,b)',
'valid' => false,
],
'operator names in sort 1' => [
'rql' => 'sort(+eq1,-ne1)',
'valid' => true,
],
'operator names in sort 2' => [
'rql' => 'sort(+eq,-ne)',
'valid' => false,
],
'operator names as strings' => [
'rql' => 'eq(id,gt)',
'valid' => false,
],
];