Code Duplication    Length = 22-22 lines in 4 locations

tests/unit/Domain/Blog/Series/MysqlSeriesRepositoryTest.php 1 location

@@ 332-353 (lines=22) @@
329
        $this->assertInternalType('array', $data);
330
    }
331
332
    protected function insertPostData(array $data)
333
    {
334
        $defaultData = [
335
            'id' => null,
336
            'title' => '',
337
            'path' => '',
338
            'category' => '',
339
            'date' => '',
340
            'body' => '',
341
            'display' => 0,
342
        ];
343
344
        $data = array_merge($defaultData, $data);
345
346
        return self::$connection->getDefault()->perform("
347
            INSERT INTO `jpemeric_blog`.`post`
348
                (id, title, path, category, date, body, display)
349
            VALUES
350
                (:id, :title, :path, :category, :date, :body, :display)",
351
            $data
352
        );
353
    }
354
355
    protected function insertSeriesData(array $data)
356
    {

tests/unit/Domain/Blog/Tag/MysqlTagRepositoryTest.php 1 location

@@ 451-472 (lines=22) @@
448
        $this->assertInternalType('array', $data);
449
    }
450
451
    protected function insertPostData(array $data)
452
    {
453
        $defaultData = [
454
            'id' => null,
455
            'title' => '',
456
            'path' => '',
457
            'category' => '',
458
            'date' => '',
459
            'body' => '',
460
            'display' => 0,
461
        ];
462
463
        $data = array_merge($defaultData, $data);
464
465
        return self::$connection->getDefault()->perform("
466
            INSERT INTO `jpemeric_blog`.`post`
467
                (id, title, path, category, date, body, display)
468
            VALUES
469
                (:id, :title, :path, :category, :date, :body, :display)",
470
            $data
471
        );
472
    }
473
474
    protected function insertPTLinkData(array $data)
475
    {

tests/unit/Domain/Stream/Activity/MysqlActivityRepositoryTest.php 1 location

@@ 422-443 (lines=22) @@
419
        $this->assertEquals('0', $data);
420
    }
421
422
    protected function insertData(array $data)
423
    {
424
        $defaultData = [
425
            'id' => null,
426
            'message' => '',
427
            'message_long' => '',
428
            'datetime' => '',
429
            'metadata' => '',
430
            'type' => '',
431
            'type_id' => '',
432
        ];
433
434
        $data = array_merge($defaultData, $data);
435
436
        return self::$connection->getDefault()->perform("
437
            INSERT INTO `jpemeric_stream`.`activity`
438
                (id, message, message_long, datetime, metadata, type, type_id)
439
            VALUES
440
                (:id, :message, :message_long, :datetime, :metadata, :type, :type_id)",
441
            $data
442
        );
443
    }
444
445
    protected function tearDown()
446
    {

tests/unit/Domain/Blog/Post/MysqlPostRepositoryTest.php 1 location

@@ 1217-1238 (lines=22) @@
1214
        $this->assertInternalType('array', $data);
1215
    }
1216
1217
    protected function insertPostData(array $data)
1218
    {
1219
        $defaultData = [
1220
            'id' => null,
1221
            'title' => '',
1222
            'path' => '',
1223
            'category' => '',
1224
            'date' => '',
1225
            'body' => '',
1226
            'display' => 0,
1227
        ];
1228
1229
        $data = array_merge($defaultData, $data);
1230
1231
        return self::$connection->getDefault()->perform("
1232
            INSERT INTO `jpemeric_blog`.`post`
1233
                (id, title, path, category, date, body, display)
1234
            VALUES
1235
                (:id, :title, :path, :category, :date, :body, :display)",
1236
            $data
1237
        );
1238
    }
1239
1240
    protected function insertPTLinkData(array $data)
1241
    {