DBAL168Test.php 841 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
<?php

namespace Doctrine\Tests\DBAL\Functional\Ticket;

/**
 * @group DBAL-168
 */
class DBAL168Test extends \Doctrine\Tests\DbalFunctionalTestCase
{
    public function testDomainsTable()
    {
        if ($this->_conn->getDatabasePlatform()->getName() != "postgresql") {
            $this->markTestSkipped('PostgreSQL only test');
        }

        $table = new \Doctrine\DBAL\Schema\Table("domains");
        $table->addColumn('id', 'integer');
        $table->addColumn('parent_id', 'integer');
        $table->setPrimaryKey(array('id'));
        $table->addForeignKeyConstraint('domains', array('parent_id'), array('id'));

        $this->_conn->getSchemaManager()->createTable($table);
        $table = $this->_conn->getSchemaManager()->listTableDetails('domains');

        $this->assertEquals('domains', $table->getName());
    }
}