Commit 0f848cbd authored by Jeremy Mikola's avatar Jeremy Mikola

Refactor CommandObserver to track all three APM events

parent 2a288a03
...@@ -123,7 +123,8 @@ class CollectionFunctionalTest extends FunctionalTestCase ...@@ -123,7 +123,8 @@ class CollectionFunctionalTest extends FunctionalTestCase
] ]
); );
}, },
function(stdClass $command) { function(array $event) {
$command = $event['started']->getCommand();
$this->assertObjectHasAttribute('lsid', $command); $this->assertObjectHasAttribute('lsid', $command);
$this->assertObjectHasAttribute('maxTimeMS', $command); $this->assertObjectHasAttribute('maxTimeMS', $command);
$this->assertObjectHasAttribute('writeConcern', $command); $this->assertObjectHasAttribute('writeConcern', $command);
......
...@@ -38,14 +38,16 @@ class CommandObserver implements CommandSubscriber ...@@ -38,14 +38,16 @@ class CommandObserver implements CommandSubscriber
public function commandStarted(CommandStartedEvent $event) public function commandStarted(CommandStartedEvent $event)
{ {
$this->commands[] = $event->getCommand(); $this->commands[$event->getRequestId()]['started'] = $event;
} }
public function commandSucceeded(CommandSucceededEvent $event) public function commandSucceeded(CommandSucceededEvent $event)
{ {
$this->commands[$event->getRequestId()]['succeeded'] = $event;
} }
public function commandFailed(CommandFailedEvent $event) public function commandFailed(CommandFailedEvent $event)
{ {
$this->commands[$event->getRequestId()]['failed'] = $event;
} }
} }
...@@ -221,8 +221,8 @@ class ReadableStreamFunctionalTest extends FunctionalTestCase ...@@ -221,8 +221,8 @@ class ReadableStreamFunctionalTest extends FunctionalTestCase
$stream->seek($offset); $stream->seek($offset);
$this->assertSame($expectedBytes, $stream->readBytes($length)); $this->assertSame($expectedBytes, $stream->readBytes($length));
}, },
function(stdClass $command) use (&$commands) { function(array $event) use (&$commands) {
$commands[] = key((array) $command); $commands[] = $event['started']->getCommandName();
} }
); );
...@@ -257,8 +257,8 @@ class ReadableStreamFunctionalTest extends FunctionalTestCase ...@@ -257,8 +257,8 @@ class ReadableStreamFunctionalTest extends FunctionalTestCase
$stream->seek($offset); $stream->seek($offset);
$this->assertSame($expectedBytes, $stream->readBytes($length)); $this->assertSame($expectedBytes, $stream->readBytes($length));
}, },
function(stdClass $command) use (&$commands) { function(array $event) use (&$commands) {
$commands[] = key((array) $command); $commands[] = $event['started']->getCommandName();
} }
); );
...@@ -291,8 +291,8 @@ class ReadableStreamFunctionalTest extends FunctionalTestCase ...@@ -291,8 +291,8 @@ class ReadableStreamFunctionalTest extends FunctionalTestCase
$stream->seek($offset); $stream->seek($offset);
$this->assertSame($expectedBytes, $stream->readBytes($length)); $this->assertSame($expectedBytes, $stream->readBytes($length));
}, },
function(stdClass $command) use (&$commands) { function(array $event) use (&$commands) {
$commands[] = key((array) $command); $commands[] = $event['started']->getCommandName();
} }
); );
......
...@@ -28,8 +28,8 @@ class AggregateFunctionalTest extends FunctionalTestCase ...@@ -28,8 +28,8 @@ class AggregateFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertSame(1, $command->aggregate); $this->assertSame(1, $event['started']->getCommand()->aggregate);
} }
); );
} }
...@@ -47,8 +47,8 @@ class AggregateFunctionalTest extends FunctionalTestCase ...@@ -47,8 +47,8 @@ class AggregateFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectNotHasAttribute('readConcern', $command); $this->assertObjectNotHasAttribute('readConcern', $event['started']->getCommand());
} }
); );
} }
...@@ -66,8 +66,8 @@ class AggregateFunctionalTest extends FunctionalTestCase ...@@ -66,8 +66,8 @@ class AggregateFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectNotHasAttribute('writeConcern', $command); $this->assertObjectNotHasAttribute('writeConcern', $event['started']->getCommand());
} }
); );
} }
...@@ -112,8 +112,8 @@ class AggregateFunctionalTest extends FunctionalTestCase ...@@ -112,8 +112,8 @@ class AggregateFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectHasAttribute('lsid', $command); $this->assertObjectHasAttribute('lsid', $event['started']->getCommand());
} }
); );
} }
...@@ -185,8 +185,8 @@ class AggregateFunctionalTest extends FunctionalTestCase ...@@ -185,8 +185,8 @@ class AggregateFunctionalTest extends FunctionalTestCase
$this->assertCount(1, $results); $this->assertCount(1, $results);
$this->assertObjectHasAttribute('stages', current($results)); $this->assertObjectHasAttribute('stages', current($results));
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectNotHasAttribute('writeConcern', $command); $this->assertObjectNotHasAttribute('writeConcern', $event['started']->getCommand());
} }
); );
......
...@@ -299,8 +299,8 @@ class BulkWriteFunctionalTest extends FunctionalTestCase ...@@ -299,8 +299,8 @@ class BulkWriteFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectHasAttribute('lsid', $command); $this->assertObjectHasAttribute('lsid', $event['started']->getCommand());
} }
); );
} }
......
...@@ -23,8 +23,8 @@ class CountFunctionalTest extends FunctionalTestCase ...@@ -23,8 +23,8 @@ class CountFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectNotHasAttribute('readConcern', $command); $this->assertObjectNotHasAttribute('readConcern', $event['started']->getCommand());
} }
); );
} }
...@@ -87,8 +87,8 @@ class CountFunctionalTest extends FunctionalTestCase ...@@ -87,8 +87,8 @@ class CountFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectHasAttribute('lsid', $command); $this->assertObjectHasAttribute('lsid', $event['started']->getCommand());
} }
); );
} }
......
...@@ -20,8 +20,8 @@ class CreateCollectionFunctionalTest extends FunctionalTestCase ...@@ -20,8 +20,8 @@ class CreateCollectionFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectNotHasAttribute('writeConcern', $command); $this->assertObjectNotHasAttribute('writeConcern', $event['started']->getCommand());
} }
); );
} }
...@@ -42,8 +42,8 @@ class CreateCollectionFunctionalTest extends FunctionalTestCase ...@@ -42,8 +42,8 @@ class CreateCollectionFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectHasAttribute('lsid', $command); $this->assertObjectHasAttribute('lsid', $event['started']->getCommand());
} }
); );
} }
......
...@@ -140,8 +140,8 @@ class CreateIndexesFunctionalTest extends FunctionalTestCase ...@@ -140,8 +140,8 @@ class CreateIndexesFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectNotHasAttribute('writeConcern', $command); $this->assertObjectNotHasAttribute('writeConcern', $event['started']->getCommand());
} }
); );
} }
...@@ -163,8 +163,8 @@ class CreateIndexesFunctionalTest extends FunctionalTestCase ...@@ -163,8 +163,8 @@ class CreateIndexesFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectHasAttribute('lsid', $command); $this->assertObjectHasAttribute('lsid', $event['started']->getCommand());
} }
); );
} }
......
...@@ -24,8 +24,8 @@ class DatabaseCommandFunctionalTest extends FunctionalTestCase ...@@ -24,8 +24,8 @@ class DatabaseCommandFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectHasAttribute('lsid', $command); $this->assertObjectHasAttribute('lsid', $event['started']->getCommand());
} }
); );
} }
......
...@@ -79,8 +79,8 @@ class DeleteFunctionalTest extends FunctionalTestCase ...@@ -79,8 +79,8 @@ class DeleteFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectHasAttribute('lsid', $command); $this->assertObjectHasAttribute('lsid', $event['started']->getCommand());
} }
); );
} }
......
...@@ -22,8 +22,8 @@ class DistinctFunctionalTest extends FunctionalTestCase ...@@ -22,8 +22,8 @@ class DistinctFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectNotHasAttribute('readConcern', $command); $this->assertObjectNotHasAttribute('readConcern', $event['started']->getCommand());
} }
); );
} }
...@@ -46,8 +46,8 @@ class DistinctFunctionalTest extends FunctionalTestCase ...@@ -46,8 +46,8 @@ class DistinctFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectHasAttribute('lsid', $command); $this->assertObjectHasAttribute('lsid', $event['started']->getCommand());
} }
); );
} }
......
...@@ -22,8 +22,8 @@ class DropCollectionFunctionalTest extends FunctionalTestCase ...@@ -22,8 +22,8 @@ class DropCollectionFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectNotHasAttribute('writeConcern', $command); $this->assertObjectNotHasAttribute('writeConcern', $event['started']->getCommand());
} }
); );
} }
...@@ -69,8 +69,8 @@ class DropCollectionFunctionalTest extends FunctionalTestCase ...@@ -69,8 +69,8 @@ class DropCollectionFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectHasAttribute('lsid', $command); $this->assertObjectHasAttribute('lsid', $event['started']->getCommand());
} }
); );
} }
......
...@@ -22,8 +22,8 @@ class DropDatabaseFunctionalTest extends FunctionalTestCase ...@@ -22,8 +22,8 @@ class DropDatabaseFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectNotHasAttribute('writeConcern', $command); $this->assertObjectNotHasAttribute('writeConcern', $event['started']->getCommand());
} }
); );
} }
...@@ -73,8 +73,8 @@ class DropDatabaseFunctionalTest extends FunctionalTestCase ...@@ -73,8 +73,8 @@ class DropDatabaseFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectHasAttribute('lsid', $command); $this->assertObjectHasAttribute('lsid', $event['started']->getCommand());
} }
); );
} }
......
...@@ -28,8 +28,8 @@ class DropIndexesFunctionalTest extends FunctionalTestCase ...@@ -28,8 +28,8 @@ class DropIndexesFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectNotHasAttribute('writeConcern', $command); $this->assertObjectNotHasAttribute('writeConcern', $event['started']->getCommand());
} }
); );
} }
...@@ -137,8 +137,8 @@ class DropIndexesFunctionalTest extends FunctionalTestCase ...@@ -137,8 +137,8 @@ class DropIndexesFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectHasAttribute('lsid', $command); $this->assertObjectHasAttribute('lsid', $event['started']->getCommand());
} }
); );
} }
......
...@@ -182,7 +182,8 @@ class ExplainFunctionalTest extends FunctionalTestCase ...@@ -182,7 +182,8 @@ class ExplainFunctionalTest extends FunctionalTestCase
$explainOperation = new Explain($this->getDatabaseName(), $operation, ['typeMap' => ['root' => 'array', 'document' => 'array']]); $explainOperation = new Explain($this->getDatabaseName(), $operation, ['typeMap' => ['root' => 'array', 'document' => 'array']]);
$explainOperation->execute($this->getPrimaryServer()); $explainOperation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$command = $event['started']->getCommand();
$this->assertObjectNotHasAttribute('maxAwaitTimeMS', $command->explain); $this->assertObjectNotHasAttribute('maxAwaitTimeMS', $command->explain);
$this->assertObjectHasAttribute('tailable', $command->explain); $this->assertObjectHasAttribute('tailable', $command->explain);
$this->assertObjectHasAttribute('awaitData', $command->explain); $this->assertObjectHasAttribute('awaitData', $command->explain);
...@@ -206,7 +207,8 @@ class ExplainFunctionalTest extends FunctionalTestCase ...@@ -206,7 +207,8 @@ class ExplainFunctionalTest extends FunctionalTestCase
$explainOperation = new Explain($this->getDatabaseName(), $operation, ['typeMap' => ['root' => 'array', 'document' => 'array']]); $explainOperation = new Explain($this->getDatabaseName(), $operation, ['typeMap' => ['root' => 'array', 'document' => 'array']]);
$explainOperation->execute($this->getPrimaryServer()); $explainOperation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$command = $event['started']->getCommand();
$this->assertObjectHasAttribute('sort', $command->explain); $this->assertObjectHasAttribute('sort', $command->explain);
$this->assertObjectNotHasAttribute('modifiers', $command->explain); $this->assertObjectNotHasAttribute('modifiers', $command->explain);
} }
......
...@@ -30,8 +30,8 @@ class FindAndModifyFunctionalTest extends FunctionalTestCase ...@@ -30,8 +30,8 @@ class FindAndModifyFunctionalTest extends FunctionalTestCase
$operation->execute($server); $operation->execute($server);
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectNotHasAttribute('readConcern', $command); $this->assertObjectNotHasAttribute('readConcern', $event['started']->getCommand());
} }
); );
} }
...@@ -48,8 +48,8 @@ class FindAndModifyFunctionalTest extends FunctionalTestCase ...@@ -48,8 +48,8 @@ class FindAndModifyFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectNotHasAttribute('writeConcern', $command); $this->assertObjectNotHasAttribute('writeConcern', $event['started']->getCommand());
} }
); );
} }
...@@ -70,8 +70,8 @@ class FindAndModifyFunctionalTest extends FunctionalTestCase ...@@ -70,8 +70,8 @@ class FindAndModifyFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectHasAttribute('lsid', $command); $this->assertObjectHasAttribute('lsid', $event['started']->getCommand());
} }
); );
} }
......
...@@ -25,8 +25,8 @@ class FindFunctionalTest extends FunctionalTestCase ...@@ -25,8 +25,8 @@ class FindFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectNotHasAttribute('readConcern', $command); $this->assertObjectNotHasAttribute('readConcern', $event['started']->getCommand());
} }
); );
} }
...@@ -99,8 +99,8 @@ class FindFunctionalTest extends FunctionalTestCase ...@@ -99,8 +99,8 @@ class FindFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectHasAttribute('lsid', $command); $this->assertObjectHasAttribute('lsid', $event['started']->getCommand());
} }
); );
} }
......
...@@ -70,8 +70,8 @@ class InsertManyFunctionalTest extends FunctionalTestCase ...@@ -70,8 +70,8 @@ class InsertManyFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectHasAttribute('lsid', $command); $this->assertObjectHasAttribute('lsid', $event['started']->getCommand());
} }
); );
} }
......
...@@ -85,8 +85,8 @@ class InsertOneFunctionalTest extends FunctionalTestCase ...@@ -85,8 +85,8 @@ class InsertOneFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectHasAttribute('lsid', $command); $this->assertObjectHasAttribute('lsid', $event['started']->getCommand());
} }
); );
} }
......
...@@ -86,8 +86,8 @@ class ListCollectionsFunctionalTest extends FunctionalTestCase ...@@ -86,8 +86,8 @@ class ListCollectionsFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectHasAttribute('lsid', $command); $this->assertObjectHasAttribute('lsid', $event['started']->getCommand());
} }
); );
} }
......
...@@ -66,8 +66,8 @@ class ListDatabasesFunctionalTest extends FunctionalTestCase ...@@ -66,8 +66,8 @@ class ListDatabasesFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectHasAttribute('lsid', $command); $this->assertObjectHasAttribute('lsid', $event['started']->getCommand());
} }
); );
} }
......
...@@ -59,8 +59,8 @@ class ListIndexesFunctionalTest extends FunctionalTestCase ...@@ -59,8 +59,8 @@ class ListIndexesFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectHasAttribute('lsid', $command); $this->assertObjectHasAttribute('lsid', $event['started']->getCommand());
} }
); );
} }
......
...@@ -31,8 +31,8 @@ class MapReduceFunctionalTest extends FunctionalTestCase ...@@ -31,8 +31,8 @@ class MapReduceFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectNotHasAttribute('readConcern', $command); $this->assertObjectNotHasAttribute('readConcern', $event['started']->getCommand());
} }
); );
} }
...@@ -55,8 +55,8 @@ class MapReduceFunctionalTest extends FunctionalTestCase ...@@ -55,8 +55,8 @@ class MapReduceFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectNotHasAttribute('writeConcern', $command); $this->assertObjectNotHasAttribute('writeConcern', $event['started']->getCommand());
} }
); );
...@@ -150,8 +150,8 @@ class MapReduceFunctionalTest extends FunctionalTestCase ...@@ -150,8 +150,8 @@ class MapReduceFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectHasAttribute('lsid', $command); $this->assertObjectHasAttribute('lsid', $event['started']->getCommand());
} }
); );
} }
......
...@@ -40,8 +40,8 @@ class UpdateFunctionalTest extends FunctionalTestCase ...@@ -40,8 +40,8 @@ class UpdateFunctionalTest extends FunctionalTestCase
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
}, },
function(stdClass $command) { function(array $event) {
$this->assertObjectHasAttribute('lsid', $command); $this->assertObjectHasAttribute('lsid', $event['started']->getCommand());
} }
); );
} }
......
...@@ -98,8 +98,8 @@ class WatchFunctionalTest extends FunctionalTestCase ...@@ -98,8 +98,8 @@ class WatchFunctionalTest extends FunctionalTestCase
function() use ($changeStream) { function() use ($changeStream) {
$changeStream->next(); $changeStream->next();
}, },
function(stdClass $command) use (&$commands) { function(array $event) use (&$commands) {
$commands[] = key((array) $command); $commands[] = $event['started']->getCommandName();
} }
); );
$this->fail('ConnectionTimeoutException was not thrown'); $this->fail('ConnectionTimeoutException was not thrown');
...@@ -148,8 +148,8 @@ class WatchFunctionalTest extends FunctionalTestCase ...@@ -148,8 +148,8 @@ class WatchFunctionalTest extends FunctionalTestCase
function() use ($changeStream) { function() use ($changeStream) {
$changeStream->rewind(); $changeStream->rewind();
}, },
function(stdClass $command) use (&$commands) { function(array $event) use (&$commands) {
$commands[] = key((array) $command); $commands[] = $event['started']->getCommandName();
} }
); );
$this->fail('ConnectionTimeoutException was not thrown'); $this->fail('ConnectionTimeoutException was not thrown');
...@@ -592,9 +592,10 @@ class WatchFunctionalTest extends FunctionalTestCase ...@@ -592,9 +592,10 @@ class WatchFunctionalTest extends FunctionalTestCase
function() use ($operation, &$changeStream) { function() use ($operation, &$changeStream) {
$changeStream = $operation->execute($this->getPrimaryServer()); $changeStream = $operation->execute($this->getPrimaryServer());
}, },
function($changeStream) use (&$originalSession) { function(array $event) use (&$originalSession) {
if (isset($changeStream->aggregate)) { $command = $event['started']->getCommand();
$originalSession = bin2hex((string) $changeStream->lsid->id); if (isset($command->aggregate)) {
$originalSession = bin2hex((string) $command->lsid->id);
} }
} }
); );
...@@ -606,9 +607,9 @@ class WatchFunctionalTest extends FunctionalTestCase ...@@ -606,9 +607,9 @@ class WatchFunctionalTest extends FunctionalTestCase
function() use (&$changeStream) { function() use (&$changeStream) {
$changeStream->next(); $changeStream->next();
}, },
function ($changeStream) use (&$sessionAfterResume, &$commands) { function (array $event) use (&$sessionAfterResume, &$commands) {
$commands[] = key((array) $changeStream); $commands[] = $event['started']->getCommandName();
$sessionAfterResume[] = bin2hex((string) $changeStream->lsid->id); $sessionAfterResume[] = bin2hex((string) $event['started']->getCommand()->lsid->id);
} }
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment