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
8acab3b4
Commit
8acab3b4
authored
Feb 02, 2018
by
Jeremy Mikola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix indentation
parent
6a46e15c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
ChangeStream.php
src/ChangeStream.php
+2
-2
WatchFunctionalTest.php
tests/Operation/WatchFunctionalTest.php
+2
-2
No files found.
src/ChangeStream.php
View file @
8acab3b4
...
@@ -100,7 +100,7 @@ class ChangeStream implements Iterator
...
@@ -100,7 +100,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
;
...
@@ -147,7 +147,7 @@ class ChangeStream implements Iterator
...
@@ -147,7 +147,7 @@ class ChangeStream implements Iterator
if
(
isset
(
$document
->
_id
))
{
if
(
isset
(
$document
->
_id
))
{
$this
->
resumeToken
=
is_array
(
$document
)
?
$document
[
'_id'
]
:
$document
->
_id
;
$this
->
resumeToken
=
is_array
(
$document
)
?
$document
[
'_id'
]
:
$document
->
_id
;
}
else
{
}
else
{
throw
new
ResumeTokenException
(
"Cannot provide resume functionality when the resume token is missing"
);
throw
new
ResumeTokenException
(
"Cannot provide resume functionality when the resume token is missing"
);
}
}
}
}
...
...
tests/Operation/WatchFunctionalTest.php
View file @
8acab3b4
...
@@ -21,7 +21,7 @@ class WatchFunctionalTest extends FunctionalTestCase
...
@@ -21,7 +21,7 @@ class WatchFunctionalTest extends FunctionalTestCase
if
(
version_compare
(
$this
->
getFeatureCompatibilityVersion
(),
'3.6'
,
'<'
))
{
if
(
version_compare
(
$this
->
getFeatureCompatibilityVersion
(),
'3.6'
,
'<'
))
{
$this
->
markTestSkipped
(
'$changeStream is only supported on FCV 3.6 or higher'
);
$this
->
markTestSkipped
(
'$changeStream is only supported on FCV 3.6 or higher'
);
}
}
}
}
public
function
testResume
()
public
function
testResume
()
{
{
...
@@ -59,7 +59,7 @@ class WatchFunctionalTest extends FunctionalTestCase
...
@@ -59,7 +59,7 @@ class WatchFunctionalTest extends FunctionalTestCase
'documentKey'
=>
(
object
)
[
'_id'
=>
3
]
'documentKey'
=>
(
object
)
[
'_id'
=>
3
]
]);
]);
$this
->
assertEquals
(
$expectedResult
,
$changeStream
->
current
());
$this
->
assertEquals
(
$expectedResult
,
$changeStream
->
current
());
}
}
public
function
testNoChangeAfterResumeBeforeInsert
()
public
function
testNoChangeAfterResumeBeforeInsert
()
{
{
...
...
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