Skip to content

Commit 01bf56b

Browse files
committed
Add tests with field path in type map for Aggregate and FindAndModify
1 parent 5e503d0 commit 01bf56b

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

tests/Operation/AggregateFunctionalTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,13 @@ public function provideTypeMapOptionsAndExpectedDocuments()
305305
['_id' => 3, 'x' => (object) ['foo' => 'bar']],
306306
],
307307
],
308+
[
309+
['root' => 'array', 'document' => 'stdClass', 'fieldPaths' => ['x' => 'array']],
310+
[
311+
['_id' => 1, 'x' => ['foo' => 'bar']],
312+
['_id' => 3, 'x' => ['foo' => 'bar']],
313+
],
314+
],
308315
];
309316
}
310317

tests/Operation/FindAndModifyFunctionalTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ public function provideTypeMapOptionsAndExpectedDocument()
164164
['root' => BSONDocument::class, 'document' => 'object'],
165165
new BSONDocument(['_id' => 1, 'x' => (object) ['foo' => 'bar']]),
166166
],
167+
[
168+
['root' => 'array', 'document' => 'stdClass', 'fieldPaths' => ['x' => 'array']],
169+
['_id' => 1, 'x' => ['foo' => 'bar']],
170+
],
167171
];
168172
}
169173

0 commit comments

Comments
 (0)