Code Duplication    Length = 11-12 lines in 3 locations

tests/Doctrine/Tests/DBAL/Schema/TableTest.php 3 locations

@@ 210-221 (lines=12) @@
207
        $this->assertEquals("bar", $table->getOption("foo"));
208
    }
209
210
    public function testBuilderSetPrimaryKey()
211
    {
212
        $table = new Table("foo");
213
214
        $table->addColumn("bar", 'integer');
215
        $table->setPrimaryKey(array("bar"));
216
217
        $this->assertTrue($table->hasIndex("primary"));
218
        $this->assertInstanceOf('Doctrine\DBAL\Schema\Index', $table->getPrimaryKey());
219
        $this->assertTrue($table->getIndex("primary")->isUnique());
220
        $this->assertTrue($table->getIndex("primary")->isPrimary());
221
    }
222
223
    public function testBuilderAddUniqueIndex()
224
    {
@@ 223-233 (lines=11) @@
220
        $this->assertTrue($table->getIndex("primary")->isPrimary());
221
    }
222
223
    public function testBuilderAddUniqueIndex()
224
    {
225
        $table = new Table("foo");
226
227
        $table->addColumn("bar", 'integer');
228
        $table->addUniqueIndex(array("bar"), "my_idx");
229
230
        $this->assertTrue($table->hasIndex("my_idx"));
231
        $this->assertTrue($table->getIndex("my_idx")->isUnique());
232
        $this->assertFalse($table->getIndex("my_idx")->isPrimary());
233
    }
234
235
    public function testBuilderAddIndex()
236
    {
@@ 235-245 (lines=11) @@
232
        $this->assertFalse($table->getIndex("my_idx")->isPrimary());
233
    }
234
235
    public function testBuilderAddIndex()
236
    {
237
        $table = new Table("foo");
238
239
        $table->addColumn("bar", 'integer');
240
        $table->addIndex(array("bar"), "my_idx");
241
242
        $this->assertTrue($table->hasIndex("my_idx"));
243
        $this->assertFalse($table->getIndex("my_idx")->isUnique());
244
        $this->assertFalse($table->getIndex("my_idx")->isPrimary());
245
    }
246
247
    public function testBuilderAddIndexWithInvalidNameThrowsException()
248
    {