Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Tomáš Trávníček
doctrine-dbal
Commits
850e3fae
Commit
850e3fae
authored
May 09, 2014
by
Marco Pivetta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoiding mocking `PDOException` as of sebastianbergmann/phpunit-mock-objects#169
parent
5c72ea62
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
PDOExceptionTest.php
tests/Doctrine/Tests/DBAL/Driver/PDOExceptionTest.php
+5
-7
No files found.
tests/Doctrine/Tests/DBAL/Driver/PDOExceptionTest.php
View file @
850e3fae
...
...
@@ -25,7 +25,7 @@ class PDOExceptionTest extends DbalTestCase
*
* @var \PDOException|\PHPUnit_Framework_MockObject_MockObject
*/
private
$wrappedException
Mock
;
private
$wrappedException
;
protected
function
setUp
()
{
...
...
@@ -35,13 +35,11 @@ class PDOExceptionTest extends DbalTestCase
parent
::
setUp
();
$this
->
wrappedExceptionMock
=
$this
->
getMockBuilder
(
'\PDOException'
)
->
setConstructorArgs
(
array
(
self
::
MESSAGE
,
self
::
SQLSTATE
))
->
getMock
();
$this
->
wrappedException
=
new
\PDOException
(
self
::
MESSAGE
,
self
::
SQLSTATE
);
$this
->
wrappedException
Mock
->
errorInfo
=
array
(
self
::
SQLSTATE
,
self
::
ERROR_CODE
);
$this
->
wrappedException
->
errorInfo
=
array
(
self
::
SQLSTATE
,
self
::
ERROR_CODE
);
$this
->
exception
=
new
PDOException
(
$this
->
wrappedException
Mock
);
$this
->
exception
=
new
PDOException
(
$this
->
wrappedException
);
}
public
function
testReturnsCode
()
...
...
@@ -66,6 +64,6 @@ class PDOExceptionTest extends DbalTestCase
public
function
testOriginalExceptionIsInChain
()
{
$this
->
assertSame
(
$this
->
wrappedException
Mock
,
$this
->
exception
->
getPrevious
());
$this
->
assertSame
(
$this
->
wrappedException
,
$this
->
exception
->
getPrevious
());
}
}
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