File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,8 @@ public function run(UnifiedTestCase $test): void
126
126
*
127
127
* This function is primarily used by the Atlas testing workload executor.
128
128
*
129
+ * @see https://github.com/mongodb-labs/drivers-atlas-testing/
130
+ *
129
131
* @param callable(EntityMap):void $entityMapObserver
130
132
*/
131
133
public function setEntityMapObserver (callable $ entityMapObserver ): void
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace MongoDB \Tests \UnifiedSpecTests ;
4
+
5
+ use MongoDB \Tests \FunctionalTestCase ;
6
+
7
+ class UnifiedTestRunnerTest extends FunctionalTestCase
8
+ {
9
+ public function testEntityMapObserver (): void
10
+ {
11
+ $ test = UnifiedTestCase::fromFile (__DIR__ . '/crud/find.json ' );
12
+ $ calls = 0 ;
13
+
14
+ $ runner = new UnifiedTestRunner (static ::getUri ());
15
+ $ runner ->setEntityMapObserver (function (EntityMap $ entityMap ) use (&$ calls ): void {
16
+ $ this ->assertArrayHasKey ('client0 ' , $ entityMap );
17
+ $ this ->assertArrayHasKey ('database0 ' , $ entityMap );
18
+ $ this ->assertArrayHasKey ('collection0 ' , $ entityMap );
19
+ $ calls ++;
20
+ });
21
+
22
+ $ runner ->run ($ test ->current ());
23
+ $ this ->assertSame (1 , $ calls );
24
+ }
25
+ }
You can’t perform that action at this time.
0 commit comments