Code Duplication    Length = 17-18 lines in 2 locations

tests/Doctrine/Tests/ORM/Tools/SchemaToolTest.php 2 locations

@@ 134-150 (lines=17) @@
131
    /**
132
     * @group DDC-3671
133
     */
134
    public function testSchemaHasProperIndexesFromUniqueConstraintAnnotation()
135
    {
136
        $em         = $this->_getTestEntityManager();
137
        $schemaTool = new SchemaTool($em);
138
        $classes    = [
139
            $em->getClassMetadata(UniqueConstraintAnnotationModel::class),
140
        ];
141
142
        $schema = $schemaTool->getSchemaFromMetadata($classes);
143
144
        $this->assertTrue($schema->hasTable('unique_constraint_annotation_table'));
145
        $table = $schema->getTable('unique_constraint_annotation_table');
146
147
        $this->assertEquals(2, count($table->getIndexes()));
148
        $this->assertTrue($table->hasIndex('primary'));
149
        $this->assertTrue($table->hasIndex('uniq_hash'));
150
    }
151
152
    public function testRemoveUniqueIndexOverruledByPrimaryKey()
153
    {
@@ 152-169 (lines=18) @@
149
        $this->assertTrue($table->hasIndex('uniq_hash'));
150
    }
151
152
    public function testRemoveUniqueIndexOverruledByPrimaryKey()
153
    {
154
        $em         = $this->_getTestEntityManager();
155
        $schemaTool = new SchemaTool($em);
156
        $classes    = [
157
            $em->getClassMetadata(FirstEntity::class),
158
            $em->getClassMetadata(SecondEntity::class)
159
        ];
160
161
        $schema = $schemaTool->getSchemaFromMetadata($classes);
162
163
        $this->assertTrue($schema->hasTable('first_entity'), "Table first_entity should exist.");
164
165
        $indexes = $schema->getTable('first_entity')->getIndexes();
166
167
        $this->assertCount(1, $indexes, "there should be only one index");
168
        $this->assertTrue(current($indexes)->isPrimary(), "index should be primary");
169
    }
170
171
    public function testSetDiscriminatorColumnWithoutLength() : void
172
    {