Skip to content

Commit bb41ba3

Browse files
committed
PHPLIB-665: Sync spec tests for dots/dollars
This updates individual tests pertaining to dots/dollars. Synced with mongodb/specifications@44f8310 Removes skips previously added in a66f31f and ea9853a
1 parent 50348c2 commit bb41ba3

File tree

8 files changed

+80
-128
lines changed

8 files changed

+80
-128
lines changed

tests/SpecTests/TransactionsSpecTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ class TransactionsSpecTest extends FunctionalTestCase
3636
'transactions/mongos-recovery-token: commitTransaction retry fails on new mongos' => 'isMaster failpoints cannot be disabled',
3737
'transactions/pin-mongos: remain pinned after non-transient error on commit' => 'Blocked on SPEC-1320',
3838
'transactions/pin-mongos: unpin after transient error within a transaction and commit' => 'isMaster failpoints cannot be disabled',
39-
'transactions/errors-client: Client side error in command starting transaction' => 'PHPLIB-665',
40-
'transactions/errors-client: Client side error when transaction is in progress' => 'PHPLIB-665',
4139
];
4240

4341
public function setUp() : void

tests/SpecTests/transactions/errors-client.json

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@
2525
"object": "session0"
2626
},
2727
{
28-
"name": "insertOne",
28+
"name": "updateOne",
2929
"object": "collection",
3030
"arguments": {
3131
"session": "session0",
32-
"document": {
33-
"_id": {
34-
".": "."
35-
}
32+
"filter": {
33+
"_id": 1
34+
},
35+
"update": {
36+
"x": 1
3637
}
3738
},
3839
"error": true
@@ -60,22 +61,23 @@
6061
"arguments": {
6162
"session": "session0",
6263
"document": {
63-
"_id": 4
64+
"_id": 1
6465
}
6566
},
6667
"result": {
67-
"insertedId": 4
68+
"insertedId": 1
6869
}
6970
},
7071
{
71-
"name": "insertOne",
72+
"name": "updateOne",
7273
"object": "collection",
7374
"arguments": {
7475
"session": "session0",
75-
"document": {
76-
"_id": {
77-
".": "."
78-
}
76+
"filter": {
77+
"_id": 1
78+
},
79+
"update": {
80+
"x": 1
7981
}
8082
},
8183
"error": true

tests/UnifiedSpecTests/UnifiedSpecTest.php

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -42,67 +42,6 @@ class UnifiedSpecTest extends FunctionalTestCase
4242
'crud/unacknowledged-updateMany-hint-clientError: Unacknowledged updateMany with hint document fails with client-side error' => 'PHPLIB-573 and DRIVERS-1340',
4343
'crud/unacknowledged-updateOne-hint-clientError: Unacknowledged updateOne with hint string fails with client-side error' => 'PHPLIB-573 and DRIVERS-1340',
4444
'crud/unacknowledged-updateOne-hint-clientError: Unacknowledged updateOne with hint document fails with client-side error' => 'PHPLIB-573 and DRIVERS-1340',
45-
// CDRIVER-3895 and PHPC-1765
46-
'crud/bulkWrite-insertOne-dots_and_dollars: Inserting document with top-level dollar-prefixed key on 5.0+ server' => 'CDRIVER-3895 and PHPC-1765',
47-
'crud/bulkWrite-insertOne-dots_and_dollars: Inserting document with top-level dollar-prefixed key on pre-5.0 server yields server-side error' => 'CDRIVER-3895 and PHPC-1765',
48-
'crud/bulkWrite-insertOne-dots_and_dollars: Inserting document with top-level dotted key' => 'CDRIVER-3895 and PHPC-1765',
49-
'crud/bulkWrite-insertOne-dots_and_dollars: Inserting document with dollar-prefixed key in embedded doc' => 'CDRIVER-3895 and PHPC-1765',
50-
'crud/bulkWrite-insertOne-dots_and_dollars: Inserting document with dotted key in embedded doc' => 'CDRIVER-3895 and PHPC-1765',
51-
'crud/bulkWrite-replaceOne-dots_and_dollars: Replacing document with top-level dotted key on 3.6+ server' => 'CDRIVER-3895 and PHPC-1765',
52-
'crud/bulkWrite-replaceOne-dots_and_dollars: Replacing document with top-level dotted key on pre-3.6 server yields server-side error' => 'CDRIVER-3895 and PHPC-1765',
53-
'crud/bulkWrite-replaceOne-dots_and_dollars: Replacing document with dollar-prefixed key in embedded doc on 5.0+ server' => 'CDRIVER-3895 and PHPC-1765',
54-
'crud/bulkWrite-replaceOne-dots_and_dollars: Replacing document with dollar-prefixed key in embedded doc on pre-5.0 server yields server-side error' => 'CDRIVER-3895 and PHPC-1765',
55-
'crud/bulkWrite-replaceOne-dots_and_dollars: Replacing document with dotted key in embedded doc on 3.6+ server' => 'CDRIVER-3895 and PHPC-1765',
56-
'crud/bulkWrite-replaceOne-dots_and_dollars: Replacing document with dotted key in embedded doc on pre-3.6 server yields server-side error' => 'CDRIVER-3895 and PHPC-1765',
57-
'crud/bulkWrite-updateMany-dots_and_dollars: Updating document to set top-level dollar-prefixed key on 5.0+ server' => 'CDRIVER-3895 and PHPC-1765',
58-
'crud/bulkWrite-updateMany-dots_and_dollars: Updating document to set top-level dotted key on 5.0+ server' => 'CDRIVER-3895 and PHPC-1765',
59-
'crud/bulkWrite-updateMany-dots_and_dollars: Updating document to set dollar-prefixed key in embedded doc on 5.0+ server' => 'CDRIVER-3895 and PHPC-1765',
60-
'crud/bulkWrite-updateMany-dots_and_dollars: Updating document to set dotted key in embedded doc on 5.0+ server' => 'CDRIVER-3895 and PHPC-1765',
61-
'crud/bulkWrite-updateOne-dots_and_dollars: Updating document to set top-level dollar-prefixed key on 5.0+ server' => 'CDRIVER-3895 and PHPC-1765',
62-
'crud/bulkWrite-updateOne-dots_and_dollars: Updating document to set top-level dotted key on 5.0+ server' => 'CDRIVER-3895 and PHPC-1765',
63-
'crud/bulkWrite-updateOne-dots_and_dollars: Updating document to set dollar-prefixed key in embedded doc on 5.0+ server' => 'CDRIVER-3895 and PHPC-1765',
64-
'crud/bulkWrite-updateOne-dots_and_dollars: Updating document to set dotted key in embedded doc on 5.0+ server' => 'CDRIVER-3895 and PHPC-1765',
65-
'crud/findOneAndReplace-dots_and_dollars: Replacing document with top-level dotted key on 3.6+ server' => 'CDRIVER-3895 and PHPC-1765',
66-
'crud/findOneAndReplace-dots_and_dollars: Replacing document with top-level dotted key on pre-3.6 server yields server-side error' => 'CDRIVER-3895 and PHPC-1765',
67-
'crud/findOneAndReplace-dots_and_dollars: Replacing document with dollar-prefixed key in embedded doc on 5.0+ server' => 'CDRIVER-3895 and PHPC-1765',
68-
'crud/findOneAndReplace-dots_and_dollars: Replacing document with dollar-prefixed key in embedded doc on pre-5.0 server yields server-side error' => 'CDRIVER-3895 and PHPC-1765',
69-
'crud/findOneAndReplace-dots_and_dollars: Replacing document with dotted key in embedded doc on 3.6+ server' => 'CDRIVER-3895 and PHPC-1765',
70-
'crud/findOneAndReplace-dots_and_dollars: Replacing document with dotted key in embedded doc on pre-3.6 server yields server-side error' => 'CDRIVER-3895 and PHPC-1765',
71-
'crud/findOneAndUpdate-dots_and_dollars: Updating document to set top-level dollar-prefixed key on 5.0+ server' => 'CDRIVER-3895 and PHPC-1765',
72-
'crud/findOneAndUpdate-dots_and_dollars: Updating document to set top-level dotted key on 5.0+ server' => 'CDRIVER-3895 and PHPC-1765',
73-
'crud/findOneAndUpdate-dots_and_dollars: Updating document to set dollar-prefixed key in embedded doc on 5.0+ server' => 'CDRIVER-3895 and PHPC-1765',
74-
'crud/findOneAndUpdate-dots_and_dollars: Updating document to set dotted key in embedded doc on 5.0+ server' => 'CDRIVER-3895 and PHPC-1765',
75-
'crud/insertMany-dots_and_dollars: Inserting document with top-level dollar-prefixed key on 5.0+ server' => 'CDRIVER-3895 and PHPC-1765',
76-
'crud/insertMany-dots_and_dollars: Inserting document with top-level dollar-prefixed key on pre-5.0 server yields server-side error' => 'CDRIVER-3895 and PHPC-1765',
77-
'crud/insertMany-dots_and_dollars: Inserting document with top-level dotted key' => 'CDRIVER-3895 and PHPC-1765',
78-
'crud/insertMany-dots_and_dollars: Inserting document with dollar-prefixed key in embedded doc' => 'CDRIVER-3895 and PHPC-1765',
79-
'crud/insertMany-dots_and_dollars: Inserting document with dotted key in embedded doc' => 'CDRIVER-3895 and PHPC-1765',
80-
'crud/insertOne-dots_and_dollars: Inserting document with top-level dollar-prefixed key on 5.0+ server' => 'CDRIVER-3895 and PHPC-1765',
81-
'crud/insertOne-dots_and_dollars: Inserting document with top-level dollar-prefixed key on pre-5.0 server yields server-side error' => 'CDRIVER-3895 and PHPC-1765',
82-
'crud/insertOne-dots_and_dollars: Inserting document with top-level dotted key' => 'CDRIVER-3895 and PHPC-1765',
83-
'crud/insertOne-dots_and_dollars: Inserting document with dollar-prefixed key in embedded doc' => 'CDRIVER-3895 and PHPC-1765',
84-
'crud/insertOne-dots_and_dollars: Inserting document with dotted key in embedded doc' => 'CDRIVER-3895 and PHPC-1765',
85-
'crud/insertOne-dots_and_dollars: Inserting document with dollar-prefixed key in _id yields server-side error' => 'CDRIVER-3895 and PHPC-1765',
86-
'crud/insertOne-dots_and_dollars: Inserting document with dotted key in _id on 3.6+ server' => 'CDRIVER-3895 and PHPC-1765',
87-
'crud/insertOne-dots_and_dollars: Inserting document with dotted key in _id on pre-3.6 server yields server-side error' => 'CDRIVER-3895 and PHPC-1765',
88-
'crud/insertOne-dots_and_dollars: Inserting document with DBRef-like keys' => 'CDRIVER-3895 and PHPC-1765',
89-
'crud/insertOne-dots_and_dollars: Unacknowledged write using dollar-prefixed or dotted keys may be silently rejected on pre-5.0 server' => 'CDRIVER-3895 and PHPC-1765',
90-
'crud/replaceOne-dots_and_dollars: Replacing document with top-level dotted key on 3.6+ server' => 'CDRIVER-3895 and PHPC-1765',
91-
'crud/replaceOne-dots_and_dollars: Replacing document with top-level dotted key on pre-3.6 server yields server-side error' => 'CDRIVER-3895 and PHPC-1765',
92-
'crud/replaceOne-dots_and_dollars: Replacing document with dollar-prefixed key in embedded doc on 5.0+ server' => 'CDRIVER-3895 and PHPC-1765',
93-
'crud/replaceOne-dots_and_dollars: Replacing document with dollar-prefixed key in embedded doc on pre-5.0 server yields server-side error' => 'CDRIVER-3895 and PHPC-1765',
94-
'crud/replaceOne-dots_and_dollars: Replacing document with dotted key in embedded doc on 3.6+ server' => 'CDRIVER-3895 and PHPC-1765',
95-
'crud/replaceOne-dots_and_dollars: Replacing document with dotted key in embedded doc on pre-3.6 server yields server-side error' => 'CDRIVER-3895 and PHPC-1765',
96-
'crud/replaceOne-dots_and_dollars: Unacknowledged write using dollar-prefixed or dotted keys may be silently rejected on pre-5.0 server' => 'CDRIVER-3895 and PHPC-1765',
97-
'crud/updateMany-dots_and_dollars: Updating document to set top-level dollar-prefixed key on 5.0+ server' => 'CDRIVER-3895 and PHPC-1765',
98-
'crud/updateMany-dots_and_dollars: Updating document to set top-level dotted key on 5.0+ server' => 'CDRIVER-3895 and PHPC-1765',
99-
'crud/updateMany-dots_and_dollars: Updating document to set dollar-prefixed key in embedded doc on 5.0+ server' => 'CDRIVER-3895 and PHPC-1765',
100-
'crud/updateMany-dots_and_dollars: Updating document to set dotted key in embedded doc on 5.0+ server' => 'CDRIVER-3895 and PHPC-1765',
101-
'crud/updateOne-dots_and_dollars: Updating document to set top-level dollar-prefixed key on 5.0+ server' => 'CDRIVER-3895 and PHPC-1765',
102-
'crud/updateOne-dots_and_dollars: Updating document to set top-level dotted key on 5.0+ server' => 'CDRIVER-3895 and PHPC-1765',
103-
'crud/updateOne-dots_and_dollars: Updating document to set dollar-prefixed key in embedded doc on 5.0+ server' => 'CDRIVER-3895 and PHPC-1765',
104-
'crud/updateOne-dots_and_dollars: Updating document to set dotted key in embedded doc on 5.0+ server' => 'CDRIVER-3895 and PHPC-1765',
105-
'valid-pass/poc-transactions: Client side error in command starting transaction' => 'PHPLIB-665',
10645
];
10746

10847
/** @var UnifiedTestRunner */

tests/UnifiedSpecTests/crud/insertMany-dots_and_dollars.json

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,11 @@
5353
]
5454
},
5555
"expectResult": {
56-
"insertedCount": 1,
57-
"insertedIds": {
58-
"$$unsetOrMatches": {
59-
"0": 1
56+
"$$unsetOrMatches": {
57+
"insertedIds": {
58+
"$$unsetOrMatches": {
59+
"0": 1
60+
}
6061
}
6162
}
6263
}
@@ -162,10 +163,11 @@
162163
]
163164
},
164165
"expectResult": {
165-
"insertedCount": 1,
166-
"insertedIds": {
167-
"$$unsetOrMatches": {
168-
"0": 1
166+
"$$unsetOrMatches": {
167+
"insertedIds": {
168+
"$$unsetOrMatches": {
169+
"0": 1
170+
}
169171
}
170172
}
171173
}
@@ -221,10 +223,11 @@
221223
]
222224
},
223225
"expectResult": {
224-
"insertedCount": 1,
225-
"insertedIds": {
226-
"$$unsetOrMatches": {
227-
"0": 1
226+
"$$unsetOrMatches": {
227+
"insertedIds": {
228+
"$$unsetOrMatches": {
229+
"0": 1
230+
}
228231
}
229232
}
230233
}
@@ -284,10 +287,11 @@
284287
]
285288
},
286289
"expectResult": {
287-
"insertedCount": 1,
288-
"insertedIds": {
289-
"$$unsetOrMatches": {
290-
"0": 1
290+
"$$unsetOrMatches": {
291+
"insertedIds": {
292+
"$$unsetOrMatches": {
293+
"0": 1
294+
}
291295
}
292296
}
293297
}

tests/UnifiedSpecTests/crud/insertOne-dots_and_dollars.json

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@
6363
}
6464
},
6565
"expectResult": {
66-
"insertedCount": 1,
67-
"insertedId": {
68-
"$$unsetOrMatches": 1
66+
"$$unsetOrMatches": {
67+
"insertedId": {
68+
"$$unsetOrMatches": 1
69+
}
6970
}
7071
}
7172
}
@@ -166,9 +167,10 @@
166167
}
167168
},
168169
"expectResult": {
169-
"insertedCount": 1,
170-
"insertedId": {
171-
"$$unsetOrMatches": 1
170+
"$$unsetOrMatches": {
171+
"insertedId": {
172+
"$$unsetOrMatches": 1
173+
}
172174
}
173175
}
174176
}
@@ -221,9 +223,10 @@
221223
}
222224
},
223225
"expectResult": {
224-
"insertedCount": 1,
225-
"insertedId": {
226-
"$$unsetOrMatches": 1
226+
"$$unsetOrMatches": {
227+
"insertedId": {
228+
"$$unsetOrMatches": 1
229+
}
227230
}
228231
}
229232
}
@@ -280,9 +283,10 @@
280283
}
281284
},
282285
"expectResult": {
283-
"insertedCount": 1,
284-
"insertedId": {
285-
"$$unsetOrMatches": 1
286+
"$$unsetOrMatches": {
287+
"insertedId": {
288+
"$$unsetOrMatches": 1
289+
}
286290
}
287291
}
288292
}
@@ -390,10 +394,11 @@
390394
}
391395
},
392396
"expectResult": {
393-
"insertedCount": 1,
394-
"insertedId": {
395-
"$$unsetOrMatches": {
396-
"a.b": 1
397+
"$$unsetOrMatches": {
398+
"insertedId": {
399+
"$$unsetOrMatches": {
400+
"a.b": 1
401+
}
397402
}
398403
}
399404
}
@@ -501,9 +506,10 @@
501506
}
502507
},
503508
"expectResult": {
504-
"insertedCount": 1,
505-
"insertedId": {
506-
"$$unsetOrMatches": 1
509+
"$$unsetOrMatches": {
510+
"insertedId": {
511+
"$$unsetOrMatches": 1
512+
}
507513
}
508514
}
509515
}
@@ -564,8 +570,10 @@
564570
}
565571
},
566572
"expectResult": {
567-
"acknowledged": {
568-
"$$unsetOrMatches": false
573+
"$$unsetOrMatches": {
574+
"acknowledged": {
575+
"$$unsetOrMatches": false
576+
}
569577
}
570578
}
571579
}

