aboutsummaryrefslogtreecommitdiffstats
path: root/tests/avatar
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2013-11-13 09:52:21 -0800
committerNils Adermann <naderman@naderman.de>2013-11-13 09:52:21 -0800
commit52845b22f24c19757a437ab0bda8b7583a10a398 (patch)
treefe524543e830c607682477ef751b43f1ebb8ebd5 /tests/avatar
parente48b2c07ebe95aaff93eed6c7df5dff5d6c50fe2 (diff)
parent13a4ceedb18ba938d3cd18e2f68707385bc9283a (diff)
downloadforums-52845b22f24c19757a437ab0bda8b7583a10a398.tar
forums-52845b22f24c19757a437ab0bda8b7583a10a398.tar.gz
forums-52845b22f24c19757a437ab0bda8b7583a10a398.tar.bz2
forums-52845b22f24c19757a437ab0bda8b7583a10a398.tar.xz
forums-52845b22f24c19757a437ab0bda8b7583a10a398.zip
Merge pull request #1815 from marc1706/ticket/11525
[ticket/11525] Only remove group or user prefix from given avatar data
Diffstat (limited to 'tests/avatar')
-rw-r--r--tests/avatar/manager_test.php68
1 files changed, 41 insertions, 27 deletions
diff --git a/tests/avatar/manager_test.php b/tests/avatar/manager_test.php
index 0db3f13617..527bb223d5 100644
--- a/tests/avatar/manager_test.php
+++ b/tests/avatar/manager_test.php
@@ -152,12 +152,24 @@ class phpbb_avatar_manager_test extends PHPUnit_Framework_TestCase
return array(
array(
array(
- 'user_avatar' => '',
- 'user_avatar_type' => '',
- 'user_avatar_width' => '',
+ 'user_avatar' => '',
+ 'user_avatar_type' => '',
+ 'user_avatar_width' => '',
'user_avatar_height' => '',
+ 'group_avatar' => '',
),
array(
+ 'user_avatar' => '',
+ 'user_avatar_type' => '',
+ 'user_avatar_width' => '',
+ 'user_avatar_height' => '',
+ 'group_avatar' => '',
+ ),
+ 'foobar',
+ ),
+ array(
+ array(),
+ array(
'avatar' => '',
'avatar_type' => '',
'avatar_width' => '',
@@ -166,40 +178,41 @@ class phpbb_avatar_manager_test extends PHPUnit_Framework_TestCase
),
array(
array(
- 'group_avatar' => '',
- 'group_avatar_type' => '',
- 'group_avatar_width' => '',
- 'group_avatar_height' => '',
+ 'user_avatar' => '',
+ 'user_id' => 5,
+ 'group_id' => 4,
),
array(
- 'avatar' => '',
- 'avatar_type' => '',
- 'avatar_width' => '',
- 'avatar_height' => '',
+ 'user_avatar' => '',
+ 'user_id' => 5,
+ 'group_id' => 4,
),
),
array(
- array(),
array(
- 'avatar' => '',
- 'avatar_type' => '',
- 'avatar_width' => '',
- 'avatar_height' => '',
+ 'user_avatar' => '',
+ 'user_id' => 5,
+ 'group_id' => 4,
+ ),
+ array(
+ 'avatar' => '',
+ 'id' => 5,
+ 'group_id' => 4,
),
+ 'user',
),
array(
array(
- 'foobar_avatar' => '',
- 'foobar_avatar_type' => '',
- 'foobar_avatar_width' => '',
- 'foobar_avatar_height' => '',
+ 'group_avatar' => '',
+ 'user_id' => 5,
+ 'group_id' => 4,
),
array(
- 'foobar_avatar' => '',
- 'foobar_avatar_type' => '',
- 'foobar_avatar_width' => '',
- 'foobar_avatar_height' => '',
+ 'avatar' => '',
+ 'id' => 'g4',
+ 'user_id' => 5,
),
+ 'group',
),
);
}
@@ -207,14 +220,15 @@ class phpbb_avatar_manager_test extends PHPUnit_Framework_TestCase
/**
* @dataProvider database_row_data
*/
- public function test_clean_row(array $input, array $output)
+ public function test_clean_row(array $input, array $output, $prefix = '')
{
$cleaned_row = array();
- $cleaned_row = \phpbb\avatar\manager::clean_row($input);
- foreach ($output as $key => $null)
+ $cleaned_row = \phpbb\avatar\manager::clean_row($input, $prefix);
+ foreach ($output as $key => $value)
{
$this->assertArrayHasKey($key, $cleaned_row);
+ $this->assertEquals($cleaned_row[$key], $value);
}
}