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
f97a6524
Commit
f97a6524
authored
Sep 03, 2007
by
jackbravo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added failing tests
parent
5a2de6cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
RecordTestCase.php
tests/Export/RecordTestCase.php
+10
-2
No files found.
tests/Export/RecordTestCase.php
View file @
f97a6524
...
...
@@ -50,7 +50,11 @@ class Doctrine_Export_Record_TestCase extends Doctrine_UnitTestCase
$sql
=
$this
->
conn
->
export
->
exportClassesSql
(
array
(
'ForeignKeyTest'
));
$this
->
assertEqual
(
$sql
[
0
],
'CREATE TABLE foreign_key_test (id BIGINT AUTO_INCREMENT, name TEXT, code INT, content TEXT, parent_id BIGINT, INDEX parent_id_idx (parent_id), PRIMARY KEY(id)) ENGINE = INNODB'
);
//$this->assertEqual($sql[1], 'ALTER TABLE foreign_key_test ADD CONSTRAINT FOREIGN KEY (parent_id) REFERENCES foreign_key_test(id) ON UPDATE RESTRICT ON DELETE CASCADE');
if
(
isset
(
$sql
[
1
]))
{
$this
->
assertEqual
(
$sql
[
1
],
'ALTER TABLE foreign_key_test ADD CONSTRAINT FOREIGN KEY (parent_id) REFERENCES foreign_key_test(id) ON UPDATE RESTRICT ON DELETE CASCADE'
);
}
else
{
$this
->
fail
(
'$sql should contain ALTER TABLE statement'
);
}
}
public
function
testExportSupportsIndexes
()
...
...
@@ -72,7 +76,11 @@ class Doctrine_Export_Record_TestCase extends Doctrine_UnitTestCase
$sql
=
$this
->
conn
->
export
->
exportClassesSql
(
array
(
'ForeignKeyTest'
));
$this
->
assertEqual
(
$sql
[
0
],
'CREATE TABLE foreign_key_test (id BIGINT AUTO_INCREMENT, name TEXT, code INT, content TEXT, parent_id BIGINT, INDEX parent_id_idx (parent_id), PRIMARY KEY(id)) ENGINE = INNODB'
);
//$this->assertEqual($sql[1], 'ALTER TABLE foreign_key_test ADD CONSTRAINT FOREIGN KEY (parent_id) REFERENCES foreign_key_test(id) ON UPDATE RESTRICT ON DELETE CASCADE');
if
(
isset
(
$sql
[
1
]))
{
$this
->
assertEqual
(
$sql
[
1
],
'ALTER TABLE foreign_key_test ADD CONSTRAINT FOREIGN KEY (parent_id) REFERENCES foreign_key_test(id) ON UPDATE RESTRICT ON DELETE CASCADE'
);
}
else
{
$this
->
fail
(
'$sql should contain ALTER TABLE statement'
);
}
}
public
function
testExportSupportsForeignKeysForManyToManyRelations
()
...
...
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