Code Duplication    Length = 22-22 lines in 2 locations

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

@@ 192-213 (lines=22) @@
189
        $this->assertInternalType('array', $data);
190
    }
191
192
    public function testGetActivitiesCount()
193
    {
194
        $testData = [
195
            [
196
                'id' => rand(1, 100),
197
                'message' => 'test one',
198
            ],
199
            [
200
                'id' => rand(101, 200),
201
                'message' => 'test two',
202
            ],
203
        ];
204
205
        array_walk($testData, [$this, 'insertData']);
206
207
        $repository = new MysqlActivityRepository(self::$connection);
208
        $data = $repository->getActivitiesCount();
209
210
        $this->assertNotFalse($data);
211
        $this->assertStringMatchesFormat('%d', $data);
212
        $this->assertEquals(count($testData), $data);
213
    }
214
215
    public function testGetActivitiesCountEmpty()
216
    {

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

@@ 308-329 (lines=22) @@
305
        $this->assertInternalType('array', $data);
306
    }
307
308
    public function testGetActivePostsCount()
309
    {
310
        $testData = [
311
            [
312
                'id'      => rand(1, 100),
313
                'display' => 1,
314
            ],
315
            [
316
                'id'      => rand(101, 200),
317
                'display' => 1,
318
            ],
319
        ];
320
321
        array_walk($testData, [$this, 'insertPostData']);
322
323
        $repository = new MysqlPostRepository(self::$connection);
324
        $data = $repository->getActivePostsCount();
325
326
        $this->assertNotFalse($data);
327
        $this->assertStringMatchesFormat('%d', $data);
328
        $this->assertEquals(count($testData), $data);
329
    }
330
331
    public function testGetActivePostsCountInactive()
332
    {