aboutsummaryrefslogtreecommitdiffstats
path: root/tests/user/user_loader.php
diff options
context:
space:
mode:
authorDavid King <imkingdavid@gmail.com>2013-02-28 18:53:23 -0500
committerDavid King <imkingdavid@gmail.com>2013-02-28 18:53:23 -0500
commit8200509c7940166d560c309c35b2ade2e4952f75 (patch)
tree5f4e89b1fe677520a4310754860a9c85511bb2b0 /tests/user/user_loader.php
parent1eead4da97635df35bfcdd6b1ce7ed71d9851d41 (diff)
parentecb9f44bf11756e1072354bfd658edfd4c01f74a (diff)
downloadforums-8200509c7940166d560c309c35b2ade2e4952f75.tar
forums-8200509c7940166d560c309c35b2ade2e4952f75.tar.gz
forums-8200509c7940166d560c309c35b2ade2e4952f75.tar.bz2
forums-8200509c7940166d560c309c35b2ade2e4952f75.tar.xz
forums-8200509c7940166d560c309c35b2ade2e4952f75.zip
Merge remote-tracking branch 'EXreaction/ticket/11103' into develop
# By Nathan Guse (169) and others # Via Nathan Guse (29) and Nathaniel Guse (7) * EXreaction/ticket/11103: (217 commits) [ticket/11103] Revert whitespace changes [ticket/11103] Few more minor language things [ticket/11103] Don't call generate_board_url many times [ticket/11103] Case time in queries as an int [ticket/11103] Fix effectively installed check [ticket/11103] Remove padding from notifications for now. [ticket/11103] Notifications Migration file [ticket/11103] Restore new/unread messages info/link in header (properly) [ticket/11103] Add newlines to bottom of css file [ticket/11103] HTML encode double arrow character [ticket/11103] Add Notification Settings link in flyout menu [ticket/11103] Restore new/unread messages info/link in header [ticket/11103] Update styling of UCP Notifications in subsilver2 [ticket/11103] Update styling of UCP Notifications in prosilver [ticket/11103] Update styling of subsilver2 notification modal [ticket/11103] Update styling of prosilver notification modal [ticket/11103] Remove title attribute from notification link [ticket/11103] Mark/Unmark All buttons [ticket/11103] Make the number of notifications strong if > 0 [ticket/11103] Rounded Corners and antialiased pointer ...
Diffstat (limited to 'tests/user/user_loader.php')
-rw-r--r--tests/user/user_loader.php49
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/user/user_loader.php b/tests/user/user_loader.php
new file mode 100644
index 0000000000..0beb804729
--- /dev/null
+++ b/tests/user/user_loader.php
@@ -0,0 +1,49 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2011 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+include_once(__DIR__ . '/../../phpBB/includes/utf/utf_tools.php');
+
+class phpbb_user_lang_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/user_loader.xml');
+ }
+
+ public function test_user_loader()
+ {
+ $db = $this->new_dbal();
+
+ $user_loader = new phpbb_user_loader($db, __DIR__ . '/../../phpBB/', 'php', 'phpbb_users');
+
+ $user_loader->load_users(array(2));
+
+ $user = $user_loader->get_user(1);
+ $this->assertEquals(1, $user['user_id']);
+ $this->assertEquals('Guest', $user['username']);
+
+ $user = $user_loader->get_user(2);
+ $this->assertEquals(2, $user['user_id']);
+ $this->assertEquals('Admin', $user['username']);
+
+ // Not loaded
+ $user = $user_loader->get_user(3);
+ $this->assertEquals(1, $user['user_id']);
+ $this->assertEquals('Guest', $user['username']);
+
+ $user = $user_loader->get_user(3, true);
+ $this->assertEquals(3, $user['user_id']);
+ $this->assertEquals('Test', $user['username']);
+
+ $user_id = $user_loader->load_user_by_username('Test');
+ $user = $user_loader->get_user($user_id);
+ $this->assertEquals(3, $user['user_id']);
+ $this->assertEquals('Test', $user['username']);
+ }
+}