Code Duplication    Length = 13-14 lines in 2 locations

tests/Doctrine/Tests/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php 1 location

@@ 250-262 (lines=13) @@
247
    /**
248
     * @group DBAL-511
249
     */
250
    public function testDefaultValueCharacterVarying()
251
    {
252
        $testTable = new \Doctrine\DBAL\Schema\Table('dbal511_default');
253
        $testTable->addColumn('id', 'integer');
254
        $testTable->addColumn('def', 'string', array('default' => 'foo'));
255
        $testTable->setPrimaryKey(array('id'));
256
257
        $this->_sm->createTable($testTable);
258
259
        $databaseTable = $this->_sm->listTableDetails($testTable->getName());
260
261
        $this->assertEquals('foo', $databaseTable->getColumn('def')->getDefault());
262
    }
263
264
    /**
265
     * @group DDC-2843

tests/Doctrine/Tests/DBAL/Schema/TableTest.php 1 location

@@ 479-492 (lines=14) @@
476
     * @group DBAL-50
477
     * @group DBAL-1063
478
     */
479
    public function testPrimaryKeyOverrulingUniqueIndexDoesNotDropUniqueIndex()
480
    {
481
        $table = new Table("bar");
482
        $table->addColumn('baz', 'integer', array());
483
        $table->addUniqueIndex(array('baz'), 'idx_unique');
484
485
        $table->setPrimaryKey(array('baz'));
486
487
        $indexes = $table->getIndexes();
488
        $this->assertEquals(2, count($indexes), "Table should only contain both the primary key table index and the unique one, even though it was overruled.");
489
490
        $this->assertTrue($table->hasPrimaryKey());
491
        $this->assertTrue($table->hasIndex('idx_unique'));
492
    }
493
494
    public function testAddingFulfillingRegularIndexOverridesImplicitForeignKeyConstraintIndex()
495
    {