Code Duplication    Length = 28-28 lines in 2 locations

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

@@ 334-361 (lines=28) @@
331
        }
332
    }
333
334
    public function testGetActivitiesByTypeRangeFailure()
335
    {
336
        $testData = [
337
            [
338
                'id' => rand(1, 100),
339
                'message' => 'test one',
340
                'type' => 'type one',
341
            ],
342
            [
343
                'id' => rand(101, 200),
344
                'message' => 'test two',
345
                'type' => 'type one',
346
            ],
347
            [
348
                'id' => rand(201, 300),
349
                'message' => 'test three',
350
                'type' => 'type one',
351
            ],
352
        ];
353
354
        array_walk($testData, [$this, 'insertData']);
355
356
        $repository = new MysqlActivityRepository(self::$connection);
357
        $data = $repository->getActivitiesByType('type two', 2, 1);
358
359
        $this->assertEmpty($data);
360
        $this->assertInternalType('array', $data);
361
    }
362
363
    public function testGetActivitiesByTypeCount()
364
    {

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

@@ 846-873 (lines=28) @@
843
        ));
844
    }
845
846
    public function testGetActivePostsByCategoryRangeFailure()
847
    {
848
        $testData = [
849
            [
850
                'id'       => rand(1, 100),
851
                'category' => 'test category',
852
                'display'  => 1,
853
            ],
854
            [
855
                'id'       => rand(101, 200),
856
                'category' => 'test category',
857
                'display'  => 1,
858
            ],
859
            [
860
                'id'       => rand(201, 300),
861
                'category' => 'test category',
862
                'display'  => 1,
863
            ],
864
        ];
865
866
        array_walk($testData, [$this, 'insertPostData']);
867
868
        $repository = new MysqlPostRepository(self::$connection);
869
        $data = $repository->getActivePostsByCategory(reset($testData)['category'], 1, 3);
870
871
        $this->assertEmpty($data);
872
        $this->assertInternalType('array', $data);
873
    }
874
875
    public function testGetActivePostsCountByCategory()
876
    {