From ba460d98f1fb78da1f996ae7fcc5cc28e574d3ba Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 15 Mar 2013 01:36:05 +0100 Subject: [ticket/11441] Split user loader tests into multiple test methods. PHPBB3-11441 --- tests/user/user_loader_test.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tests/user') 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']); -- cgit v1.2.1