From 3edd3df3b1eb456cc33dc33579c4a57d9cb06cf2 Mon Sep 17 00:00:00 2001 From: Alexey Skobkin Date: Sat, 14 Jan 2017 04:08:41 +0300 Subject: [PATCH] UserRepositoryTest fixed according to the new fixture. --- .../Repository/UserRepositoryTest.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/Skobkin/PointToolsBundle/Repository/UserRepositoryTest.php b/tests/Skobkin/PointToolsBundle/Repository/UserRepositoryTest.php index b7041c5..f45f804 100644 --- a/tests/Skobkin/PointToolsBundle/Repository/UserRepositoryTest.php +++ b/tests/Skobkin/PointToolsBundle/Repository/UserRepositoryTest.php @@ -71,16 +71,27 @@ class UserRepositoryTest extends KernelTestCase public function testFindUserSubscribersById() { $subscribers = $this->userRepo->findUserSubscribersById(99999); + $this->assertCount(4, $subscribers, 'Not exactly 4 subscribers found for user#99999'); + + $subscribers = $this->userRepo->findUserSubscribersById(99998); + $this->assertCount(2, $subscribers, 'Not exactly 2 subscribers found for user#99998'); + + $subscribers = $this->userRepo->findUserSubscribersById(99997); + $this->assertCount(1, $subscribers, 'Not exactly 1 subscriber found for user#99997'); + + $subscribers = $this->userRepo->findUserSubscribersById(99996); + $this->assertCount(0, $subscribers, 'Not exactly 0 subscribers found for user#99996'); + + $subscribers = $this->userRepo->findUserSubscribersById(99995); + $this->assertCount(0, $subscribers, 'Not exactly 0 subscribers found for user#99995'); - $this->assertGreaterThanOrEqual(2, count($subscribers), 'Less than 2 subscribers found'); - $this->assertLessThanOrEqual(5, count($subscribers), 'More than 5 subscribers found'); } public function testGetTopUsers() { $topUsers = $this->userRepo->getTopUsers(); - $this->assertCount(5, $topUsers, 'Found not exactly 5 top users'); + $this->assertCount(3, $topUsers, 'Found not exactly 3 top users'); foreach ($topUsers as $topUser) { $this->assertEquals(TopUserDTO::class, get_class($topUser), 'Invalid type returned');