Skip to content

Commit

Permalink
[ticket/11404] Add tests for phpbb_avatar_manager::clean_row()
Browse files Browse the repository at this point in the history
PHPBB3-11404
  • Loading branch information
marc1706 committed Mar 11, 2013
1 parent 2ec0dc5 commit fb1984d
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions tests/avatar/manager_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,75 @@ public function test_get_avatar_settings()

$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);
}
}
}

0 comments on commit fb1984d

Please sign in to comment.