From fb9bac3fd9c8b4b9c20d5a1daa1b42cbb818e161 Mon Sep 17 00:00:00 2001 From: nuxsmin Date: Wed, 25 Jul 2018 01:32:18 +0200 Subject: [PATCH] * [MOD] Unit testing. Work in progress --- test/SP/Repositories/UserGroupRepositoryTest.php | 6 ++++-- test/SP/Services/UserGroup/UserGroupServiceTest.php | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/test/SP/Repositories/UserGroupRepositoryTest.php b/test/SP/Repositories/UserGroupRepositoryTest.php index 8970293d..a08c3fda 100644 --- a/test/SP/Repositories/UserGroupRepositoryTest.php +++ b/test/SP/Repositories/UserGroupRepositoryTest.php @@ -79,7 +79,7 @@ class UserGroupRepositoryTestCase extends DatabaseTestCase $this->assertEquals(5, self::$repository->getUsageByUsers(2)->getNumRows()); - $this->assertEquals(0, self::$repository->getUsageByUsers(3)->getNumRows()); + $this->assertEquals(0, self::$repository->getUsageByUsers(4)->getNumRows()); } /** @@ -296,7 +296,9 @@ class UserGroupRepositoryTestCase extends DatabaseTestCase { $this->assertEquals(7, self::$repository->getUsage(2)->getNumRows()); - $this->assertEquals(0, self::$repository->getUsage(3)->getNumRows()); + $this->assertEquals(1, self::$repository->getUsage(3)->getNumRows()); + + $this->assertEquals(0, self::$repository->getUsage(4)->getNumRows()); } /** diff --git a/test/SP/Services/UserGroup/UserGroupServiceTest.php b/test/SP/Services/UserGroup/UserGroupServiceTest.php index 843026e1..949f4ecb 100644 --- a/test/SP/Services/UserGroup/UserGroupServiceTest.php +++ b/test/SP/Services/UserGroup/UserGroupServiceTest.php @@ -192,7 +192,9 @@ class UserGroupServiceTest extends DatabaseTestCase { $this->assertCount(7, self::$service->getUsage(2)); - $this->assertCount(0, self::$service->getUsage(3)); + $this->assertCount(1, self::$service->getUsage(3)); + + $this->assertCount(0, self::$service->getUsage(4)); } /** @@ -311,6 +313,6 @@ class UserGroupServiceTest extends DatabaseTestCase $this->assertCount(5, self::$service->getUsageByUsers(2)); - $this->assertCount(0, self::$service->getUsageByUsers(3)); + $this->assertCount(0, self::$service->getUsageByUsers(4)); } }