1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/14403] Don't expect user_id and user_ip in phpbb\log

PHPBB3-14403
This commit is contained in:
Oliver Schramm
2016-01-10 17:43:10 +01:00
parent d64680983a
commit 0cc41b94b1
2 changed files with 11 additions and 2 deletions

View File

@@ -88,5 +88,14 @@ class phpbb_log_add_test extends phpbb_database_test_case
// Invalid mode specified
$this->assertFalse($log->add('mode_does_not_exist', $user_id, $log_ip, $log_operation, $log_time));
// null user and null ip given
$this->assertEquals(3, $log->add($mode, null, null, $log_operation, $log_time), 'Adding log with null user_id and null user_ip failed');
$sql = 'SELECT user_id, log_ip FROM ' . LOG_TABLE . ' WHERE log_id = 3';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$this->assertEquals(ANONYMOUS, $row['user_id'], 'Adding log with null user_id failed');
$this->assertEquals('', $row['log_ip'], 'Adding log with null user_ip failed');
}
}