File tree Expand file tree Collapse file tree 2 files changed +129
-0
lines changed Expand file tree Collapse file tree 2 files changed +129
-0
lines changed Original file line number Diff line number Diff line change @@ -178,6 +178,19 @@ public function provideFailingTests()
178178 return $ this ->provideTests (__DIR__ . '/valid-fail ' );
179179 }
180180
181+ /**
182+ * @dataProvider provideChangeStreamsTests
183+ */
184+ public function testChangeStreams (...$ args )
185+ {
186+ $ this ->doTestCase (...$ args );
187+ }
188+
189+ public function provideChangeStreamsTests ()
190+ {
191+ return $ this ->provideTests (__DIR__ . '/change-streams ' );
192+ }
193+
181194 private function provideTests (string $ dir )
182195 {
183196 $ testArgs = [];
Original file line number Diff line number Diff line change 1+ {
2+ "description" : " change-streams" ,
3+ "schemaVersion" : " 1.0" ,
4+ "createEntities" : [
5+ {
6+ "client" : {
7+ "id" : " client0"
8+ }
9+ },
10+ {
11+ "database" : {
12+ "id" : " database0" ,
13+ "client" : " client0" ,
14+ "databaseName" : " database0"
15+ }
16+ },
17+ {
18+ "collection" : {
19+ "id" : " collection0" ,
20+ "database" : " database0" ,
21+ "collectionName" : " collection0"
22+ }
23+ }
24+ ],
25+ "initialData" : [
26+ {
27+ "collectionName" : " collection0" ,
28+ "databaseName" : " database0" ,
29+ "documents" : []
30+ }
31+ ],
32+ "tests" : [
33+ {
34+ "description" : " Test array truncation" ,
35+ "runOnRequirements" : [
36+ {
37+ "minServerVersion" : " 4.7" ,
38+ "topologies" : [
39+ " replicaset"
40+ ]
41+ }
42+ ],
43+ "operations" : [
44+ {
45+ "name" : " insertOne" ,
46+ "object" : " collection0" ,
47+ "arguments" : {
48+ "document" : {
49+ "_id" : 1 ,
50+ "a" : 1 ,
51+ "array" : [
52+ " foo" ,
53+ {
54+ "a" : " bar"
55+ },
56+ 1 ,
57+ 2 ,
58+ 3
59+ ]
60+ }
61+ }
62+ },
63+ {
64+ "name" : " createChangeStream" ,
65+ "object" : " collection0" ,
66+ "arguments" : {
67+ "pipeline" : []
68+ },
69+ "saveResultAsEntity" : " changeStream0"
70+ },
71+ {
72+ "name" : " updateOne" ,
73+ "object" : " collection0" ,
74+ "arguments" : {
75+ "filter" : {
76+ "_id" : 1
77+ },
78+ "update" : [
79+ {
80+ "$set" : {
81+ "array" : [
82+ " foo" ,
83+ {
84+ "a" : " bar"
85+ }
86+ ]
87+ }
88+ }
89+ ]
90+ }
91+ },
92+ {
93+ "name" : " iterateUntilDocumentOrError" ,
94+ "object" : " changeStream0" ,
95+ "expectResult" : {
96+ "operationType" : " update" ,
97+ "ns" : {
98+ "db" : " database0" ,
99+ "coll" : " collection0"
100+ },
101+ "updateDescription" : {
102+ "updatedFields" : {},
103+ "removedFields" : [],
104+ "truncatedArrays" : [
105+ {
106+ "field" : " array" ,
107+ "newSize" : 2
108+ }
109+ ]
110+ }
111+ }
112+ }
113+ ]
114+ }
115+ ]
116+ }
You can’t perform that action at this time.
0 commit comments