Skip to content

Commit b395df7

Browse files
committed
Sync unified CRUD spec tests
Synced with mongodb/specifications#1057 Note: aggregate tests are intentionally excluded since those will be synced by mongodb#854
1 parent 0de266b commit b395df7

22 files changed

+3027
-1309
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',

tests/UnifiedSpecTests/crud/unacknowledged-bulkWrite-delete-hint-clientError.json renamed to tests/UnifiedSpecTests/crud/bulkWrite-deleteMany-hint-unacknowledged.json

Lines changed: 125 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"description": "unacknowledged-bulkWrite-delete-hint-clientError",
2+
"description": "bulkWrite-deleteMany-hint-unacknowledged",
33
"schemaVersion": "1.0",
44
"createEntities": [
55
{
@@ -14,14 +14,14 @@
1414
"database": {
1515
"id": "database0",
1616
"client": "client0",
17-
"databaseName": "crud-v2"
17+
"databaseName": "db0"
1818
}
1919
},
2020
{
2121
"collection": {
2222
"id": "collection0",
2323
"database": "database0",
24-
"collectionName": "BulkWrite_delete_hint",
24+
"collectionName": "coll0",
2525
"collectionOptions": {
2626
"writeConcern": {
2727
"w": 0
@@ -32,8 +32,8 @@
3232
],
3333
"initialData": [
3434
{
35-
"collectionName": "BulkWrite_delete_hint",
36-
"databaseName": "crud-v2",
35+
"collectionName": "coll0",
36+
"databaseName": "db0",
3737
"documents": [
3838
{
3939
"_id": 1,
@@ -46,46 +46,38 @@
4646
{
4747
"_id": 3,
4848
"x": 33
49-
},
50-
{
51-
"_id": 4,
52-
"x": 44
5349
}
5450
]
5551
}
5652
],
5753
"tests": [
5854
{
59-
"description": "Unacknowledged bulkWrite deleteOne with hints fails with client-side error",
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+
],
6061
"operations": [
6162
{
6263
"object": "collection0",
6364
"name": "bulkWrite",
6465
"arguments": {
6566
"requests": [
6667
{
67-
"deleteOne": {
68+
"deleteMany": {
6869
"filter": {
69-
"_id": 1
70+
"_id": {
71+
"$gt": 1
72+
}
7073
},
7174
"hint": "_id_"
7275
}
73-
},
74-
{
75-
"deleteOne": {
76-
"filter": {
77-
"_id": 2
78-
},
79-
"hint": {
80-
"_id": 1
81-
}
82-
}
8376
}
84-
],
85-
"ordered": true
77+
]
8678
},
8779
"expectError": {
88-
"isError": true
80+
"isClientError": true
8981
}
9082
}
9183
],
@@ -97,8 +89,8 @@
9789
],
9890
"outcome": [
9991
{
100-
"collectionName": "BulkWrite_delete_hint",
101-
"databaseName": "crud-v2",
92+
"collectionName": "coll0",
93+
"databaseName": "db0",
10294
"documents": [
10395
{
10496
"_id": 1,
@@ -111,17 +103,18 @@
111103
{
112104
"_id": 3,
113105
"x": 33
114-
},
115-
{
116-
"_id": 4,
117-
"x": 44
118106
}
119107
]
120108
}
121109
]
122110
},
123111
{
124-
"description": "Unacknowledged bulkWrite deleteMany with hints fails with client-side error",
112+
"description": "Unacknowledged deleteMany with hint document fails with client-side error on pre-4.4 server",
113+
"runOnRequirements": [
114+
{
115+
"maxServerVersion": "4.2.99"
116+
}
117+
],
125118
"operations": [
126119
{
127120
"object": "collection0",
@@ -132,29 +125,18 @@
132125
"deleteMany": {
133126
"filter": {
134127
"_id": {
135-
"$lt": 3
136-
}
137-
},
138-
"hint": "_id_"
139-
}
140-
},
141-
{
142-
"deleteMany": {
143-
"filter": {
144-
"_id": {
145-
"$gte": 4
128+
"$gt": 1
146129
}
147130
},
148131
"hint": {
149132
"_id": 1
150133
}
151134
}
152135
}
153-
],
154-
"ordered": true
136+
]
155137
},
156138
"expectError": {
157-
"isError": true
139+
"isClientError": true
158140
}
159141
}
160142
],
@@ -166,8 +148,8 @@
166148
],
167149
"outcome": [
168150
{
169-
"collectionName": "BulkWrite_delete_hint",
170-
"databaseName": "crud-v2",
151+
"collectionName": "coll0",
152+
"databaseName": "db0",
171153
"documents": [
172154
{
173155
"_id": 1,
@@ -180,10 +162,102 @@
180162
{
181163
"_id": 3,
182164
"x": 33
183-
},
165+
}
166+
]
167+
}
168+
]
169+
},
170+
{
171+
"description": "Unacknowledged deleteMany with hint string on 4.4+ server",
172+
"runOnRequirements": [
173+
{
174+
"minServerVersion": "4.4.0"
175+
}
176+
],
177+
"operations": [
178+
{
179+
"object": "collection0",
180+
"name": "bulkWrite",
181+
"arguments": {
182+
"requests": [
183+
{
184+
"deleteMany": {
185+
"filter": {
186+
"_id": {
187+
"$gt": 1
188+
}
189+
},
190+
"hint": "_id_"
191+
}
192+
}
193+
]
194+
},
195+
"expectResult": {
196+
"$$unsetOrMatches": {
197+
"acknowledged": {
198+
"$$unsetOrMatches": false
199+
}
200+
}
201+
}
202+
}
203+
],
204+
"outcome": [
205+
{
206+
"collectionName": "coll0",
207+
"databaseName": "db0",
208+
"documents": [
184209
{
185-
"_id": 4,
186-
"x": 44
210+
"_id": 1,
211+
"x": 11
212+
}
213+
]
214+
}
215+
]
216+
},
217+
{
218+
"description": "Unacknowledged deleteMany with hint document on 4.4+ server",
219+
"runOnRequirements": [
220+
{
221+
"minServerVersion": "4.4.0"
222+
}
223+
],
224+
"operations": [
225+
{
226+
"object": "collection0",
227+
"name": "bulkWrite",
228+
"arguments": {
229+
"requests": [
230+
{
231+
"deleteMany": {
232+
"filter": {
233+
"_id": {
234+
"$gt": 1
235+
}
236+
},
237+
"hint": {
238+
"_id": 1
239+
}
240+
}
241+
}
242+
]
243+
},
244+
"expectResult": {
245+
"$$unsetOrMatches": {
246+
"acknowledged": {
247+
"$$unsetOrMatches": false
248+
}
249+
}
250+
}
251+
}
252+
],
253+
"outcome": [
254+
{
255+
"collectionName": "coll0",
256+
"databaseName": "db0",
257+
"documents": [
258+
{
259+
"_id": 1,
260+
"x": 11
187261
}
188262
]
189263
}

0 commit comments

Comments
 (0)