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
cff6b0aa
Commit
cff6b0aa
authored
Sep 12, 2016
by
Jeremy Mikola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test that selectDatabase() and selectCollection() inherit required params
parent
b43b9543
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
CollectionFunctionalTest.php
tests/Collection/CollectionFunctionalTest.php
+3
-0
DatabaseFunctionalTest.php
tests/Database/DatabaseFunctionalTest.php
+7
-1
No files found.
tests/Collection/CollectionFunctionalTest.php
View file @
cff6b0aa
...
...
@@ -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'
]);
...
...
tests/Database/DatabaseFunctionalTest.php
View file @
cff6b0aa
...
...
@@ -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