Code Duplication    Length = 17-18 lines in 2 locations

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

@@ 591-607 (lines=17) @@
588
        self::assertTrue($this->hasElementWithName($this->_sm->listViews(), $name));
589
    }
590
591
    public function testAutoincrementDetection()
592
    {
593
        if (!$this->_sm->getDatabasePlatform()->supportsIdentityColumns()) {
594
            $this->markTestSkipped('This test is only supported on platforms that have autoincrement');
595
        }
596
597
        $table = new Table('test_autoincrement');
598
        $table->setSchemaConfig($this->_sm->createSchemaConfig());
599
        $table->addColumn('id', 'integer', array('autoincrement' => true));
600
        $table->setPrimaryKey(array('id'));
601
602
        $this->_sm->createTable($table);
603
604
        $inferredTable = $this->_sm->listTableDetails('test_autoincrement');
605
        self::assertTrue($inferredTable->hasColumn('id'));
606
        self::assertTrue($inferredTable->getColumn('id')->getAutoincrement());
607
    }
608
609
    /**
610
     * @group DBAL-792
@@ 612-629 (lines=18) @@
609
    /**
610
     * @group DBAL-792
611
     */
612
    public function testAutoincrementDetectionMulticolumns()
613
    {
614
        if (!$this->_sm->getDatabasePlatform()->supportsIdentityColumns()) {
615
            $this->markTestSkipped('This test is only supported on platforms that have autoincrement');
616
        }
617
618
        $table = new Table('test_not_autoincrement');
619
        $table->setSchemaConfig($this->_sm->createSchemaConfig());
620
        $table->addColumn('id', 'integer');
621
        $table->addColumn('other_id', 'integer');
622
        $table->setPrimaryKey(array('id', 'other_id'));
623
624
        $this->_sm->createTable($table);
625
626
        $inferredTable = $this->_sm->listTableDetails('test_not_autoincrement');
627
        self::assertTrue($inferredTable->hasColumn('id'));
628
        self::assertFalse($inferredTable->getColumn('id')->getAutoincrement());
629
    }
630
631
    /**
632
     * @group DDC-887