Skip to content

Commit c6cb6d1

Browse files
committed
Sync unified CRUD spec tests
Synced with mongodb/specifications@59a5dad Note: aggregate tests are intentionally excluded since those will be synced by mongodb#854
1 parent 57cd7e0 commit c6cb6d1

24 files changed

+3480
-1645
lines changed

tests/UnifiedSpecTests/UnifiedSpecTest.php

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,6 @@ class UnifiedSpecTest extends FunctionalTestCase
2121
{
2222
/** @var array */
2323
private static $incompleteTests = [
24-
// PHPLIB-573 and DRIVERS-1340
25-
'crud/unacknowledged-bulkWrite-delete-hint-clientError: Unacknowledged bulkWrite deleteOne with hints fails with client-side error' => 'PHPLIB-573 and DRIVERS-1340',
26-
'crud/unacknowledged-bulkWrite-delete-hint-clientError: Unacknowledged bulkWrite deleteMany with hints fails with client-side error' => 'PHPLIB-573 and DRIVERS-1340',
27-
'crud/unacknowledged-bulkWrite-update-hint-clientError: Unacknowledged bulkWrite updateOne with hints fails with client-side error' => 'PHPLIB-573 and DRIVERS-1340',
28-
'crud/unacknowledged-bulkWrite-update-hint-clientError: Unacknowledged bulkWrite updateMany with hints fails with client-side error' => 'PHPLIB-573 and DRIVERS-1340',
29-
'crud/unacknowledged-bulkWrite-update-hint-clientError: Unacknowledged bulkWrite replaceOne with hints fails with client-side error' => 'PHPLIB-573 and DRIVERS-1340',
30-
'crud/unacknowledged-deleteMany-hint-clientError: Unacknowledged deleteMany with hint string fails with client-side error' => 'PHPLIB-573 and DRIVERS-1340',
31-
'crud/unacknowledged-deleteMany-hint-clientError: Unacknowledged deleteMany with hint document fails with client-side error' => 'PHPLIB-573 and DRIVERS-1340',
32-
'crud/unacknowledged-deleteOne-hint-clientError: Unacknowledged deleteOne with hint string fails with client-side error' => 'PHPLIB-573 and DRIVERS-1340',
33-
'crud/unacknowledged-deleteOne-hint-clientError: Unacknowledged deleteOne with hint document fails with client-side error' => 'PHPLIB-573 and DRIVERS-1340',
34-
'crud/unacknowledged-findOneAndDelete-hint-clientError: Unacknowledged findOneAndDelete with hint string fails with client-side error' => 'PHPLIB-573 and DRIVERS-1340',
35-
'crud/unacknowledged-findOneAndDelete-hint-clientError: Unacknowledged findOneAndDelete with hint document fails with client-side error' => 'PHPLIB-573 and DRIVERS-1340',
36-
'crud/unacknowledged-findOneAndReplace-hint-clientError: Unacknowledged findOneAndReplace with hint string fails with client-side error' => 'PHPLIB-573 and DRIVERS-1340',
37-
'crud/unacknowledged-findOneAndReplace-hint-clientError: Unacknowledged findOneAndReplace with hint document fails with client-side error' => 'PHPLIB-573 and DRIVERS-1340',
38-
'crud/unacknowledged-findOneAndUpdate-hint-clientError: Unacknowledged findOneAndUpdate with hint string fails with client-side error' => 'PHPLIB-573 and DRIVERS-1340',
39-
'crud/unacknowledged-findOneAndUpdate-hint-clientError: Unacknowledged findOneAndUpdate with hint document fails with client-side error' => 'PHPLIB-573 and DRIVERS-1340',
40-
'crud/unacknowledged-replaceOne-hint-clientError: Unacknowledged ReplaceOne with hint string fails with client-side error' => 'PHPLIB-573 and DRIVERS-1340',
41-
'crud/unacknowledged-replaceOne-hint-clientError: Unacknowledged ReplaceOne with hint document fails with client-side error' => 'PHPLIB-573 and DRIVERS-1340',
42-
'crud/unacknowledged-updateMany-hint-clientError: Unacknowledged updateMany with hint string fails with client-side error' => 'PHPLIB-573 and DRIVERS-1340',
43-
'crud/unacknowledged-updateMany-hint-clientError: Unacknowledged updateMany with hint document fails with client-side error' => 'PHPLIB-573 and DRIVERS-1340',
44-
'crud/unacknowledged-updateOne-hint-clientError: Unacknowledged updateOne with hint string fails with client-side error' => 'PHPLIB-573 and DRIVERS-1340',
45-
'crud/unacknowledged-updateOne-hint-clientError: Unacknowledged updateOne with hint document fails with client-side error' => 'PHPLIB-573 and DRIVERS-1340',
4624
// PHPC does not implement CMAP
4725
'valid-pass/assertNumberConnectionsCheckedOut: basic assertion succeeds' => 'PHPC does not implement CMAP',
4826
'valid-pass/entity-client-cmap-events: events are captured during an operation' => 'PHPC does not implement CMAP',
Lines changed: 269 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,269 @@
1+
{
2+
"description": "bulkWrite-deleteMany-hint-unacknowledged",
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": "db0"
18+
}
19+
},
20+
{
21+
"collection": {
22+
"id": "collection0",
23+
"database": "database0",
24+
"collectionName": "coll0",
25+
"collectionOptions": {
26+
"writeConcern": {
27+
"w": 0
28+
}
29+
}
30+
}
31+
}
32+
],
33+
"initialData": [
34+
{
35+
"collectionName": "coll0",
36+
"databaseName": "db0",
37+
"documents": [
38+
{
39+
"_id": 1,
40+
"x": 11
41+
},
42+
{
43+
"_id": 2,
44+
"x": 22
45+
},
46+
{
47+
"_id": 3,
48+
"x": 33
49+
}
50+
]
51+
}
52+
],
53+
"tests": [
54+
{
55+
"description": "Unacknowledged deleteMany with hint string fails with client-side error on pre-4.4 server",
56+
"runOnRequirements": [
57+
{
58+
"maxServerVersion": "4.2.99"
59+
}
60+
],
61+
"operations": [
62+
{
63+
"object": "collection0",
64+
"name": "bulkWrite",
65+
"arguments": {
66+
"requests": [
67+
{
68+
"deleteMany": {
69+
"filter": {
70+
"_id": {
71+
"$gt": 1
72+
}
73+
},
74+
"hint": "_id_"
75+
}
76+
}
77+
]
78+
},
79+
"expectError": {
80+
"isClientError": true
81+
}
82+
}
83+
],
84+
"expectEvents": [
85+
{
86+
"client": "client0",
87+
"events": []
88+
}
89+
]
90+
},
91+
{
92+
"description": "Unacknowledged deleteMany with hint document fails with client-side error on pre-4.4 server",
93+
"runOnRequirements": [
94+
{
95+
"maxServerVersion": "4.2.99"
96+
}
97+
],
98+
"operations": [
99+
{
100+
"object": "collection0",
101+
"name": "bulkWrite",
102+
"arguments": {
103+
"requests": [
104+
{
105+
"deleteMany": {
106+
"filter": {
107+
"_id": {
108+
"$gt": 1
109+
}
110+
},
111+
"hint": {
112+
"_id": 1
113+
}
114+
}
115+
}
116+
]
117+
},
118+
"expectError": {
119+
"isClientError": true
120+
}
121+
}
122+
],
123+
"expectEvents": [
124+
{
125+
"client": "client0",
126+
"events": []
127+
}
128+
]
129+
},
130+
{
131+
"description": "Unacknowledged deleteMany with hint string on 4.4+ server",
132+
"runOnRequirements": [
133+
{
134+
"minServerVersion": "4.4.0"
135+
}
136+
],
137+
"operations": [
138+
{
139+
"object": "collection0",
140+
"name": "bulkWrite",
141+
"arguments": {
142+
"requests": [
143+
{
144+
"deleteMany": {
145+
"filter": {
146+
"_id": {
147+
"$gt": 1
148+
}
149+
},
150+
"hint": "_id_"
151+
}
152+
}
153+
]
154+
},
155+
"expectResult": {
156+
"$$unsetOrMatches": {
157+
"acknowledged": {
158+
"$$unsetOrMatches": false
159+
}
160+
}
161+
}
162+
}
163+
],
164+
"expectEvents": [
165+
{
166+
"client": "client0",
167+
"events": [
168+
{
169+
"commandStartedEvent": {
170+
"command": {
171+
"delete": "coll0",
172+
"deletes": [
173+
{
174+
"q": {
175+
"_id": {
176+
"$gt": 1
177+
}
178+
},
179+
"hint": {
180+
"$$type": [
181+
"string",
182+
"object"
183+
]
184+
},
185+
"limit": 0
186+
}
187+
],
188+
"writeConcern": {
189+
"w": 0
190+
}
191+
}
192+
}
193+
}
194+
]
195+
}
196+
]
197+
},
198+
{
199+
"description": "Unacknowledged deleteMany with hint document on 4.4+ server",
200+
"runOnRequirements": [
201+
{
202+
"minServerVersion": "4.4.0"
203+
}
204+
],
205+
"operations": [
206+
{
207+
"object": "collection0",
208+
"name": "bulkWrite",
209+
"arguments": {
210+
"requests": [
211+
{
212+
"deleteMany": {
213+
"filter": {
214+
"_id": {
215+
"$gt": 1
216+
}
217+
},
218+
"hint": {
219+
"_id": 1
220+
}
221+
}
222+
}
223+
]
224+
},
225+
"expectResult": {
226+
"$$unsetOrMatches": {
227+
"acknowledged": {
228+
"$$unsetOrMatches": false
229+
}
230+
}
231+
}
232+
}
233+
],
234+
"expectEvents": [
235+
{
236+
"client": "client0",
237+
"events": [
238+
{
239+
"commandStartedEvent": {
240+
"command": {
241+
"delete": "coll0",
242+
"deletes": [
243+
{
244+
"q": {
245+
"_id": {
246+
"$gt": 1
247+
}
248+
},
249+
"hint": {
250+
"$$type": [
251+
"string",
252+
"object"
253+
]
254+
},
255+
"limit": 0
256+
}
257+
],
258+
"writeConcern": {
259+
"w": 0
260+
}
261+
}
262+
}
263+
}
264+
]
265+
}
266+
]
267+
}
268+
]
269+
}

0 commit comments

Comments
 (0)