aboutsummaryrefslogtreecommitdiffstats
path: root/tests/user/user_loader_test.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2013-03-15 01:36:05 +0100
committerAndreas Fischer <bantu@phpbb.com>2013-03-15 01:36:05 +0100
commitba460d98f1fb78da1f996ae7fcc5cc28e574d3ba (patch)
tree5326e0b95455c86cb1d98312628761b397ebf756 /tests/user/user_loader_test.php
parentef1caf69332bed24a12fdeda98711f5012c85ebd (diff)
downloadforums-ba460d98f1fb78da1f996ae7fcc5cc28e574d3ba.tar
forums-ba460d98f1fb78da1f996ae7fcc5cc28e574d3ba.tar.gz
forums-ba460d98f1fb78da1f996ae7fcc5cc28e574d3ba.tar.bz2
forums-ba460d98f1fb78da1f996ae7fcc5cc28e574d3ba.tar.xz
forums-ba460d98f1fb78da1f996ae7fcc5cc28e574d3ba.zip
[ticket/11441] Split user loader tests into multiple test methods.
PHPBB3-11441
Diffstat (limited to 'tests/user/user_loader_test.php')
-rw-r--r--tests/user/user_loader_test.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/user/user_loader_test.php b/tests/user/user_loader_test.php
index 89659256f8..5cdb654b18 100644
--- a/tests/user/user_loader_test.php
+++ b/tests/user/user_loader_test.php
@@ -27,7 +27,7 @@ class phpbb_user_loader_test extends phpbb_database_test_case
$this->user_loader = new phpbb_user_loader($this->db, __DIR__ . '/../../phpBB/', 'php', 'phpbb_users');
}
- public function test_user_loader()
+ public function test_load_get()
{
$this->user_loader->load_users(array(2));
@@ -38,8 +38,12 @@ class phpbb_user_loader_test extends phpbb_database_test_case
$user = $this->user_loader->get_user(2);
$this->assertEquals(2, $user['user_id']);
$this->assertEquals('Admin', $user['username']);
+ }
+
+ public function test_load_get_unloaded()
+ {
+ $this->user_loader->load_users(array(2));
- // Not loaded
$user = $this->user_loader->get_user(3);
$this->assertEquals(1, $user['user_id']);
$this->assertEquals('Guest', $user['username']);
@@ -47,7 +51,10 @@ class phpbb_user_loader_test extends phpbb_database_test_case
$user = $this->user_loader->get_user(3, true);
$this->assertEquals(3, $user['user_id']);
$this->assertEquals('Test', $user['username']);
+ }
+ public function test_load_user_by_username()
+ {
$user_id = $this->user_loader->load_user_by_username('Test');
$user = $this->user_loader->get_user($user_id);
$this->assertEquals(3, $user['user_id']);