diff options
Diffstat (limited to 'tests/avatar/manager_test.php')
-rw-r--r-- | tests/avatar/manager_test.php | 68 |
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); } } |