From ab6d36dd576aadf37a36da2cd2f4ba1219540253 Mon Sep 17 00:00:00 2001 From: Shitiz Garg Date: Tue, 24 Jun 2014 22:22:10 +0530 Subject: [PATCH] [ticket/12334] Add get_profile_value_raw unit test for type_string PHPBB3-12334 --- tests/profilefields/type_string_test.php | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/profilefields/type_string_test.php b/tests/profilefields/type_string_test.php index cee8a1d863..2b3d239c3e 100644 --- a/tests/profilefields/type_string_test.php +++ b/tests/profilefields/type_string_test.php @@ -225,6 +225,36 @@ class phpbb_profilefield_type_string_test extends phpbb_test_case $this->assertSame($expected, $result, $description); } + public function get_profile_value_raw_data() + { + return array( + array( + '[b]bbcode test[/b]', + array('field_show_novalue' => true), + '[b]bbcode test[/b]', + 'Field should return the correct raw value', + ), + array( + '[b]bbcode test[/b]', + array('field_show_novalue' => false), + '[b]bbcode test[/b]', + 'Field should return correct raw value', + ), + ); + } + + /** + * @dataProvider get_profile_value_raw_data + */ + public function test_get_profile_value_raw($value, $field_options, $expected, $description) + { + $field_options = array_merge($this->field_options, $field_options); + + $result = $this->cp->get_profile_value_raw($value, $field_options); + + $this->assertSame($expected, $result, $description); + } + public function return_callback_implode() { return implode('-', func_get_args());