Code Duplication    Length = 13-20 lines in 2 locations

tests/Doctrine/Tests/DBAL/Platforms/SQLAnywherePlatformTest.php 1 location

@@ 188-207 (lines=20) @@
185
        );
186
    }
187
188
    public function testGeneratesTableAlterationWithRemovedColumnCommentSql()
189
    {
190
        $table = new Table('mytable');
191
        $table->addColumn('foo', 'string', array('comment' => 'foo comment'));
192
193
        $tableDiff                        = new TableDiff('mytable');
194
        $tableDiff->fromTable             = $table;
195
        $tableDiff->changedColumns['foo'] = new ColumnDiff(
196
            'foo',
197
            new Column('foo', Type::getType('string')),
198
            array('comment')
199
        );
200
201
        self::assertEquals(
202
            array(
203
                "COMMENT ON COLUMN mytable.foo IS NULL"
204
            ),
205
            $this->_platform->getAlterTableSQL($tableDiff)
206
        );
207
    }
208
209
    /**
210
     * @dataProvider getLockHints

tests/Doctrine/Tests/DBAL/Platforms/SqlitePlatformTest.php 1 location

@@ 331-343 (lines=13) @@
328
        );
329
    }
330
331
    public function testAlterTableAddColumns()
332
    {
333
        $diff                        = new TableDiff('user');
334
        $diff->addedColumns['foo']   = new Column('foo', Type::getType('string'));
335
        $diff->addedColumns['count'] = new Column('count', Type::getType('integer'), array('notnull' => false, 'default' => 1));
336
337
        $expected = array(
338
            'ALTER TABLE user ADD COLUMN foo VARCHAR(255) NOT NULL',
339
            'ALTER TABLE user ADD COLUMN count INTEGER DEFAULT 1',
340
        );
341
342
        self::assertEquals($expected, $this->_platform->getAlterTableSQL($diff));
343
    }
344
345
    /**
346
     * @dataProvider complexDiffProvider