tests/UnifiedSpecTests/valid-pass/poc-crud.json

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"description": "poc-crud",
3-
"schemaVersion": "1.0",
3+
"schemaVersion": "1.4",
44
"createEntities": [
55
{
66
"client": {
@@ -242,12 +242,14 @@
242242
},
243243
"expectError": {
244244
"expectResult": {
245-
"deletedCount": 0,
246-
"insertedCount": 2,
247-
"matchedCount": 0,
248-
"modifiedCount": 0,
249-
"upsertedCount": 0,
250-
"upsertedIds": {}
245+
"$$unsetOrMatches": {
246+
"deletedCount": 0,
247+
"insertedCount": 2,
248+
"matchedCount": 0,
249+
"modifiedCount": 0,
250+
"upsertedCount": 0,
251+
"upsertedIds": {}
252+
}
251253
}
252254
}
253255
}
@@ -406,7 +408,8 @@
406408
"description": "Aggregate with $listLocalSessions",
407409
"runOnRequirements": [
408410
{
409-
"minServerVersion": "3.6.0"
411+
"minServerVersion": "3.6.0",
412+
"serverless": "forbid"
410413
}
411414
],
412415
"operations": [

tests/UnifiedSpecTests/valid-pass/poc-retryable-writes.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,6 @@
298298
},
299299
"expectResult": {
300300
"$$unsetOrMatches": {
301-
"insertedCount": {
302-
"$$unsetOrMatches": 2
303-
},
304301
"insertedIds": {
305302
"$$unsetOrMatches": {
306303
"0": 3,

tests/UnifiedSpecTests/valid-pass/poc-transactions.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,15 @@
6161
"object": "session0"
6262
},
6363
{
64-
"name": "insertOne",
64+
"name": "updateOne",
6565
"object": "collection0",
6666
"arguments": {
6767
"session": "session0",
68-
"document": {
69-
"_id": {
70-
".": "."
71-
}
68+
"filter": {
69+
"_id": 1
70+
},
71+
"update": {
72+
"x": 1
7273
}
7374
},
7475
"expectError": {

0 commit comments

Comments
 (0)