Code Duplication    Length = 17-17 lines in 3 locations

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

@@ 1256-1272 (lines=17) @@
1253
     * @group 2782
1254
     * @group 6654
1255
     */
1256
    public function testComparatorShouldAddCommentToLegacyJsonArrayTypeThatDoesNotHaveIt() : void
1257
    {
1258
        if ( ! $this->_sm->getDatabasePlatform()->hasNativeJsonType()) {
1259
            $this->markTestSkipped('This test is only supported on platforms that have native JSON type.');
1260
        }
1261
1262
        $this->_conn->executeQuery('CREATE TABLE json_array_test (parameters JSON NOT NULL)');
1263
1264
        $table = new Table('json_array_test');
1265
        $table->addColumn('parameters', 'json_array');
1266
1267
        $comparator = new Comparator();
1268
        $tableDiff  = $comparator->diffTable($this->_sm->listTableDetails('json_array_test'), $table);
1269
1270
        self::assertInstanceOf(TableDiff::class, $tableDiff);
1271
        self::assertSame(['comment'], $tableDiff->changedColumns['parameters']->changedProperties);
1272
    }
1273
1274
    /**
1275
     * @group 2782
@@ 1278-1294 (lines=17) @@
1275
     * @group 2782
1276
     * @group 6654
1277
     */
1278
    public function testComparatorShouldReturnAllChangesWhenUsingLegacyJsonArrayType() : void
1279
    {
1280
        if ( ! $this->_sm->getDatabasePlatform()->hasNativeJsonType()) {
1281
            $this->markTestSkipped('This test is only supported on platforms that have native JSON type.');
1282
        }
1283
1284
        $this->_conn->executeQuery('CREATE TABLE json_array_test (parameters JSON DEFAULT NULL)');
1285
1286
        $table = new Table('json_array_test');
1287
        $table->addColumn('parameters', 'json_array');
1288
1289
        $comparator = new Comparator();
1290
        $tableDiff  = $comparator->diffTable($this->_sm->listTableDetails('json_array_test'), $table);
1291
1292
        self::assertInstanceOf(TableDiff::class, $tableDiff);
1293
        self::assertSame(['notnull', 'comment'], $tableDiff->changedColumns['parameters']->changedProperties);
1294
    }
1295
1296
    /**
1297
     * @group 2782
@@ 1300-1316 (lines=17) @@
1297
     * @group 2782
1298
     * @group 6654
1299
     */
1300
    public function testComparatorShouldReturnAllChangesWhenUsingLegacyJsonArrayTypeEvenWhenPlatformHasJsonSupport() : void
1301
    {
1302
        if ( ! $this->_sm->getDatabasePlatform()->hasNativeJsonType()) {
1303
            $this->markTestSkipped('This test is only supported on platforms that have native JSON type.');
1304
        }
1305
1306
        $this->_conn->executeQuery('CREATE TABLE json_array_test (parameters JSON DEFAULT NULL)');
1307
1308
        $table = new Table('json_array_test');
1309
        $table->addColumn('parameters', 'json_array');
1310
1311
        $comparator = new Comparator();
1312
        $tableDiff  = $comparator->diffTable($this->_sm->listTableDetails('json_array_test'), $table);
1313
1314
        self::assertInstanceOf(TableDiff::class, $tableDiff);
1315
        self::assertSame(['notnull', 'comment'], $tableDiff->changedColumns['parameters']->changedProperties);
1316
    }
1317
1318
    /**
1319
     * @group 2782