[ticket/12822] Fix test runs of avatar manager_test

PHPBB3-12822
This commit is contained in:
Marc Alexander 2014-08-08 12:01:29 +02:00
parent e0c2013bb9
commit 70978e96d3

View file

@ -72,11 +72,11 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case
{ {
if ($driver !== 'upload') if ($driver !== 'upload')
{ {
$cur_avatar = $this->getMock('\phpbb\avatar\driver\\' . $driver, array('get_name'), array($config, $phpbb_root_path, $phpEx, $path_helper, $cache)); $cur_avatar = $this->getMock('\phpbb\avatar\driver\\' . $driver, array('get_name'), array($this->config, $phpbb_root_path, $phpEx, $path_helper, $cache));
} }
else else
{ {
$cur_avatar = $this->getMock('\phpbb\avatar\driver\\' . $driver, array('get_name'), array($config, $phpbb_root_path, $phpEx, $path_helper, $guesser, $cache)); $cur_avatar = $this->getMock('\phpbb\avatar\driver\\' . $driver, array('get_name'), array($this->config, $phpbb_root_path, $phpEx, $path_helper, $guesser, $cache));
} }
$cur_avatar->expects($this->any()) $cur_avatar->expects($this->any())
->method('get_name') ->method('get_name')
@ -323,7 +323,14 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case
$sql = 'SELECT * FROM ' . $table . ' $sql = 'SELECT * FROM ' . $table . '
WHERE ' . $prefix . 'id = ' . $id; WHERE ' . $prefix . 'id = ' . $id;
$result = $this->db->sql_query($sql); $result = $this->db->sql_query_limit($sql, 1);
$this->assertSame($expected, $this->manager->clean_row($this->db->sql_fetchrow($result), substr($prefix, -1)));
$row = $this->manager->clean_row($this->db->sql_fetchrow($result), substr($prefix, 0, -1));
$this->db->sql_freeresult($result);
foreach ($expected as $key => $value)
{
$this->assertEquals($value, $row[$key]);
}
} }
} }