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
9ea8b0a6
Commit
9ea8b0a6
authored
Sep 10, 2015
by
Bill Schaller
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #904 from deeky666/fix-functional-exception-test
Fix tear down of some functional exception test cases
parents
a46556fa
30258780
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
9 deletions
+49
-9
ExceptionTest.php
tests/Doctrine/Tests/DBAL/Functional/ExceptionTest.php
+49
-9
No files found.
tests/Doctrine/Tests/DBAL/Functional/ExceptionTest.php
View file @
9ea8b0a6
...
...
@@ -64,8 +64,14 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this
->
setUpForeignKeyConstraintViolationExceptionTest
();
$this
->
_conn
->
insert
(
"constraint_error_table"
,
array
(
'id'
=>
1
));
$this
->
_conn
->
insert
(
"owning_table"
,
array
(
'id'
=>
1
,
'constraint_id'
=>
1
));
try
{
$this
->
_conn
->
insert
(
"constraint_error_table"
,
array
(
'id'
=>
1
));
$this
->
_conn
->
insert
(
"owning_table"
,
array
(
'id'
=>
1
,
'constraint_id'
=>
1
));
}
catch
(
\Exception
$exception
)
{
$this
->
tearDownForeignKeyConstraintViolationExceptionTest
();
throw
$exception
;
}
$this
->
setExpectedException
(
'\Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException'
);
...
...
@@ -74,6 +80,10 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
}
catch
(
ForeignKeyConstraintViolationException
$exception
)
{
$this
->
tearDownForeignKeyConstraintViolationExceptionTest
();
throw
$exception
;
}
catch
(
\Exception
$exception
)
{
$this
->
tearDownForeignKeyConstraintViolationExceptionTest
();
throw
$exception
;
}
...
...
@@ -88,8 +98,14 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this
->
setUpForeignKeyConstraintViolationExceptionTest
();
$this
->
_conn
->
insert
(
"constraint_error_table"
,
array
(
'id'
=>
1
));
$this
->
_conn
->
insert
(
"owning_table"
,
array
(
'id'
=>
1
,
'constraint_id'
=>
1
));
try
{
$this
->
_conn
->
insert
(
"constraint_error_table"
,
array
(
'id'
=>
1
));
$this
->
_conn
->
insert
(
"owning_table"
,
array
(
'id'
=>
1
,
'constraint_id'
=>
1
));
}
catch
(
\Exception
$exception
)
{
$this
->
tearDownForeignKeyConstraintViolationExceptionTest
();
throw
$exception
;
}
$this
->
setExpectedException
(
'\Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException'
);
...
...
@@ -98,6 +114,10 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
}
catch
(
ForeignKeyConstraintViolationException
$exception
)
{
$this
->
tearDownForeignKeyConstraintViolationExceptionTest
();
throw
$exception
;
}
catch
(
\Exception
$exception
)
{
$this
->
tearDownForeignKeyConstraintViolationExceptionTest
();
throw
$exception
;
}
...
...
@@ -112,8 +132,14 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this
->
setUpForeignKeyConstraintViolationExceptionTest
();
$this
->
_conn
->
insert
(
"constraint_error_table"
,
array
(
'id'
=>
1
));
$this
->
_conn
->
insert
(
"owning_table"
,
array
(
'id'
=>
1
,
'constraint_id'
=>
1
));
try
{
$this
->
_conn
->
insert
(
"constraint_error_table"
,
array
(
'id'
=>
1
));
$this
->
_conn
->
insert
(
"owning_table"
,
array
(
'id'
=>
1
,
'constraint_id'
=>
1
));
}
catch
(
\Exception
$exception
)
{
$this
->
tearDownForeignKeyConstraintViolationExceptionTest
();
throw
$exception
;
}
$this
->
setExpectedException
(
'\Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException'
);
...
...
@@ -122,6 +148,10 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
}
catch
(
ForeignKeyConstraintViolationException
$exception
)
{
$this
->
tearDownForeignKeyConstraintViolationExceptionTest
();
throw
$exception
;
}
catch
(
\Exception
$exception
)
{
$this
->
tearDownForeignKeyConstraintViolationExceptionTest
();
throw
$exception
;
}
...
...
@@ -132,14 +162,20 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
{
$platform
=
$this
->
_conn
->
getDatabasePlatform
();
if
(
!
$platform
->
supportsForeignKeyConstraints
())
{
if
(
!
$platform
->
supportsForeignKeyConstraints
())
{
$this
->
markTestSkipped
(
"Only fails on platforms with foreign key constraints."
);
}
$this
->
setUpForeignKeyConstraintViolationExceptionTest
();
$this
->
_conn
->
insert
(
"constraint_error_table"
,
array
(
'id'
=>
1
));
$this
->
_conn
->
insert
(
"owning_table"
,
array
(
'id'
=>
1
,
'constraint_id'
=>
1
));
try
{
$this
->
_conn
->
insert
(
"constraint_error_table"
,
array
(
'id'
=>
1
));
$this
->
_conn
->
insert
(
"owning_table"
,
array
(
'id'
=>
1
,
'constraint_id'
=>
1
));
}
catch
(
\Exception
$exception
)
{
$this
->
tearDownForeignKeyConstraintViolationExceptionTest
();
throw
$exception
;
}
$this
->
setExpectedException
(
'\Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException'
);
...
...
@@ -148,6 +184,10 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
}
catch
(
ForeignKeyConstraintViolationException
$exception
)
{
$this
->
tearDownForeignKeyConstraintViolationExceptionTest
();
throw
$exception
;
}
catch
(
\Exception
$exception
)
{
$this
->
tearDownForeignKeyConstraintViolationExceptionTest
();
throw
$exception
;
}
...
...
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