Code Duplication    Length = 13-14 lines in 2 locations

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

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

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

@@ 517-530 (lines=14) @@
514
     * @group DBAL-50
515
     * @group DBAL-1063
516
     */
517
    public function testPrimaryKeyOverrulingUniqueIndexDoesNotDropUniqueIndex()
518
    {
519
        $table = new Table("bar");
520
        $table->addColumn('baz', 'integer', array());
521
        $table->addUniqueIndex(array('baz'), 'idx_unique');
522
523
        $table->setPrimaryKey(array('baz'));
524
525
        $indexes = $table->getIndexes();
526
        $this->assertEquals(2, count($indexes), "Table should only contain both the primary key table index and the unique one, even though it was overruled.");
527
528
        $this->assertTrue($table->hasPrimaryKey());
529
        $this->assertTrue($table->hasIndex('idx_unique'));
530
    }
531
532
    public function testCompoundedPrimaryKeyOverrulingSingleUniqueIndexDoesNotDropUniqueIndex()
533
    {