Commit 35305949 authored by Marco Pivetta's avatar Marco Pivetta

Fixing tests for alter table when no FK is supported @49df3598

parent 7282289f
...@@ -433,13 +433,15 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest ...@@ -433,13 +433,15 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
// dont check for index size here, some platforms automatically add indexes for foreign keys. // dont check for index size here, some platforms automatically add indexes for foreign keys.
$this->assertFalse($table->hasIndex('foo_idx')); $this->assertFalse($table->hasIndex('foo_idx'));
$this->assertEquals(1, count($table->getForeignKeys())); if ($this->_sm->getDatabasePlatform()->supportsForeignKeyConstraints()) {
$fks = $table->getForeignKeys(); $fks = $table->getForeignKeys();
$this->assertCount(1, $fks);
$foreignKey = current($fks); $foreignKey = current($fks);
$this->assertEquals('alter_table_foreign', strtolower($foreignKey->getForeignTableName())); $this->assertEquals('alter_table_foreign', strtolower($foreignKey->getForeignTableName()));
$this->assertEquals(array('foreign_key_test'), array_map('strtolower', $foreignKey->getColumns())); $this->assertEquals(array('foreign_key_test'), array_map('strtolower', $foreignKey->getColumns()));
$this->assertEquals(array('id'), array_map('strtolower', $foreignKey->getForeignColumns())); $this->assertEquals(array('id'), array_map('strtolower', $foreignKey->getForeignColumns()));
} }
}
public function testCreateAndListViews() public function testCreateAndListViews()
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment