diff options
author | Marc Alexander <admin@m-a-styles.de> | 2013-03-11 10:33:16 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2013-03-11 10:34:25 +0100 |
commit | fb1984dadb2ef4ec679f3a66e1a98e75bbe38dec (patch) | |
tree | c7626e10e35fa3b0c2b6bcc8e33ab89d9b320c44 /tests/avatar/manager_test.php | |
parent | 2ec0dc5b34e88c737e0737e73a46e1edd1573f10 (diff) | |
download | forums-fb1984dadb2ef4ec679f3a66e1a98e75bbe38dec.tar forums-fb1984dadb2ef4ec679f3a66e1a98e75bbe38dec.tar.gz forums-fb1984dadb2ef4ec679f3a66e1a98e75bbe38dec.tar.bz2 forums-fb1984dadb2ef4ec679f3a66e1a98e75bbe38dec.tar.xz forums-fb1984dadb2ef4ec679f3a66e1a98e75bbe38dec.zip |
[ticket/11404] Add tests for phpbb_avatar_manager::clean_row()
PHPBB3-11404
Diffstat (limited to 'tests/avatar/manager_test.php')
-rw-r--r-- | tests/avatar/manager_test.php | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/tests/avatar/manager_test.php b/tests/avatar/manager_test.php index 7ea3cc6a0f..ffcfe2ce11 100644 --- a/tests/avatar/manager_test.php +++ b/tests/avatar/manager_test.php @@ -87,4 +87,75 @@ class phpbb_avatar_manager_test extends PHPUnit_Framework_TestCase $this->assertEquals($expected_settings, $avatar_settings); } + + public function database_row_data() + { + return array( + array( + array( + 'user_avatar' => '', + 'user_avatar_type' => '', + 'user_avatar_width' => '', + 'user_avatar_height' => '', + ), + array( + 'avatar' => '', + 'avatar_type' => '', + 'avatar_width' => '', + 'avatar_height' => '', + ), + ), + array( + array( + 'group_avatar' => '', + 'group_avatar_type' => '', + 'group_avatar_width' => '', + 'group_avatar_height' => '', + ), + array( + 'avatar' => '', + 'avatar_type' => '', + 'avatar_width' => '', + 'avatar_height' => '', + ), + ), + array( + array(), + array( + 'avatar' => '', + 'avatar_type' => '', + 'avatar_width' => '', + 'avatar_height' => '', + ), + ), + array( + array( + 'foobar_avatar' => '', + 'foobar_avatar_type' => '', + 'foobar_avatar_width' => '', + 'foobar_avatar_height' => '', + ), + array( + 'foobar_avatar' => '', + 'foobar_avatar_type' => '', + 'foobar_avatar_width' => '', + 'foobar_avatar_height' => '', + ), + ), + ); + } + + /** + * @dataProvider database_row_data + */ + public function test_clean_row(array $input, array $output) + { + $cleaned_row = array(); + + $cleaned_row = phpbb_avatar_manager::clean_row($input); + foreach ($output as $key => $null) + { + $this->assertArrayHasKey($key, $cleaned_row); + } + } } |