Skip to content

Commit e5b70b9

Browse files
PHPLIB-880: Add comment option tests for distinct helper (#940)
Synced with mongodb/specifications@ba44473
1 parent 6bc7fa2 commit e5b70b9

File tree

1 file changed

+178
-0
lines changed

1 file changed

+178
-0
lines changed
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
{
2+
"description": "distinct-comment",
3+
"schemaVersion": "1.0",
4+
"createEntities": [
5+
{
6+
"client": {
7+
"id": "client0",
8+
"observeEvents": [
9+
"commandStartedEvent"
10+
]
11+
}
12+
},
13+
{
14+
"database": {
15+
"id": "database0",
16+
"client": "client0",
17+
"databaseName": "distinct-comment-tests"
18+
}
19+
},
20+
{
21+
"collection": {
22+
"id": "collection0",
23+
"database": "database0",
24+
"collectionName": "coll0"
25+
}
26+
}
27+
],
28+
"initialData": [
29+
{
30+
"collectionName": "coll0",
31+
"databaseName": "distinct-comment-tests",
32+
"documents": [
33+
{
34+
"_id": 1,
35+
"x": 11
36+
},
37+
{
38+
"_id": 2,
39+
"x": 22
40+
},
41+
{
42+
"_id": 3,
43+
"x": 33
44+
}
45+
]
46+
}
47+
],
48+
"tests": [
49+
{
50+
"description": "distinct with document comment",
51+
"runOnRequirements": [
52+
{
53+
"minServerVersion": "4.4.14"
54+
}
55+
],
56+
"operations": [
57+
{
58+
"name": "distinct",
59+
"object": "collection0",
60+
"arguments": {
61+
"fieldName": "x",
62+
"filter": {},
63+
"comment": {
64+
"key": "value"
65+
}
66+
},
67+
"expectResult": [ 11, 22, 33 ]
68+
}
69+
],
70+
"expectEvents": [
71+
{
72+
"client": "client0",
73+
"events": [
74+
{
75+
"commandStartedEvent": {
76+
"command": {
77+
"distinct": "coll0",
78+
"key": "x",
79+
"query": {},
80+
"comment": {
81+
"key": "value"
82+
}
83+
},
84+
"commandName": "distinct",
85+
"databaseName": "distinct-comment-tests"
86+
}
87+
}
88+
]
89+
}
90+
]
91+
},
92+
{
93+
"description": "distinct with string comment",
94+
"runOnRequirements": [
95+
{
96+
"minServerVersion": "4.4.0"
97+
}
98+
],
99+
"operations": [
100+
{
101+
"name": "distinct",
102+
"object": "collection0",
103+
"arguments": {
104+
"fieldName": "x",
105+
"filter": {},
106+
"comment": "comment"
107+
},
108+
"expectResult": [ 11, 22, 33 ]
109+
}
110+
],
111+
"expectEvents": [
112+
{
113+
"client": "client0",
114+
"events": [
115+
{
116+
"commandStartedEvent": {
117+
"command": {
118+
"distinct": "coll0",
119+
"key": "x",
120+
"query": {},
121+
"comment": "comment"
122+
},
123+
"commandName": "distinct",
124+
"databaseName": "distinct-comment-tests"
125+
}
126+
}
127+
]
128+
}
129+
]
130+
},
131+
{
132+
"description": "distinct with document comment - pre 4.4, server error",
133+
"runOnRequirements": [
134+
{
135+
"minServerVersion": "3.6.0",
136+
"maxServerVersion": "4.4.13"
137+
}
138+
],
139+
"operations": [
140+
{
141+
"name": "distinct",
142+
"object": "collection0",
143+
"arguments": {
144+
"fieldName": "x",
145+
"filter": {},
146+
"comment": {
147+
"key": "value"
148+
}
149+
},
150+
"expectError": {
151+
"isClientError": false
152+
}
153+
}
154+
],
155+
"expectEvents": [
156+
{
157+
"client": "client0",
158+
"events": [
159+
{
160+
"commandStartedEvent": {
161+
"command": {
162+
"distinct": "coll0",
163+
"key": "x",
164+
"query": {},
165+
"comment": {
166+
"key": "value"
167+
}
168+
},
169+
"commandName": "distinct",
170+
"databaseName": "distinct-comment-tests"
171+
}
172+
}
173+
]
174+
}
175+
]
176+
}
177+
]
178+
}

0 commit comments

Comments
 (0)