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
73d63af1
Commit
73d63af1
authored
Jan 10, 2008
by
lsmith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- fixed tests to expect DEFAULT NULL when no default is specified on nullable non lob columns
parent
fa5ab7d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
PgsqlTestCase.php
tests/Export/PgsqlTestCase.php
+7
-7
SqliteTestCase.php
tests/Export/SqliteTestCase.php
+2
-2
No files found.
tests/Export/PgsqlTestCase.php
View file @
73d63af1
...
@@ -74,7 +74,7 @@ class Doctrine_Export_Pgsql_TestCase extends Doctrine_UnitTestCase
...
@@ -74,7 +74,7 @@ class Doctrine_Export_Pgsql_TestCase extends Doctrine_UnitTestCase
$options
=
array
(
'primary'
=>
array
(
'name'
,
'type'
));
$options
=
array
(
'primary'
=>
array
(
'name'
,
'type'
));
$this
->
export
->
createTable
(
$name
,
$fields
,
$options
);
$this
->
export
->
createTable
(
$name
,
$fields
,
$options
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'CREATE TABLE "mytable" ("name" CHAR(10) DEFAULT NULL, "type" INT, PRIMARY KEY("name", "type"))'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'CREATE TABLE "mytable" ("name" CHAR(10) DEFAULT NULL, "type" INT
DEFAULT NULL
, PRIMARY KEY("name", "type"))'
);
$this
->
conn
->
setAttribute
(
Doctrine
::
ATTR_QUOTE_IDENTIFIER
,
false
);
$this
->
conn
->
setAttribute
(
Doctrine
::
ATTR_QUOTE_IDENTIFIER
,
false
);
}
}
...
@@ -95,7 +95,7 @@ class Doctrine_Export_Pgsql_TestCase extends Doctrine_UnitTestCase
...
@@ -95,7 +95,7 @@ class Doctrine_Export_Pgsql_TestCase extends Doctrine_UnitTestCase
$sql
=
$this
->
export
->
createTableSql
(
$name
,
$fields
,
$options
);
$sql
=
$this
->
export
->
createTableSql
(
$name
,
$fields
,
$options
);
$this
->
assertEqual
(
$sql
[
0
],
'CREATE TABLE "mytable" ("id" BOOLEAN DEFAULT NULL, "foreignKey" INT)'
);
$this
->
assertEqual
(
$sql
[
0
],
'CREATE TABLE "mytable" ("id" BOOLEAN DEFAULT NULL, "foreignKey" INT
DEFAULT NULL
)'
);
$this
->
assertEqual
(
$sql
[
1
],
'ALTER TABLE "mytable" ADD FOREIGN KEY ("foreignKey") REFERENCES "sometable"("id") NOT DEFERRABLE INITIALLY IMMEDIATE'
);
$this
->
assertEqual
(
$sql
[
1
],
'ALTER TABLE "mytable" ADD FOREIGN KEY ("foreignKey") REFERENCES "sometable"("id") NOT DEFERRABLE INITIALLY IMMEDIATE'
);
$this
->
conn
->
setAttribute
(
Doctrine
::
ATTR_QUOTE_IDENTIFIER
,
false
);
$this
->
conn
->
setAttribute
(
Doctrine
::
ATTR_QUOTE_IDENTIFIER
,
false
);
...
@@ -121,19 +121,19 @@ class Doctrine_Export_Pgsql_TestCase extends Doctrine_UnitTestCase
...
@@ -121,19 +121,19 @@ class Doctrine_Export_Pgsql_TestCase extends Doctrine_UnitTestCase
$options
=
array
(
'primary'
=>
array
(
'name'
,
'type'
));
$options
=
array
(
'primary'
=>
array
(
'name'
,
'type'
));
$this
->
export
->
createTable
(
$name
,
$fields
,
$options
);
$this
->
export
->
createTable
(
$name
,
$fields
,
$options
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'CREATE TABLE mytable (name CHAR(10) DEFAULT NULL, type INT, PRIMARY KEY(name, type))'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'CREATE TABLE mytable (name CHAR(10) DEFAULT NULL, type INT
DEFAULT NULL
, PRIMARY KEY(name, type))'
);
}
}
public
function
testExportSql
()
public
function
testExportSql
()
{
{
$sql
=
$this
->
export
->
exportClassesSql
(
array
(
"FooRecord"
,
"FooReferenceRecord"
,
"FooLocallyOwned"
,
"FooForeignlyOwned"
,
"FooForeignlyOwnedWithPK"
,
"FooBarRecord"
,
"BarRecord"
));
$sql
=
$this
->
export
->
exportClassesSql
(
array
(
"FooRecord"
,
"FooReferenceRecord"
,
"FooLocallyOwned"
,
"FooForeignlyOwned"
,
"FooForeignlyOwnedWithPK"
,
"FooBarRecord"
,
"BarRecord"
));
//dirname(__FILE__) . DIRECTORY_SEPARATOR . '_files');
//dirname(__FILE__) . DIRECTORY_SEPARATOR . '_files');
$this
->
assertEqual
(
$sql
,
array
(
0
=>
'CREATE TABLE foo_reference (foo1 BIGINT
, foo2 BIGINT
, PRIMARY KEY(foo1, foo2))'
,
$this
->
assertEqual
(
$sql
,
array
(
0
=>
'CREATE TABLE foo_reference (foo1 BIGINT
DEFAULT NULL, foo2 BIGINT DEFAULT NULL
, PRIMARY KEY(foo1, foo2))'
,
1
=>
'CREATE TABLE foo_locally_owned (id BIGSERIAL, name VARCHAR(200) DEFAULT NULL, PRIMARY KEY(id))'
,
1
=>
'CREATE TABLE foo_locally_owned (id BIGSERIAL, name VARCHAR(200) DEFAULT NULL, PRIMARY KEY(id))'
,
2
=>
'CREATE TABLE foo_foreignly_owned_with_pk (id BIGSERIAL, name VARCHAR(200) DEFAULT NULL, PRIMARY KEY(id))'
,
2
=>
'CREATE TABLE foo_foreignly_owned_with_pk (id BIGSERIAL, name VARCHAR(200) DEFAULT NULL, PRIMARY KEY(id))'
,
3
=>
'CREATE TABLE foo_foreignly_owned (id BIGSERIAL, name VARCHAR(200) DEFAULT NULL, fooid BIGINT, PRIMARY KEY(id))'
,
3
=>
'CREATE TABLE foo_foreignly_owned (id BIGSERIAL, name VARCHAR(200) DEFAULT NULL, fooid BIGINT
DEFAULT NULL
, PRIMARY KEY(id))'
,
4
=>
'CREATE TABLE foo_bar_record (fooid BIGINT
, barid BIGINT
, PRIMARY KEY(fooid, barid))'
,
4
=>
'CREATE TABLE foo_bar_record (fooid BIGINT
DEFAULT NULL, barid BIGINT DEFAULT NULL
, PRIMARY KEY(fooid, barid))'
,
5
=>
'CREATE TABLE foo (id BIGSERIAL, name VARCHAR(200) NOT NULL, parent_id BIGINT
, local_foo BIGINT
, PRIMARY KEY(id))'
,
5
=>
'CREATE TABLE foo (id BIGSERIAL, name VARCHAR(200) NOT NULL, parent_id BIGINT
DEFAULT NULL, local_foo BIGINT DEFAULT NULL
, PRIMARY KEY(id))'
,
6
=>
'CREATE TABLE bar (id BIGSERIAL, name VARCHAR(200) DEFAULT NULL, PRIMARY KEY(id))'
,
6
=>
'CREATE TABLE bar (id BIGSERIAL, name VARCHAR(200) DEFAULT NULL, PRIMARY KEY(id))'
,
7
=>
'ALTER TABLE foo_reference ADD FOREIGN KEY (foo1) REFERENCES foo(id) NOT DEFERRABLE INITIALLY IMMEDIATE'
,
7
=>
'ALTER TABLE foo_reference ADD FOREIGN KEY (foo1) REFERENCES foo(id) NOT DEFERRABLE INITIALLY IMMEDIATE'
,
8
=>
'ALTER TABLE foo_bar_record ADD FOREIGN KEY (fooId) REFERENCES foo(id) NOT DEFERRABLE INITIALLY IMMEDIATE'
,
8
=>
'ALTER TABLE foo_bar_record ADD FOREIGN KEY (fooId) REFERENCES foo(id) NOT DEFERRABLE INITIALLY IMMEDIATE'
,
...
...
tests/Export/SqliteTestCase.php
View file @
73d63af1
...
@@ -81,7 +81,7 @@ class Doctrine_Export_Sqlite_TestCase extends Doctrine_UnitTestCase
...
@@ -81,7 +81,7 @@ class Doctrine_Export_Sqlite_TestCase extends Doctrine_UnitTestCase
$options
=
array
(
'primary'
=>
array
(
'name'
,
'type'
));
$options
=
array
(
'primary'
=>
array
(
'name'
,
'type'
));
$this
->
export
->
createTable
(
$name
,
$fields
,
$options
);
$this
->
export
->
createTable
(
$name
,
$fields
,
$options
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'CREATE TABLE mytable (name CHAR(10) DEFAULT NULL, type INTEGER, PRIMARY KEY(name, type))'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'CREATE TABLE mytable (name CHAR(10) DEFAULT NULL, type INTEGER
DEFAULT NULL
, PRIMARY KEY(name, type))'
);
}
}
public
function
testCreateTableSupportsIndexes
()
public
function
testCreateTableSupportsIndexes
()
{
{
...
@@ -138,7 +138,7 @@ class Doctrine_Export_Sqlite_TestCase extends Doctrine_UnitTestCase
...
@@ -138,7 +138,7 @@ class Doctrine_Export_Sqlite_TestCase extends Doctrine_UnitTestCase
$options
=
array
(
'primary'
=>
array
(
'name'
,
'type'
));
$options
=
array
(
'primary'
=>
array
(
'name'
,
'type'
));
$this
->
export
->
createTable
(
$name
,
$fields
,
$options
);
$this
->
export
->
createTable
(
$name
,
$fields
,
$options
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'CREATE TABLE "mytable" ("name" CHAR(10) DEFAULT NULL, "type" INTEGER, PRIMARY KEY("name", "type"))'
);
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'CREATE TABLE "mytable" ("name" CHAR(10) DEFAULT NULL, "type" INTEGER
DEFAULT NULL
, PRIMARY KEY("name", "type"))'
);
$this
->
conn
->
setAttribute
(
Doctrine
::
ATTR_QUOTE_IDENTIFIER
,
false
);
$this
->
conn
->
setAttribute
(
Doctrine
::
ATTR_QUOTE_IDENTIFIER
,
false
);
}
}
...
...
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