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
ee5a7f8c
Commit
ee5a7f8c
authored
Nov 22, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added super class for all export test cases
parent
f5fc3a6e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
138 deletions
+59
-138
ExportFirebirdTestCase.php
tests/ExportFirebirdTestCase.php
+2
-44
ExportMysqlTestCase.php
tests/ExportMysqlTestCase.php
+2
-39
ExportPgsqlTestCase.php
tests/ExportPgsqlTestCase.php
+7
-55
ExportTestCase.php
tests/ExportTestCase.php
+48
-0
No files found.
tests/ExportFirebirdTestCase.php
View file @
ee5a7f8c
<?php
<?php
class
Doctrine_Export_Firebird_TestCase
extends
Doctrine_
Driver_Unit
TestCase
{
class
Doctrine_Export_Firebird_TestCase
extends
Doctrine_
Export_
TestCase
{
public
function
__construct
()
{
public
function
__construct
()
{
parent
::
__construct
(
'firebird'
);
parent
::
__construct
(
'firebird'
);
}
}
...
@@ -11,7 +11,7 @@ class Doctrine_Export_Firebird_TestCase extends Doctrine_Driver_UnitTestCase {
...
@@ -11,7 +11,7 @@ class Doctrine_Export_Firebird_TestCase extends Doctrine_Driver_UnitTestCase {
$this
->
pass
();
$this
->
pass
();
}
}
}
}
public
function
testDropDatabase
Executes
Sql
()
{
public
function
testDropDatabase
DoesNotExecute
Sql
()
{
try
{
try
{
$this
->
export
->
dropDatabase
(
'db'
);
$this
->
export
->
dropDatabase
(
'db'
);
$this
->
fail
();
$this
->
fail
();
...
@@ -19,48 +19,6 @@ class Doctrine_Export_Firebird_TestCase extends Doctrine_Driver_UnitTestCase {
...
@@ -19,48 +19,6 @@ class Doctrine_Export_Firebird_TestCase extends Doctrine_Driver_UnitTestCase {
$this
->
pass
();
$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'
);
}
}
}
?>
?>
tests/ExportMysqlTestCase.php
View file @
ee5a7f8c
<?php
<?php
class
Doctrine_Export_Mysql_TestCase
extends
Doctrine_
Driver_Unit
TestCase
{
class
Doctrine_Export_Mysql_TestCase
extends
Doctrine_
Export_
TestCase
{
public
function
__construct
()
{
public
function
__construct
()
{
parent
::
__construct
(
'mysql'
);
parent
::
__construct
(
'mysql'
);
}
}
...
@@ -13,48 +13,11 @@ class Doctrine_Export_Mysql_TestCase extends Doctrine_Driver_UnitTestCase {
...
@@ -13,48 +13,11 @@ class Doctrine_Export_Mysql_TestCase extends Doctrine_Driver_UnitTestCase {
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'DROP DATABASE db'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'DROP DATABASE db'
);
}
}
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
()
{
public
function
testDropIndexExecutesSql
()
{
$this
->
export
->
dropIndex
(
'sometable'
,
'relevancy'
);
$this
->
export
->
dropIndex
(
'sometable'
,
'relevancy'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'DROP INDEX relevancy ON sometable'
);
$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'
);
}
}
}
?>
?>
tests/ExportPgsqlTestCase.php
View file @
ee5a7f8c
<?php
<?php
class
Doctrine_Export_Pgsql_TestCase
extends
Doctrine_
Driver_Unit
TestCase
{
class
Doctrine_Export_Pgsql_TestCase
extends
Doctrine_
Export_
TestCase
{
public
function
__construct
()
{
public
function
__construct
()
{
parent
::
__construct
(
'pgsql'
);
parent
::
__construct
(
'pgsql'
);
}
}
public
function
testCreateDatabaseDoesNotExecuteSql
()
{
public
function
testCreateDatabaseExecutesSql
()
{
try
{
$this
->
export
->
createDatabase
(
'db'
);
$this
->
export
->
createDatabase
(
'db'
);
$this
->
fail
();
}
catch
(
Doctrine_Export_Firebird_Exception
$e
)
{
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'CREATE DATABASE db'
);
$this
->
pass
();
}
}
}
public
function
testDropDatabaseExecutesSql
()
{
public
function
testDropDatabaseExecutesSql
()
{
try
{
$this
->
export
->
dropDatabase
(
'db'
);
$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
();
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'DROP DATABASE db'
);
}
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'
);
}
}
}
?>
?>
tests/ExportTestCase.php
0 → 100644
View file @
ee5a7f8c
<?php
class
Doctrine_Export_TestCase
extends
Doctrine_Driver_UnitTestCase
{
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'
);
}
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