Code Duplication    Length = 17-17 lines in 3 locations

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

@@ 1228-1244 (lines=17) @@
1225
     * @group 2782
1226
     * @group 6654
1227
     */
1228
    public function testComparatorShouldAddCommentToLegacyJsonArrayTypeThatDoesNotHaveIt() : void
1229
    {
1230
        if ( ! $this->_sm->getDatabasePlatform()->hasNativeJsonType()) {
1231
            $this->markTestSkipped('This test is only supported on platforms that have native JSON type.');
1232
        }
1233
1234
        $this->_conn->executeQuery('CREATE TABLE json_array_test (parameters JSON NOT NULL)');
1235
1236
        $table = new Table('json_array_test');
1237
        $table->addColumn('parameters', 'json_array');
1238
1239
        $comparator = new Comparator();
1240
        $tableDiff  = $comparator->diffTable($this->_sm->listTableDetails('json_array_test'), $table);
1241
1242
        self::assertInstanceOf(TableDiff::class, $tableDiff);
1243
        self::assertSame(['comment'], $tableDiff->changedColumns['parameters']->changedProperties);
1244
    }
1245
1246
    /**
1247
     * @group 2782
@@ 1250-1266 (lines=17) @@
1247
     * @group 2782
1248
     * @group 6654
1249
     */
1250
    public function testComparatorShouldReturnAllChangesWhenUsingLegacyJsonArrayType() : void
1251
    {
1252
        if ( ! $this->_sm->getDatabasePlatform()->hasNativeJsonType()) {
1253
            $this->markTestSkipped('This test is only supported on platforms that have native JSON type.');
1254
        }
1255
1256
        $this->_conn->executeQuery('CREATE TABLE json_array_test (parameters JSON DEFAULT NULL)');
1257
1258
        $table = new Table('json_array_test');
1259
        $table->addColumn('parameters', 'json_array');
1260
1261
        $comparator = new Comparator();
1262
        $tableDiff  = $comparator->diffTable($this->_sm->listTableDetails('json_array_test'), $table);
1263
1264
        self::assertInstanceOf(TableDiff::class, $tableDiff);
1265
        self::assertSame(['notnull', 'comment'], $tableDiff->changedColumns['parameters']->changedProperties);
1266
    }
1267
1268
    /**
1269
     * @group 2782
@@ 1272-1288 (lines=17) @@
1269
     * @group 2782
1270
     * @group 6654
1271
     */
1272
    public function testComparatorShouldReturnAllChangesWhenUsingLegacyJsonArrayTypeEvenWhenPlatformHasJsonSupport() : void
1273
    {
1274
        if ( ! $this->_sm->getDatabasePlatform()->hasNativeJsonType()) {
1275
            $this->markTestSkipped('This test is only supported on platforms that have native JSON type.');
1276
        }
1277
1278
        $this->_conn->executeQuery('CREATE TABLE json_array_test (parameters JSON DEFAULT NULL)');
1279
1280
        $table = new Table('json_array_test');
1281
        $table->addColumn('parameters', 'json_array');
1282
1283
        $comparator = new Comparator();
1284
        $tableDiff  = $comparator->diffTable($this->_sm->listTableDetails('json_array_test'), $table);
1285
1286
        self::assertInstanceOf(TableDiff::class, $tableDiff);
1287
        self::assertSame(['notnull', 'comment'], $tableDiff->changedColumns['parameters']->changedProperties);
1288
    }
1289
1290
    /**
1291
     * @group 2782