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
5c7ce60a
Commit
5c7ce60a
authored
Jan 11, 2016
by
Jeremy Mikola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test for invalid typeMap options
parent
e4511d9a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
+28
-0
ClientTest.php
tests/ClientTest.php
+20
-0
CollectionFunctionalTest.php
tests/Collection/CollectionFunctionalTest.php
+4
-0
DatabaseFunctionalTest.php
tests/Database/DatabaseFunctionalTest.php
+4
-0
No files found.
tests/ClientTest.php
View file @
5c7ce60a
...
@@ -19,6 +19,26 @@ class ClientTest extends TestCase
...
@@ -19,6 +19,26 @@ class ClientTest extends TestCase
$this
->
assertEquals
(
'mongodb://localhost:27017'
,
(
string
)
$client
);
$this
->
assertEquals
(
'mongodb://localhost:27017'
,
(
string
)
$client
);
}
}
/**
* @expectedException MongoDB\Exception\InvalidArgumentException
* @dataProvider provideInvalidConstructorDriverOptions
*/
public
function
testConstructorDriverOptionTypeChecks
(
array
$driverOptions
)
{
new
Client
(
$this
->
getUri
(),
[],
$driverOptions
);
}
public
function
provideInvalidConstructorDriverOptions
()
{
$options
=
[];
foreach
(
$this
->
getInvalidArrayValues
()
as
$value
)
{
$options
[][]
=
[
'typeMap'
=>
$value
];
}
return
$options
;
}
public
function
testToString
()
public
function
testToString
()
{
{
$client
=
new
Client
(
$this
->
getUri
());
$client
=
new
Client
(
$this
->
getUri
());
...
...
tests/Collection/CollectionFunctionalTest.php
View file @
5c7ce60a
...
@@ -55,6 +55,10 @@ class CollectionFunctionalTest extends FunctionalTestCase
...
@@ -55,6 +55,10 @@ class CollectionFunctionalTest extends FunctionalTestCase
$options
[][]
=
[
'readPreference'
=>
$value
];
$options
[][]
=
[
'readPreference'
=>
$value
];
}
}
foreach
(
$this
->
getInvalidArrayValues
()
as
$value
)
{
$options
[][]
=
[
'typeMap'
=>
$value
];
}
foreach
(
$this
->
getInvalidWriteConcernValues
()
as
$value
)
{
foreach
(
$this
->
getInvalidWriteConcernValues
()
as
$value
)
{
$options
[][]
=
[
'writeConcern'
=>
$value
];
$options
[][]
=
[
'writeConcern'
=>
$value
];
}
}
...
...
tests/Database/DatabaseFunctionalTest.php
View file @
5c7ce60a
...
@@ -52,6 +52,10 @@ class DatabaseFunctionalTest extends FunctionalTestCase
...
@@ -52,6 +52,10 @@ class DatabaseFunctionalTest extends FunctionalTestCase
$options
[][]
=
[
'readPreference'
=>
$value
];
$options
[][]
=
[
'readPreference'
=>
$value
];
}
}
foreach
(
$this
->
getInvalidArrayValues
()
as
$value
)
{
$options
[][]
=
[
'typeMap'
=>
$value
];
}
foreach
(
$this
->
getInvalidWriteConcernValues
()
as
$value
)
{
foreach
(
$this
->
getInvalidWriteConcernValues
()
as
$value
)
{
$options
[][]
=
[
'writeConcern'
=>
$value
];
$options
[][]
=
[
'writeConcern'
=>
$value
];
}
}
...
...
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