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
42bf8258
Commit
42bf8258
authored
Feb 05, 2018
by
Katherine Walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename test cases
parent
af3ec661
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
ChangeStream.php
src/ChangeStream.php
+1
-1
WatchFunctionalTest.php
tests/Operation/WatchFunctionalTest.php
+4
-4
No files found.
src/ChangeStream.php
View file @
42bf8258
...
@@ -128,7 +128,7 @@ class ChangeStream implements Iterator
...
@@ -128,7 +128,7 @@ class ChangeStream implements Iterator
$resumable
=
true
;
$resumable
=
true
;
}
}
if
(
$e
->
getCode
()
===
self
::
CURSOR_NOT_FOUND
)
{
if
(
$e
->
getCode
()
===
self
::
CURSOR_NOT_FOUND
)
{
$resumable
=
true
;
$resumable
=
true
;
}
}
if
(
$e
instanceof
ConnectionTimeoutException
)
{
if
(
$e
instanceof
ConnectionTimeoutException
)
{
$resumable
=
true
;
$resumable
=
true
;
...
...
tests/Operation/WatchFunctionalTest.php
View file @
42bf8258
...
@@ -315,6 +315,8 @@ class WatchFunctionalTest extends FunctionalTestCase
...
@@ -315,6 +315,8 @@ class WatchFunctionalTest extends FunctionalTestCase
$operation
=
new
Watch
(
$this
->
manager
,
$this
->
getDatabaseName
(),
$this
->
getCollectionName
(),
$pipeline
,
[
'maxAwaitTimeMS'
=>
100
]);
$operation
=
new
Watch
(
$this
->
manager
,
$this
->
getDatabaseName
(),
$this
->
getCollectionName
(),
$pipeline
,
[
'maxAwaitTimeMS'
=>
100
]);
$changeStream
=
$operation
->
execute
(
$this
->
getPrimaryServer
());
$changeStream
=
$operation
->
execute
(
$this
->
getPrimaryServer
());
/* Note: we intentionally do not start iteration with rewind() to ensure
* that we test extraction functionality within next(). */
$this
->
insertDocument
([
'x'
=>
1
]);
$this
->
insertDocument
([
'x'
=>
1
]);
$changeStream
->
next
();
$changeStream
->
next
();
...
@@ -379,13 +381,11 @@ class WatchFunctionalTest extends FunctionalTestCase
...
@@ -379,13 +381,11 @@ class WatchFunctionalTest extends FunctionalTestCase
$this
->
assertTrue
(
$changeStream
->
valid
());
$this
->
assertTrue
(
$changeStream
->
valid
());
}
}
public
function
testRe
sumeAfterKillThenNoOperations
()
public
function
testRe
windResumesAfterCursorNotFound
()
{
{
$operation
=
new
Watch
(
$this
->
manager
,
$this
->
getDatabaseName
(),
$this
->
getCollectionName
(),
[],
[
'maxAwaitTimeMS'
=>
100
]);
$operation
=
new
Watch
(
$this
->
manager
,
$this
->
getDatabaseName
(),
$this
->
getCollectionName
(),
[],
[
'maxAwaitTimeMS'
=>
100
]);
$changeStream
=
$operation
->
execute
(
$this
->
getPrimaryServer
());
$changeStream
=
$operation
->
execute
(
$this
->
getPrimaryServer
());
$this
->
insertDocument
([
'_id'
=>
1
,
'x'
=>
'foo'
]);
$this
->
killChangeStreamCursor
(
$changeStream
);
$this
->
killChangeStreamCursor
(
$changeStream
);
$changeStream
->
rewind
();
$changeStream
->
rewind
();
...
@@ -393,7 +393,7 @@ class WatchFunctionalTest extends FunctionalTestCase
...
@@ -393,7 +393,7 @@ class WatchFunctionalTest extends FunctionalTestCase
$this
->
assertNull
(
$changeStream
->
current
());
$this
->
assertNull
(
$changeStream
->
current
());
}
}
public
function
testRe
sumeAfterKillThenOperation
()
public
function
testRe
windExtractsResumeTokenAndNextResumes
()
{
{
$operation
=
new
Watch
(
$this
->
manager
,
$this
->
getDatabaseName
(),
$this
->
getCollectionName
(),
[],
[
'maxAwaitTimeMS'
=>
100
]);
$operation
=
new
Watch
(
$this
->
manager
,
$this
->
getDatabaseName
(),
$this
->
getCollectionName
(),
[],
[
'maxAwaitTimeMS'
=>
100
]);
$changeStream
=
$operation
->
execute
(
$this
->
getPrimaryServer
());
$changeStream
=
$operation
->
execute
(
$this
->
getPrimaryServer
());
...
...
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