Code Duplication    Length = 17-17 lines in 3 locations

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

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