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
a71ba94a
Commit
a71ba94a
authored
Mar 13, 2018
by
Jeremy Mikola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move expectException() closer to throwing method
parent
72508634
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
+8
-12
WatchFunctionalTest.php
tests/Operation/WatchFunctionalTest.php
+8
-12
No files found.
tests/Operation/WatchFunctionalTest.php
View file @
a71ba94a
...
@@ -312,9 +312,6 @@ class WatchFunctionalTest extends FunctionalTestCase
...
@@ -312,9 +312,6 @@ class WatchFunctionalTest extends FunctionalTestCase
{
{
$pipeline
=
[[
'$project'
=>
[
'_id'
=>
0
]]];
$pipeline
=
[[
'$project'
=>
[
'_id'
=>
0
]]];
$this
->
expectException
(
ResumeTokenException
::
class
);
$this
->
expectExceptionMessage
(
'Resume token not found in change document'
);
$operation
=
new
Watch
(
$this
->
manager
,
$this
->
getDatabaseName
(),
$this
->
getCollectionName
(),
$pipeline
,
$this
->
defaultOptions
);
$operation
=
new
Watch
(
$this
->
manager
,
$this
->
getDatabaseName
(),
$this
->
getCollectionName
(),
$pipeline
,
$this
->
defaultOptions
);
$changeStream
=
$operation
->
execute
(
$this
->
getPrimaryServer
());
$changeStream
=
$operation
->
execute
(
$this
->
getPrimaryServer
());
...
@@ -322,6 +319,8 @@ class WatchFunctionalTest extends FunctionalTestCase
...
@@ -322,6 +319,8 @@ class WatchFunctionalTest extends FunctionalTestCase
* that we test extraction functionality within next(). */
* that we test extraction functionality within next(). */
$this
->
insertDocument
([
'x'
=>
1
]);
$this
->
insertDocument
([
'x'
=>
1
]);
$this
->
expectException
(
ResumeTokenException
::
class
);
$this
->
expectExceptionMessage
(
'Resume token not found in change document'
);
$changeStream
->
next
();
$changeStream
->
next
();
}
}
...
@@ -329,14 +328,13 @@ class WatchFunctionalTest extends FunctionalTestCase
...
@@ -329,14 +328,13 @@ class WatchFunctionalTest extends FunctionalTestCase
{
{
$pipeline
=
[[
'$project'
=>
[
'_id'
=>
0
]]];
$pipeline
=
[[
'$project'
=>
[
'_id'
=>
0
]]];
$this
->
expectException
(
ResumeTokenException
::
class
);
$this
->
expectExceptionMessage
(
'Resume token not found in change document'
);
$operation
=
new
Watch
(
$this
->
manager
,
$this
->
getDatabaseName
(),
$this
->
getCollectionName
(),
$pipeline
,
$this
->
defaultOptions
);
$operation
=
new
Watch
(
$this
->
manager
,
$this
->
getDatabaseName
(),
$this
->
getCollectionName
(),
$pipeline
,
$this
->
defaultOptions
);
$changeStream
=
$operation
->
execute
(
$this
->
getPrimaryServer
());
$changeStream
=
$operation
->
execute
(
$this
->
getPrimaryServer
());
$this
->
insertDocument
([
'x'
=>
1
]);
$this
->
insertDocument
([
'x'
=>
1
]);
$this
->
expectException
(
ResumeTokenException
::
class
);
$this
->
expectExceptionMessage
(
'Resume token not found in change document'
);
$changeStream
->
rewind
();
$changeStream
->
rewind
();
}
}
...
@@ -344,9 +342,6 @@ class WatchFunctionalTest extends FunctionalTestCase
...
@@ -344,9 +342,6 @@ class WatchFunctionalTest extends FunctionalTestCase
{
{
$pipeline
=
[[
'$project'
=>
[
'_id'
=>
[
'$literal'
=>
'foo'
]]]];
$pipeline
=
[[
'$project'
=>
[
'_id'
=>
[
'$literal'
=>
'foo'
]]]];
$this
->
expectException
(
ResumeTokenException
::
class
);
$this
->
expectExceptionMessage
(
'Expected resume token to have type "array or object" but found "string"'
);
$operation
=
new
Watch
(
$this
->
manager
,
$this
->
getDatabaseName
(),
$this
->
getCollectionName
(),
$pipeline
,
$this
->
defaultOptions
);
$operation
=
new
Watch
(
$this
->
manager
,
$this
->
getDatabaseName
(),
$this
->
getCollectionName
(),
$pipeline
,
$this
->
defaultOptions
);
$changeStream
=
$operation
->
execute
(
$this
->
getPrimaryServer
());
$changeStream
=
$operation
->
execute
(
$this
->
getPrimaryServer
());
...
@@ -354,6 +349,8 @@ class WatchFunctionalTest extends FunctionalTestCase
...
@@ -354,6 +349,8 @@ class WatchFunctionalTest extends FunctionalTestCase
* that we test extraction functionality within next(). */
* that we test extraction functionality within next(). */
$this
->
insertDocument
([
'x'
=>
1
]);
$this
->
insertDocument
([
'x'
=>
1
]);
$this
->
expectException
(
ResumeTokenException
::
class
);
$this
->
expectExceptionMessage
(
'Expected resume token to have type "array or object" but found "string"'
);
$changeStream
->
next
();
$changeStream
->
next
();
}
}
...
@@ -361,14 +358,13 @@ class WatchFunctionalTest extends FunctionalTestCase
...
@@ -361,14 +358,13 @@ class WatchFunctionalTest extends FunctionalTestCase
{
{
$pipeline
=
[[
'$project'
=>
[
'_id'
=>
[
'$literal'
=>
'foo'
]]]];
$pipeline
=
[[
'$project'
=>
[
'_id'
=>
[
'$literal'
=>
'foo'
]]]];
$this
->
expectException
(
ResumeTokenException
::
class
);
$this
->
expectExceptionMessage
(
'Expected resume token to have type "array or object" but found "string"'
);
$operation
=
new
Watch
(
$this
->
manager
,
$this
->
getDatabaseName
(),
$this
->
getCollectionName
(),
$pipeline
,
$this
->
defaultOptions
);
$operation
=
new
Watch
(
$this
->
manager
,
$this
->
getDatabaseName
(),
$this
->
getCollectionName
(),
$pipeline
,
$this
->
defaultOptions
);
$changeStream
=
$operation
->
execute
(
$this
->
getPrimaryServer
());
$changeStream
=
$operation
->
execute
(
$this
->
getPrimaryServer
());
$this
->
insertDocument
([
'x'
=>
1
]);
$this
->
insertDocument
([
'x'
=>
1
]);
$this
->
expectException
(
ResumeTokenException
::
class
);
$this
->
expectExceptionMessage
(
'Expected resume token to have type "array or object" but found "string"'
);
$changeStream
->
rewind
();
$changeStream
->
rewind
();
}
}
...
...
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