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
38971507
Commit
38971507
authored
Sep 14, 2016
by
Jeremy Mikola
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #242
parents
5f71c1be
cff6b0aa
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
CollectionFunctionalTest.php
tests/Collection/CollectionFunctionalTest.php
+5
-2
DatabaseFunctionalTest.php
tests/Database/DatabaseFunctionalTest.php
+7
-1
No files found.
tests/Collection/CollectionFunctionalTest.php
View file @
38971507
...
...
@@ -127,7 +127,7 @@ class CollectionFunctionalTest extends FunctionalTestCase
$this
->
assertSameDocument
(
$expected
,
$this
->
collection
->
findOne
(
$filter
,
$options
));
}
public
function
testWithOptionsInherits
ReadPreferenceAndWriteConcern
()
public
function
testWithOptionsInherits
Options
()
{
$collectionOptions
=
[
'readConcern'
=>
new
ReadConcern
(
ReadConcern
::
LOCAL
),
...
...
@@ -140,6 +140,9 @@ class CollectionFunctionalTest extends FunctionalTestCase
$clone
=
$collection
->
withOptions
();
$debug
=
$clone
->
__debugInfo
();
$this
->
assertSame
(
$this
->
manager
,
$debug
[
'manager'
]);
$this
->
assertSame
(
$this
->
getDatabaseName
(),
$debug
[
'databaseName'
]);
$this
->
assertSame
(
$this
->
getCollectionName
(),
$debug
[
'collectionName'
]);
$this
->
assertInstanceOf
(
'MongoDB\Driver\ReadConcern'
,
$debug
[
'readConcern'
]);
$this
->
assertSame
(
ReadConcern
::
LOCAL
,
$debug
[
'readConcern'
]
->
getLevel
());
$this
->
assertInstanceOf
(
'MongoDB\Driver\ReadPreference'
,
$debug
[
'readPreference'
]);
...
...
@@ -150,7 +153,7 @@ class CollectionFunctionalTest extends FunctionalTestCase
$this
->
assertSame
(
WriteConcern
::
MAJORITY
,
$debug
[
'writeConcern'
]
->
getW
());
}
public
function
testWithOptionsPasses
ReadPreferenceAndWriteConcern
()
public
function
testWithOptionsPasses
Options
()
{
$collectionOptions
=
[
'readConcern'
=>
new
ReadConcern
(
ReadConcern
::
LOCAL
),
...
...
tests/Database/DatabaseFunctionalTest.php
View file @
38971507
...
...
@@ -139,8 +139,9 @@ class DatabaseFunctionalTest extends FunctionalTestCase
$collection
=
$database
->
{
$this
->
getCollectionName
()};
$debug
=
$collection
->
__debugInfo
();
$this
->
assertSame
(
$this
->
getCollectionName
(),
$debug
[
'collectionName
'
]);
$this
->
assertSame
(
$this
->
manager
,
$debug
[
'manager
'
]);
$this
->
assertSame
(
$this
->
getDatabaseName
(),
$debug
[
'databaseName'
]);
$this
->
assertSame
(
$this
->
getCollectionName
(),
$debug
[
'collectionName'
]);
$this
->
assertInstanceOf
(
'MongoDB\Driver\WriteConcern'
,
$debug
[
'writeConcern'
]);
$this
->
assertSame
(
WriteConcern
::
MAJORITY
,
$debug
[
'writeConcern'
]
->
getW
());
}
...
...
@@ -158,6 +159,9 @@ class DatabaseFunctionalTest extends FunctionalTestCase
$collection
=
$database
->
selectCollection
(
$this
->
getCollectionName
());
$debug
=
$collection
->
__debugInfo
();
$this
->
assertSame
(
$this
->
manager
,
$debug
[
'manager'
]);
$this
->
assertSame
(
$this
->
getDatabaseName
(),
$debug
[
'databaseName'
]);
$this
->
assertSame
(
$this
->
getCollectionName
(),
$debug
[
'collectionName'
]);
$this
->
assertInstanceOf
(
'MongoDB\Driver\ReadConcern'
,
$debug
[
'readConcern'
]);
$this
->
assertSame
(
ReadConcern
::
LOCAL
,
$debug
[
'readConcern'
]
->
getLevel
());
$this
->
assertInstanceOf
(
'MongoDB\Driver\ReadPreference'
,
$debug
[
'readPreference'
]);
...
...
@@ -252,6 +256,8 @@ class DatabaseFunctionalTest extends FunctionalTestCase
$clone
=
$database
->
withOptions
();
$debug
=
$clone
->
__debugInfo
();
$this
->
assertSame
(
$this
->
manager
,
$debug
[
'manager'
]);
$this
->
assertSame
(
$this
->
getDatabaseName
(),
$debug
[
'databaseName'
]);
$this
->
assertInstanceOf
(
'MongoDB\Driver\ReadConcern'
,
$debug
[
'readConcern'
]);
$this
->
assertSame
(
ReadConcern
::
LOCAL
,
$debug
[
'readConcern'
]
->
getLevel
());
$this
->
assertInstanceOf
(
'MongoDB\Driver\ReadPreference'
,
$debug
[
'readPreference'
]);
...
...
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