Code Duplication    Length = 20-21 lines in 2 locations

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

@@ 1200-1219 (lines=20) @@
1197
     * @group 2782
1198
     * @group 6654
1199
     */
1200
    public function testComparatorShouldReturnFalseWhenLegacyJsonArrayColumnHasComment()
1201
    {
1202
        if ( ! $this->_sm->getDatabasePlatform()->hasNativeJsonType()) {
1203
            $this->markTestSkipped('This test is only supported on platforms that have native JSON type.');
1204
        }
1205
1206
        $table = new Table('json_array_test');
1207
        $table->addColumn('id', 'integer');
1208
        $table->addColumn('parameters', 'json_array');
1209
        $table->setPrimaryKey(['id']);
1210
1211
        $this->_sm->createTable($table);
1212
1213
        $comparator = new Comparator();
1214
        $tableDiff  = $comparator->diffTable($this->_sm->listTableDetails('json_array_test'), $table);
1215
1216
        self::assertFalse($tableDiff);
1217
1218
        $this->_sm->dropTable('json_array_test');
1219
    }
1220
1221
    /**
1222
     * @group 2782
@@ 1281-1301 (lines=21) @@
1278
     * @group 2782
1279
     * @group 6654
1280
     */
1281
    public function testComparatorShouldNotAddCommentToJsonTypeSinceItIsTheDefaultNow()
1282
    {
1283
        if ( ! $this->_sm->getDatabasePlatform()->hasNativeJsonType()) {
1284
            $this->markTestSkipped('This test is only supported on platforms that have native JSON type.');
1285
        }
1286
1287
        $this->_conn->executeQuery(
1288
            'CREATE TABLE json_test (id INT NOT NULL, parameters JSON NOT NULL, PRIMARY KEY(id))'
1289
        );
1290
1291
        $table = new Table('json_test');
1292
        $table->addColumn('id', 'integer');
1293
        $table->addColumn('parameters', 'json');
1294
        $table->setPrimaryKey(['id']);
1295
1296
        $comparator = new Comparator();
1297
        $tableDiff  = $comparator->diffTable($this->_sm->listTableDetails('json_test'), $table);
1298
        $this->_sm->dropTable('json_test');
1299
1300
        self::assertFalse($tableDiff);
1301
    }
1302
}
1303