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
f5fc3a6e
Commit
f5fc3a6e
authored
Nov 22, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added tests for pgsql export driver
parent
7e32cde0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
0 deletions
+66
-0
ExportPgsqlTestCase.php
tests/ExportPgsqlTestCase.php
+66
-0
No files found.
tests/ExportPgsqlTestCase.php
0 → 100644
View file @
f5fc3a6e
<?php
class
Doctrine_Export_Pgsql_TestCase
extends
Doctrine_Driver_UnitTestCase
{
public
function
__construct
()
{
parent
::
__construct
(
'pgsql'
);
}
public
function
testCreateDatabaseDoesNotExecuteSql
()
{
try
{
$this
->
export
->
createDatabase
(
'db'
);
$this
->
fail
();
}
catch
(
Doctrine_Export_Firebird_Exception
$e
)
{
$this
->
pass
();
}
}
public
function
testDropDatabaseExecutesSql
()
{
try
{
$this
->
export
->
dropDatabase
(
'db'
);
$this
->
fail
();
}
catch
(
Doctrine_Export_Firebird_Exception
$e
)
{
$this
->
pass
();
}
}
public
function
testAlterTableThrowsExceptionWithoutValidTableName
()
{
try
{
$this
->
export
->
alterTable
(
0
,
0
,
array
());
$this
->
fail
();
}
catch
(
Doctrine_Export_Exception
$e
)
{
$this
->
pass
();
}
}
public
function
testCreateTableThrowsExceptionWithoutValidTableName
()
{
try
{
$this
->
export
->
createTable
(
0
,
array
(),
array
());
$this
->
fail
();
}
catch
(
Doctrine_Export_Exception
$e
)
{
$this
->
pass
();
}
}
public
function
testCreateTableThrowsExceptionWithEmptyFieldsArray
()
{
try
{
$this
->
export
->
createTable
(
'sometable'
,
array
(),
array
());
$this
->
fail
();
}
catch
(
Doctrine_Export_Exception
$e
)
{
$this
->
pass
();
}
}
public
function
testCreateIndexExecutesSql
()
{
$this
->
export
->
createIndex
(
'sometable'
,
'relevancy'
,
array
(
'fields'
=>
array
(
'title'
=>
array
(),
'content'
=>
array
())));
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'CREATE INDEX relevancy ON sometable (title, content)'
);
}
public
function
testDropIndexExecutesSql
()
{
$this
->
export
->
dropIndex
(
'sometable'
,
'relevancy'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'DROP INDEX relevancy ON sometable'
);
}
public
function
testDropTableExecutesSql
()
{
$this
->
export
->
dropTable
(
'sometable'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'DROP TABLE sometable'
);
}
}
?>
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