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
33fb14fb
Unverified
Commit
33fb14fb
authored
Aug 22, 2019
by
Andreas Braun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PHPLIB-462: Fix PHPUnit warnings
parent
bfbf5a76
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
CollectionFunctionalTest.php
tests/Collection/CollectionFunctionalTest.php
+7
-4
ErrorExpectation.php
tests/SpecTests/ErrorExpectation.php
+2
-2
No files found.
tests/Collection/CollectionFunctionalTest.php
View file @
33fb14fb
...
@@ -9,6 +9,7 @@ use MongoDB\Driver\ReadConcern;
...
@@ -9,6 +9,7 @@ use MongoDB\Driver\ReadConcern;
use
MongoDB\Driver\ReadPreference
;
use
MongoDB\Driver\ReadPreference
;
use
MongoDB\Driver\WriteConcern
;
use
MongoDB\Driver\WriteConcern
;
use
MongoDB\Exception\InvalidArgumentException
;
use
MongoDB\Exception\InvalidArgumentException
;
use
MongoDB\Exception\UnsupportedException
;
use
MongoDB\Operation\Count
;
use
MongoDB\Operation\Count
;
use
MongoDB\Operation\MapReduce
;
use
MongoDB\Operation\MapReduce
;
use
MongoDB\Tests\CommandObserver
;
use
MongoDB\Tests\CommandObserver
;
...
@@ -619,8 +620,6 @@ class CollectionFunctionalTest extends FunctionalTestCase
...
@@ -619,8 +620,6 @@ class CollectionFunctionalTest extends FunctionalTestCase
/**
/**
* @dataProvider collectionWriteMethodClosures
* @dataProvider collectionWriteMethodClosures
* @expectedException MongoDB\Exception\UnsupportedException
* @expectedExceptionMessage "writeConcern" option cannot be specified within a transaction
*/
*/
public
function
testMethodInTransactionWithWriteConcernOption
(
$method
)
public
function
testMethodInTransactionWithWriteConcernOption
(
$method
)
{
{
...
@@ -631,6 +630,9 @@ class CollectionFunctionalTest extends FunctionalTestCase
...
@@ -631,6 +630,9 @@ class CollectionFunctionalTest extends FunctionalTestCase
$session
=
$this
->
manager
->
startSession
();
$session
=
$this
->
manager
->
startSession
();
$session
->
startTransaction
();
$session
->
startTransaction
();
$this
->
expectException
(
UnsupportedException
::
class
);
$this
->
expectExceptionMessage
(
'"writeConcern" option cannot be specified within a transaction'
);
try
{
try
{
call_user_func
(
$method
,
$this
->
collection
,
$session
,
[
'writeConcern'
=>
new
WriteConcern
(
1
)]);
call_user_func
(
$method
,
$this
->
collection
,
$session
,
[
'writeConcern'
=>
new
WriteConcern
(
1
)]);
}
finally
{
}
finally
{
...
@@ -640,8 +642,6 @@ class CollectionFunctionalTest extends FunctionalTestCase
...
@@ -640,8 +642,6 @@ class CollectionFunctionalTest extends FunctionalTestCase
/**
/**
* @dataProvider collectionReadMethodClosures
* @dataProvider collectionReadMethodClosures
* @expectedException MongoDB\Exception\UnsupportedException
* @expectedExceptionMessage "readConcern" option cannot be specified within a transaction
*/
*/
public
function
testMethodInTransactionWithReadConcernOption
(
$method
)
public
function
testMethodInTransactionWithReadConcernOption
(
$method
)
{
{
...
@@ -652,6 +652,9 @@ class CollectionFunctionalTest extends FunctionalTestCase
...
@@ -652,6 +652,9 @@ class CollectionFunctionalTest extends FunctionalTestCase
$session
=
$this
->
manager
->
startSession
();
$session
=
$this
->
manager
->
startSession
();
$session
->
startTransaction
();
$session
->
startTransaction
();
$this
->
expectException
(
UnsupportedException
::
class
);
$this
->
expectExceptionMessage
(
'"readConcern" option cannot be specified within a transaction'
);
try
{
try
{
call_user_func
(
$method
,
$this
->
collection
,
$session
,
[
'readConcern'
=>
new
ReadConcern
(
ReadConcern
::
LOCAL
)]);
call_user_func
(
$method
,
$this
->
collection
,
$session
,
[
'readConcern'
=>
new
ReadConcern
(
ReadConcern
::
LOCAL
)]);
}
finally
{
}
finally
{
...
...
tests/SpecTests/ErrorExpectation.php
View file @
33fb14fb
...
@@ -132,7 +132,7 @@ final class ErrorExpectation
...
@@ -132,7 +132,7 @@ final class ErrorExpectation
$test
->
assertNotNull
(
$actual
);
$test
->
assertNotNull
(
$actual
);
if
(
isset
(
$this
->
messageContains
))
{
if
(
isset
(
$this
->
messageContains
))
{
$test
->
assert
Contains
(
$this
->
messageContains
,
$actual
->
getMessage
(),
''
,
true
/* case-insensitive */
);
$test
->
assert
StringContainsStringIgnoringCase
(
$this
->
messageContains
,
$actual
->
getMessage
()
);
}
}
if
(
isset
(
$this
->
codeName
))
{
if
(
isset
(
$this
->
codeName
))
{
...
@@ -178,7 +178,7 @@ final class ErrorExpectation
...
@@ -178,7 +178,7 @@ final class ErrorExpectation
$test
->
assertInstanceOf
(
CommandException
::
class
,
$actual
);
$test
->
assertInstanceOf
(
CommandException
::
class
,
$actual
);
$result
=
$actual
->
getResultDocument
();
$result
=
$actual
->
getResultDocument
();
$test
->
assertObjectHasAttribute
(
'codeName'
,
$result
);
$test
->
assertObjectHasAttribute
(
'codeName'
,
$result
);
$test
->
assert
AttributeSame
(
$this
->
codeName
,
'codeName'
,
$result
);
$test
->
assert
Same
(
$this
->
codeName
,
$result
->
codeName
);
}
}
private
static
function
isArrayOfStrings
(
$array
)
private
static
function
isArrayOfStrings
(
$array
)
...
...
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