Code Duplication    Length = 17-18 lines in 2 locations

tests/Doctrine/Tests/DBAL/Functional/Schema/SchemaManagerFunctionalTestCase.php 2 locations

@@ 581-597 (lines=17) @@
578
        self::assertCount(1, $views);
579
    }
580
581
    public function testAutoincrementDetection()
582
    {
583
        if ( ! $this->_sm->getDatabasePlatform()->supportsIdentityColumns()) {
584
            $this->markTestSkipped('This test is only supported on platforms that have autoincrement');
585
        }
586
587
        $table = new Table('test_autoincrement');
588
        $table->setSchemaConfig($this->_sm->createSchemaConfig());
589
        $table->addColumn('id', 'integer', array('autoincrement' => true));
590
        $table->setPrimaryKey(array('id'));
591
592
        $this->_sm->createTable($table);
593
594
        $inferredTable = $this->_sm->listTableDetails('test_autoincrement');
595
        self::assertTrue($inferredTable->hasColumn('id'));
596
        self::assertTrue($inferredTable->getColumn('id')->getAutoincrement());
597
    }
598
599
    /**
600
     * @group DBAL-792
@@ 602-619 (lines=18) @@
599
    /**
600
     * @group DBAL-792
601
     */
602
    public function testAutoincrementDetectionMulticolumns()
603
    {
604
        if ( ! $this->_sm->getDatabasePlatform()->supportsIdentityColumns()) {
605
            $this->markTestSkipped('This test is only supported on platforms that have autoincrement');
606
        }
607
608
        $table = new Table('test_not_autoincrement');
609
        $table->setSchemaConfig($this->_sm->createSchemaConfig());
610
        $table->addColumn('id', 'integer');
611
        $table->addColumn('other_id', 'integer');
612
        $table->setPrimaryKey(array('id', 'other_id'));
613
614
        $this->_sm->createTable($table);
615
616
        $inferredTable = $this->_sm->listTableDetails('test_not_autoincrement');
617
        self::assertTrue($inferredTable->hasColumn('id'));
618
        self::assertFalse($inferredTable->getColumn('id')->getAutoincrement());
619
    }
620
621
    /**
622
     * @group DDC-887