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

@@ 716-737 (lines=22) @@
713
714
    public function testGetActivePostsByRelatedTagsFailure() {}
715
716
    protected function insertPostData(array $data)
717
    {
718
        $defaultData = [
719
            'id' => null,
720
            'title' => '',
721
            'path' => '',
722
            'category' => '',
723
            'date' => '',
724
            'body' => '',
725
            'display' => 0,
726
        ];
727
728
        $data = array_merge($defaultData, $data);
729
730
        return self::$connection->getDefault()->perform("
731
            INSERT INTO `jpemeric_blog`.`post`
732
                (id, title, path, category, date, body, display)
733
            VALUES
734
                (:id, :title, :path, :category, :date, :body, :display)",
735
            $data
736
        );
737
    }
738
739
    protected function insertPTLinkData(array $data)
740
    {