Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongo-php-library
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sinan
mongo-php-library
Commits
0f848cbd
Commit
0f848cbd
authored
Jun 26, 2018
by
Jeremy Mikola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor CommandObserver to track all three APM events
parent
2a288a03
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
98 additions
and
92 deletions
+98
-92
CollectionFunctionalTest.php
tests/Collection/CollectionFunctionalTest.php
+2
-1
CommandObserver.php
tests/CommandObserver.php
+3
-1
ReadableStreamFunctionalTest.php
tests/GridFS/ReadableStreamFunctionalTest.php
+6
-6
AggregateFunctionalTest.php
tests/Operation/AggregateFunctionalTest.php
+10
-10
BulkWriteFunctionalTest.php
tests/Operation/BulkWriteFunctionalTest.php
+2
-2
CountFunctionalTest.php
tests/Operation/CountFunctionalTest.php
+4
-4
CreateCollectionFunctionalTest.php
tests/Operation/CreateCollectionFunctionalTest.php
+4
-4
CreateIndexesFunctionalTest.php
tests/Operation/CreateIndexesFunctionalTest.php
+4
-4
DatabaseCommandFunctionalTest.php
tests/Operation/DatabaseCommandFunctionalTest.php
+2
-2
DeleteFunctionalTest.php
tests/Operation/DeleteFunctionalTest.php
+2
-2
DistinctFunctionalTest.php
tests/Operation/DistinctFunctionalTest.php
+4
-4
DropCollectionFunctionalTest.php
tests/Operation/DropCollectionFunctionalTest.php
+4
-4
DropDatabaseFunctionalTest.php
tests/Operation/DropDatabaseFunctionalTest.php
+4
-4
DropIndexesFunctionalTest.php
tests/Operation/DropIndexesFunctionalTest.php
+4
-4
ExplainFunctionalTest.php
tests/Operation/ExplainFunctionalTest.php
+4
-2
FindAndModifyFunctionalTest.php
tests/Operation/FindAndModifyFunctionalTest.php
+6
-6
FindFunctionalTest.php
tests/Operation/FindFunctionalTest.php
+4
-4
InsertManyFunctionalTest.php
tests/Operation/InsertManyFunctionalTest.php
+2
-2
InsertOneFunctionalTest.php
tests/Operation/InsertOneFunctionalTest.php
+2
-2
ListCollectionsFunctionalTest.php
tests/Operation/ListCollectionsFunctionalTest.php
+2
-2
ListDatabasesFunctionalTest.php
tests/Operation/ListDatabasesFunctionalTest.php
+2
-2
ListIndexesFunctionalTest.php
tests/Operation/ListIndexesFunctionalTest.php
+2
-2
MapReduceFunctionalTest.php
tests/Operation/MapReduceFunctionalTest.php
+6
-6
UpdateFunctionalTest.php
tests/Operation/UpdateFunctionalTest.php
+2
-2
WatchFunctionalTest.php
tests/Operation/WatchFunctionalTest.php
+11
-10
No files found.
tests/Collection/CollectionFunctionalTest.php
View file @
0f848cbd
...
...
@@ -123,7 +123,8 @@ class CollectionFunctionalTest extends FunctionalTestCase
]
);
},
function
(
stdClass
$command
)
{
function
(
array
$event
)
{
$command
=
$event
[
'started'
]
->
getCommand
();
$this
->
assertObjectHasAttribute
(
'lsid'
,
$command
);
$this
->
assertObjectHasAttribute
(
'maxTimeMS'
,
$command
);
$this
->
assertObjectHasAttribute
(
'writeConcern'
,
$command
);
...
...
tests/CommandObserver.php
View file @
0f848cbd
...
...
@@ -38,14 +38,16 @@ class CommandObserver implements CommandSubscriber
public
function
commandStarted
(
CommandStartedEvent
$event
)
{
$this
->
commands
[
]
=
$event
->
getCommand
()
;
$this
->
commands
[
$event
->
getRequestId
()][
'started'
]
=
$event
;
}
public
function
commandSucceeded
(
CommandSucceededEvent
$event
)
{
$this
->
commands
[
$event
->
getRequestId
()][
'succeeded'
]
=
$event
;
}
public
function
commandFailed
(
CommandFailedEvent
$event
)
{
$this
->
commands
[
$event
->
getRequestId
()][
'failed'
]
=
$event
;
}
}
tests/GridFS/ReadableStreamFunctionalTest.php
View file @
0f848cbd
...
...
@@ -221,8 +221,8 @@ class ReadableStreamFunctionalTest extends FunctionalTestCase
$stream
->
seek
(
$offset
);
$this
->
assertSame
(
$expectedBytes
,
$stream
->
readBytes
(
$length
));
},
function
(
stdClass
$command
)
use
(
&
$commands
)
{
$commands
[]
=
key
((
array
)
$command
);
function
(
array
$event
)
use
(
&
$commands
)
{
$commands
[]
=
$event
[
'started'
]
->
getCommandName
(
);
}
);
...
...
@@ -257,8 +257,8 @@ class ReadableStreamFunctionalTest extends FunctionalTestCase
$stream
->
seek
(
$offset
);
$this
->
assertSame
(
$expectedBytes
,
$stream
->
readBytes
(
$length
));
},
function
(
stdClass
$command
)
use
(
&
$commands
)
{
$commands
[]
=
key
((
array
)
$command
);
function
(
array
$event
)
use
(
&
$commands
)
{
$commands
[]
=
$event
[
'started'
]
->
getCommandName
(
);
}
);
...
...
@@ -291,8 +291,8 @@ class ReadableStreamFunctionalTest extends FunctionalTestCase
$stream
->
seek
(
$offset
);
$this
->
assertSame
(
$expectedBytes
,
$stream
->
readBytes
(
$length
));
},
function
(
stdClass
$command
)
use
(
&
$commands
)
{
$commands
[]
=
key
((
array
)
$command
);
function
(
array
$event
)
use
(
&
$commands
)
{
$commands
[]
=
$event
[
'started'
]
->
getCommandName
(
);
}
);
...
...
tests/Operation/AggregateFunctionalTest.php
View file @
0f848cbd
...
...
@@ -28,8 +28,8 @@ class AggregateFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertSame
(
1
,
$
command
->
aggregate
);
function
(
array
$event
)
{
$this
->
assertSame
(
1
,
$
event
[
'started'
]
->
getCommand
()
->
aggregate
);
}
);
}
...
...
@@ -47,8 +47,8 @@ class AggregateFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectNotHasAttribute
(
'readConcern'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectNotHasAttribute
(
'readConcern'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
@@ -66,8 +66,8 @@ class AggregateFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectNotHasAttribute
(
'writeConcern'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectNotHasAttribute
(
'writeConcern'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
@@ -112,8 +112,8 @@ class AggregateFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
@@ -185,8 +185,8 @@ class AggregateFunctionalTest extends FunctionalTestCase
$this
->
assertCount
(
1
,
$results
);
$this
->
assertObjectHasAttribute
(
'stages'
,
current
(
$results
));
},
function
(
stdClass
$command
)
{
$this
->
assertObjectNotHasAttribute
(
'writeConcern'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectNotHasAttribute
(
'writeConcern'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
...
...
tests/Operation/BulkWriteFunctionalTest.php
View file @
0f848cbd
...
...
@@ -299,8 +299,8 @@ class BulkWriteFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
tests/Operation/CountFunctionalTest.php
View file @
0f848cbd
...
...
@@ -23,8 +23,8 @@ class CountFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectNotHasAttribute
(
'readConcern'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectNotHasAttribute
(
'readConcern'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
@@ -87,8 +87,8 @@ class CountFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
tests/Operation/CreateCollectionFunctionalTest.php
View file @
0f848cbd
...
...
@@ -20,8 +20,8 @@ class CreateCollectionFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectNotHasAttribute
(
'writeConcern'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectNotHasAttribute
(
'writeConcern'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
@@ -42,8 +42,8 @@ class CreateCollectionFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
tests/Operation/CreateIndexesFunctionalTest.php
View file @
0f848cbd
...
...
@@ -140,8 +140,8 @@ class CreateIndexesFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectNotHasAttribute
(
'writeConcern'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectNotHasAttribute
(
'writeConcern'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
@@ -163,8 +163,8 @@ class CreateIndexesFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
tests/Operation/DatabaseCommandFunctionalTest.php
View file @
0f848cbd
...
...
@@ -24,8 +24,8 @@ class DatabaseCommandFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
tests/Operation/DeleteFunctionalTest.php
View file @
0f848cbd
...
...
@@ -79,8 +79,8 @@ class DeleteFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
tests/Operation/DistinctFunctionalTest.php
View file @
0f848cbd
...
...
@@ -22,8 +22,8 @@ class DistinctFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectNotHasAttribute
(
'readConcern'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectNotHasAttribute
(
'readConcern'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
@@ -46,8 +46,8 @@ class DistinctFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
tests/Operation/DropCollectionFunctionalTest.php
View file @
0f848cbd
...
...
@@ -22,8 +22,8 @@ class DropCollectionFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectNotHasAttribute
(
'writeConcern'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectNotHasAttribute
(
'writeConcern'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
@@ -69,8 +69,8 @@ class DropCollectionFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
tests/Operation/DropDatabaseFunctionalTest.php
View file @
0f848cbd
...
...
@@ -22,8 +22,8 @@ class DropDatabaseFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectNotHasAttribute
(
'writeConcern'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectNotHasAttribute
(
'writeConcern'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
@@ -73,8 +73,8 @@ class DropDatabaseFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
tests/Operation/DropIndexesFunctionalTest.php
View file @
0f848cbd
...
...
@@ -28,8 +28,8 @@ class DropIndexesFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectNotHasAttribute
(
'writeConcern'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectNotHasAttribute
(
'writeConcern'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
@@ -137,8 +137,8 @@ class DropIndexesFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
tests/Operation/ExplainFunctionalTest.php
View file @
0f848cbd
...
...
@@ -182,7 +182,8 @@ class ExplainFunctionalTest extends FunctionalTestCase
$explainOperation
=
new
Explain
(
$this
->
getDatabaseName
(),
$operation
,
[
'typeMap'
=>
[
'root'
=>
'array'
,
'document'
=>
'array'
]]);
$explainOperation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
function
(
array
$event
)
{
$command
=
$event
[
'started'
]
->
getCommand
();
$this
->
assertObjectNotHasAttribute
(
'maxAwaitTimeMS'
,
$command
->
explain
);
$this
->
assertObjectHasAttribute
(
'tailable'
,
$command
->
explain
);
$this
->
assertObjectHasAttribute
(
'awaitData'
,
$command
->
explain
);
...
...
@@ -206,7 +207,8 @@ class ExplainFunctionalTest extends FunctionalTestCase
$explainOperation
=
new
Explain
(
$this
->
getDatabaseName
(),
$operation
,
[
'typeMap'
=>
[
'root'
=>
'array'
,
'document'
=>
'array'
]]);
$explainOperation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
function
(
array
$event
)
{
$command
=
$event
[
'started'
]
->
getCommand
();
$this
->
assertObjectHasAttribute
(
'sort'
,
$command
->
explain
);
$this
->
assertObjectNotHasAttribute
(
'modifiers'
,
$command
->
explain
);
}
...
...
tests/Operation/FindAndModifyFunctionalTest.php
View file @
0f848cbd
...
...
@@ -30,8 +30,8 @@ class FindAndModifyFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$server
);
},
function
(
stdClass
$command
)
{
$this
->
assertObjectNotHasAttribute
(
'readConcern'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectNotHasAttribute
(
'readConcern'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
@@ -48,8 +48,8 @@ class FindAndModifyFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectNotHasAttribute
(
'writeConcern'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectNotHasAttribute
(
'writeConcern'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
@@ -70,8 +70,8 @@ class FindAndModifyFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
tests/Operation/FindFunctionalTest.php
View file @
0f848cbd
...
...
@@ -25,8 +25,8 @@ class FindFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectNotHasAttribute
(
'readConcern'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectNotHasAttribute
(
'readConcern'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
@@ -99,8 +99,8 @@ class FindFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
tests/Operation/InsertManyFunctionalTest.php
View file @
0f848cbd
...
...
@@ -70,8 +70,8 @@ class InsertManyFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
tests/Operation/InsertOneFunctionalTest.php
View file @
0f848cbd
...
...
@@ -85,8 +85,8 @@ class InsertOneFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
tests/Operation/ListCollectionsFunctionalTest.php
View file @
0f848cbd
...
...
@@ -86,8 +86,8 @@ class ListCollectionsFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
tests/Operation/ListDatabasesFunctionalTest.php
View file @
0f848cbd
...
...
@@ -66,8 +66,8 @@ class ListDatabasesFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
tests/Operation/ListIndexesFunctionalTest.php
View file @
0f848cbd
...
...
@@ -59,8 +59,8 @@ class ListIndexesFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
tests/Operation/MapReduceFunctionalTest.php
View file @
0f848cbd
...
...
@@ -31,8 +31,8 @@ class MapReduceFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectNotHasAttribute
(
'readConcern'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectNotHasAttribute
(
'readConcern'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
@@ -55,8 +55,8 @@ class MapReduceFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectNotHasAttribute
(
'writeConcern'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectNotHasAttribute
(
'writeConcern'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
...
...
@@ -150,8 +150,8 @@ class MapReduceFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
tests/Operation/UpdateFunctionalTest.php
View file @
0f848cbd
...
...
@@ -40,8 +40,8 @@ class UpdateFunctionalTest extends FunctionalTestCase
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
stdClass
$command
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
command
);
function
(
array
$event
)
{
$this
->
assertObjectHasAttribute
(
'lsid'
,
$
event
[
'started'
]
->
getCommand
()
);
}
);
}
...
...
tests/Operation/WatchFunctionalTest.php
View file @
0f848cbd
...
...
@@ -98,8 +98,8 @@ class WatchFunctionalTest extends FunctionalTestCase
function
()
use
(
$changeStream
)
{
$changeStream
->
next
();
},
function
(
stdClass
$command
)
use
(
&
$commands
)
{
$commands
[]
=
key
((
array
)
$command
);
function
(
array
$event
)
use
(
&
$commands
)
{
$commands
[]
=
$event
[
'started'
]
->
getCommandName
(
);
}
);
$this
->
fail
(
'ConnectionTimeoutException was not thrown'
);
...
...
@@ -148,8 +148,8 @@ class WatchFunctionalTest extends FunctionalTestCase
function
()
use
(
$changeStream
)
{
$changeStream
->
rewind
();
},
function
(
stdClass
$command
)
use
(
&
$commands
)
{
$commands
[]
=
key
((
array
)
$command
);
function
(
array
$event
)
use
(
&
$commands
)
{
$commands
[]
=
$event
[
'started'
]
->
getCommandName
(
);
}
);
$this
->
fail
(
'ConnectionTimeoutException was not thrown'
);
...
...
@@ -592,9 +592,10 @@ class WatchFunctionalTest extends FunctionalTestCase
function
()
use
(
$operation
,
&
$changeStream
)
{
$changeStream
=
$operation
->
execute
(
$this
->
getPrimaryServer
());
},
function
(
$changeStream
)
use
(
&
$originalSession
)
{
if
(
isset
(
$changeStream
->
aggregate
))
{
$originalSession
=
bin2hex
((
string
)
$changeStream
->
lsid
->
id
);
function
(
array
$event
)
use
(
&
$originalSession
)
{
$command
=
$event
[
'started'
]
->
getCommand
();
if
(
isset
(
$command
->
aggregate
))
{
$originalSession
=
bin2hex
((
string
)
$command
->
lsid
->
id
);
}
}
);
...
...
@@ -606,9 +607,9 @@ class WatchFunctionalTest extends FunctionalTestCase
function
()
use
(
&
$changeStream
)
{
$changeStream
->
next
();
},
function
(
$changeStream
)
use
(
&
$sessionAfterResume
,
&
$commands
)
{
$commands
[]
=
key
((
array
)
$changeStream
);
$sessionAfterResume
[]
=
bin2hex
((
string
)
$
changeStream
->
lsid
->
id
);
function
(
array
$event
)
use
(
&
$sessionAfterResume
,
&
$commands
)
{
$commands
[]
=
$event
[
'started'
]
->
getCommandName
(
);
$sessionAfterResume
[]
=
bin2hex
((
string
)
$
event
[
'started'
]
->
getCommand
()
->
lsid
->
id
);
}
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment