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
b37ff7e9
Commit
b37ff7e9
authored
Nov 13, 2011
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A new temporary table test refactoring (if i could reproduce it locally...)
parent
9e757030
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
+8
-12
TemporaryTableTest.php
tests/Doctrine/Tests/DBAL/Functional/TemporaryTableTest.php
+8
-12
No files found.
tests/Doctrine/Tests/DBAL/Functional/TemporaryTableTest.php
View file @
b37ff7e9
...
...
@@ -20,11 +20,11 @@ class TemporaryTableTest extends \Doctrine\Tests\DbalFunctionalTestCase
public
function
tearDown
()
{
try
{
$tempTable
=
$this
->
_conn
->
getDatabasePlatform
()
->
getTemporaryTableName
(
"temporary"
);
$this
->
_conn
->
exec
(
$this
->
_conn
->
getDatabasePlatform
()
->
getDropTemporaryTableSQL
(
$tempTable
)
);
}
catch
(
\Exception
$e
)
{
if
(
$this
->
_conn
)
{
try
{
$tempTable
=
$this
->
_conn
->
getDatabasePlatform
()
->
getTemporaryTableName
(
"temporary"
);
$this
->
_conn
->
exec
(
$this
->
_conn
->
getDatabasePlatform
()
->
getDropTemporaryTableSQL
(
$tempTable
));
}
catch
(
\Exception
$e
)
{
}
}
}
...
...
@@ -46,15 +46,11 @@ class TemporaryTableTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table
->
addColumn
(
"id"
,
"integer"
);
$table
->
setPrimaryKey
(
array
(
'id'
));
$this
->
_conn
->
beginTransaction
();
$this
->
_conn
->
getSchemaManager
()
->
createTable
(
$table
);
$this
->
_conn
->
commit
();
foreach
(
$platform
->
getCreateTableSQL
(
$table
)
AS
$sql
)
{
$this
->
_conn
->
executeQuery
(
$sql
);
}
$this
->
_conn
->
beginTransaction
();
$table
=
$this
->
_conn
->
getSchemaManager
()
->
listTableDetails
(
$table
->
getName
());
$this
->
assertEquals
(
"nontemporary"
,
$table
->
getName
());
$this
->
_conn
->
insert
(
"nontemporary"
,
array
(
"id"
=>
1
));
$this
->
_conn
->
exec
(
$platform
->
getDropTemporaryTableSQL
(
$tempTable
));
$this
->
_conn
->
insert
(
"nontemporary"
,
array
(
"id"
=>
2
));
...
...
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